Mercurial > hg > autobot
comparison autobot/projects/__init__.py @ 139:a0866ad63d93
fix another syntax error andadd the error handling to detect it
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Mon, 24 Jan 2011 12:37:14 -0800 |
| parents | 1abbe826d0f3 |
| children | cb9ad0b04140 |
comparison
equal
deleted
inserted
replaced
| 138:96234eec1a04 | 139:a0866ad63d93 |
|---|---|
| 28 packages = [os.path.basename(package) for package in packages | 28 packages = [os.path.basename(package) for package in packages |
| 29 if os.path.exists(os.path.join(package, '__init__.py'))] | 29 if os.path.exists(os.path.join(package, '__init__.py'))] |
| 30 for package in packages: | 30 for package in packages: |
| 31 try: | 31 try: |
| 32 module = imp.load_package('autobot.projects.'+package, imp.find_module(package, [here])[1]) | 32 module = imp.load_package('autobot.projects.'+package, imp.find_module(package, [here])[1]) |
| 33 except: | 33 except Exception, e: |
| 34 print >> sys.stderr, "Could not import autobot.projects." + package | 34 print >> sys.stderr, "Could not import autobot.projects.%s : %s" % (package, e) |
| 35 continue | 35 continue |
| 36 for attr in dir(module): | 36 for attr in dir(module): |
| 37 try: | 37 try: |
| 38 _obj = getattr(module, attr) | 38 _obj = getattr(module, attr) |
| 39 if issubclass(_obj, BuildFactory) and _obj.__module__.startswith('autobot.projects.'): | 39 if issubclass(_obj, BuildFactory) and _obj.__module__.startswith('autobot.projects.'): |
