mirror of https://github.com/berriedale/ae
Update the ae catalog support to properly consider <publisher>/<name>
This commit is contained in:
parent
40f5eb58ba
commit
1f1a24066c
18
bin/ae
18
bin/ae
|
@ -100,13 +100,19 @@ class FileCatalog:
|
||||||
def load(self):
|
def load(self):
|
||||||
path = re.split('file:\/\/', self.uri)[1]
|
path = re.split('file:\/\/', self.uri)[1]
|
||||||
catalog_dir = os.path.join(path, 'catalog')
|
catalog_dir = os.path.join(path, 'catalog')
|
||||||
if os.path.isdir(catalog_dir):
|
if not os.path.isdir(catalog_dir):
|
||||||
for schematic in os.listdir(catalog_dir):
|
return
|
||||||
if not schematic.endswith('.yaml'):
|
|
||||||
|
for root, dirs, files in os.walk(catalog_dir):
|
||||||
|
for f in files:
|
||||||
|
if not f.endswith('.yaml'):
|
||||||
continue
|
continue
|
||||||
name = re.sub('\.yaml', '', schematic)
|
publisher = os.path.basename(root)
|
||||||
schematic = os.path.join(catalog_dir, schematic)
|
name = re.sub('\.yaml', '', f)
|
||||||
self.schematics[name] = yaml.load(file(schematic))
|
qualified_name = '/'.join([publisher, name])
|
||||||
|
|
||||||
|
self.schematics[qualified_name] = yaml.load(file(os.path.join(root, f)))
|
||||||
|
|
||||||
|
|
||||||
def has_schematic(self, schematic):
|
def has_schematic(self, schematic):
|
||||||
if self.schematics.has_key(schematic):
|
if self.schematics.has_key(schematic):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
catalogs:
|
catalogs:
|
||||||
- file:///home/tyler/source/github/berriedale/schematics
|
- file:///home/tyler/source/github/berriedale/schematics
|
||||||
schematics:
|
schematics:
|
||||||
- aws
|
- adacore/aws
|
||||||
- gtkada
|
- adacore/gtkada
|
||||||
|
|
Loading…
Reference in New Issue