<div dir="ltr"><div>I'm interested in a feature that adds globbing for class paths.<br><br>
<div>E.g.:<br></div><div><br></div>classes:<br> locations/*/networks/*<br><br></div>In this case, locations has several location directories, and each location also has several yml files in the networks directory. This would be a shortcut for including/merging all those network files, when needed. This of course is just an example, I imagine there could be any number of similar use cases.<br>
<div><br>I was thinking of something like this, in storage/yaml_fs/__init__.py<br><div class="gmail_quote"><div dir="ltr"><br> def _read_nodeinfo(self, name, base_uri, seen, nodename=None):<br> path = os.path.join(base_uri, name + FILE_EXTENSION)<br>
+ paths = glob.glob(path)<br>
+ if len(paths) > 1:<br>+ merge_base = Entity()<br>+ for f in paths:<br>+ f = f.replace(base_uri, '', 1).lstrip('/')<br>+ f = f[:f.rfind(FILE_EXTENSION)]<br>
+ ret = self._read_nodeinfo(f, base_uri, seen,<br>+ name if nodename is None else nodename)[0]<br>+ merge_base.merge(ret)<br>+ return merge_base, path<br>
+ else:<br><br></div><div>Is this a good or a bad idea?<br></div></div></div></div>