Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: third_party/recipe_engine/show_me_the_modules.py

Issue 1241323004: Cross-repo recipe package system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Moved show_me_the_modules into recipe_engine Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/recipe_engine/show_me_the_modules.py
diff --git a/scripts/tools/show_me_the_modules.py b/third_party/recipe_engine/show_me_the_modules.py
old mode 100755
new mode 100644
similarity index 83%
rename from scripts/tools/show_me_the_modules.py
rename to third_party/recipe_engine/show_me_the_modules.py
index 2c726ac2e796203acefd51771bdbecde5bbdcf9c..3b02487411b2f576acc0b8b182829d3cb3ab4189
--- a/scripts/tools/show_me_the_modules.py
+++ b/third_party/recipe_engine/show_me_the_modules.py
@@ -10,15 +10,10 @@ import inspect
import os
import sys
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
-sys.path.append(os.path.join(os.path.dirname(__file__),
- '..', '..', 'third_party'))
-
-from recipe_engine import main as recipe_main
-from recipe_engine import recipe_api
-from recipe_engine import loader
-
-from slave import recipe_universe
+from . import loader
+from . import main as recipe_main
+from . import package
+from . import recipe_api
def trim_doc(docstring):
"""From PEP 257"""
@@ -80,17 +75,22 @@ def pmethod(indent_lvl, name, obj):
else:
p(0)
-def main():
+def main(package_cfg):
common_methods = set(k for k, v in member_iter(recipe_api.RecipeApi))
p(0, 'Common Methods -- %s' % os.path.splitext(recipe_api.__file__)[0])
for method in sorted(common_methods):
pmethod(1, method, getattr(recipe_api.RecipeApi, method))
- universe = recipe_universe.get_universe()
- deps = universe.deps_from_paths(
- { modpath: modpath
- for modpath in universe.loop_over_recipe_modules() },
- base_path=None)
+ if isinstance(package_cfg, package.PackageDeps):
+ package_deps = package_cfg
+ else:
+ package_deps = package.PackageDeps.create(package_cfg)
+ universe = loader.RecipeUniverse(package_deps)
+ deps = universe.deps_from_spec(
+ # TODO(luqui): This doesn't handle name scoping correctly (e.g. same-named
+ # modules in different packages).
+ { modpath: modpath.split('/')[-1]
+ for modpath in universe.loop_over_recipe_modules() })
inst = loader.create_recipe_api(
deps, recipe_main.RecipeEngine(None, {}, None))
@@ -118,7 +118,3 @@ def main():
if fn_name in base_fns:
continue
pmethod(1, fn_name, obj)
-
-
-if __name__ == '__main__':
- main()

Powered by Google App Engine
This is Rietveld 408576698