From 1f1a24066c14376fcdc90fb700a3abca1647e212 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Tue, 24 Jan 2017 23:22:21 -0800 Subject: [PATCH] Update the ae catalog support to properly consider / --- bin/ae | 18 ++++++++++++------ example/schematics.yaml | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bin/ae b/bin/ae index 22aea26..b5655e0 100755 --- a/bin/ae +++ b/bin/ae @@ -100,13 +100,19 @@ class FileCatalog: def load(self): path = re.split('file:\/\/', self.uri)[1] catalog_dir = os.path.join(path, 'catalog') - if os.path.isdir(catalog_dir): - for schematic in os.listdir(catalog_dir): - if not schematic.endswith('.yaml'): + if not os.path.isdir(catalog_dir): + return + + for root, dirs, files in os.walk(catalog_dir): + for f in files: + if not f.endswith('.yaml'): continue - name = re.sub('\.yaml', '', schematic) - schematic = os.path.join(catalog_dir, schematic) - self.schematics[name] = yaml.load(file(schematic)) + publisher = os.path.basename(root) + name = re.sub('\.yaml', '', f) + qualified_name = '/'.join([publisher, name]) + + self.schematics[qualified_name] = yaml.load(file(os.path.join(root, f))) + def has_schematic(self, schematic): if self.schematics.has_key(schematic): diff --git a/example/schematics.yaml b/example/schematics.yaml index 96dc707..54c08d2 100644 --- a/example/schematics.yaml +++ b/example/schematics.yaml @@ -1,5 +1,5 @@ catalogs: - file:///home/tyler/source/github/berriedale/schematics schematics: - - aws - - gtkada + - adacore/aws + - adacore/gtkada