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

Unified Diff: scripts/slave/recipe_config_types.py

Issue 1111413005: Some changes to allow recipes and modules to live noncentrally (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Little bitty cleanup Created 5 years, 8 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: scripts/slave/recipe_config_types.py
diff --git a/scripts/slave/recipe_config_types.py b/scripts/slave/recipe_config_types.py
index 41701f94720d32a6dba07c4a0b36429ada5645c3..d7f60b0ababd047b5003ee890c9cbfc685519b71 100644
--- a/scripts/slave/recipe_config_types.py
+++ b/scripts/slave/recipe_config_types.py
@@ -9,6 +9,10 @@ from collections import namedtuple
from infra.libs import infra_types
+
+RECIPE_MODULE_PREFIX = '\1RECIPE_MODULES'
iannucci 2015/05/05 23:35:59 \1? wat? Maybe just don't put it in sys.modules?
luqui 2015/05/06 22:18:39 Done.
+
+
def ResetTostringFns():
RecipeConfigType._TOSTRING_MAP.clear() # pylint: disable=W0212
@@ -84,12 +88,10 @@ class NamedBasePath(BasePath, namedtuple('NamedBasePath', 'name')):
class ModuleBasePath(BasePath, namedtuple('ModuleBasePath', 'module')):
- # All recipe modules are in a magic RECIPE_MODULES package. Remove it
- # before rendering MODULE[_] form.
- MODULE_PREFIX_RE = r'^RECIPE_MODULES\.'
-
def __repr__(self):
- name = re.sub(self.MODULE_PREFIX_RE, '', self.module.__name__)
+ prefix = '%s.' % RECIPE_MODULE_PREFIX
+ assert self.module.__name__.startswith(prefix)
+ name = self.module.__name__[len(prefix):]
return 'RECIPE_MODULE[%s]' % name

Powered by Google App Engine
This is Rietveld 408576698