comparison mxtool/mx.py @ 10058:440661cc7908

a suite should be registered in the global _suites map at most once
author Doug Simon <doug.simon@oracle.com>
date Sat, 15 Jun 2013 21:05:01 +0200
parents e063474076dd
children 4dada3ec9c58
comparison
equal deleted inserted replaced
10057:e90e48dae0ab 10058:440661cc7908
606 os.environ[key.strip()] = expandvars_in_property(value.strip()) 606 os.environ[key.strip()] = expandvars_in_property(value.strip())
607 607
608 def _post_init(self, opts): 608 def _post_init(self, opts):
609 mxDir = join(self.dir, 'mx') 609 mxDir = join(self.dir, 'mx')
610 self._load_projects(mxDir) 610 self._load_projects(mxDir)
611 _suites[self.name] = self
612 for p in self.projects: 611 for p in self.projects:
613 existing = _projects.get(p.name) 612 existing = _projects.get(p.name)
614 if existing is not None: 613 if existing is not None:
615 abort('cannot override project ' + p.name + ' in ' + p.dir + " with project of the same name in " + existing.dir) 614 abort('cannot override project ' + p.name + ' in ' + p.dir + " with project of the same name in " + existing.dir)
616 if not p.name in _opts.ignored_projects: 615 if not p.name in _opts.ignored_projects:
717 716
718 def _loadSuite(d, primary=False): 717 def _loadSuite(d, primary=False):
719 mxDir = join(d, 'mx') 718 mxDir = join(d, 'mx')
720 if not exists(mxDir) or not isdir(mxDir): 719 if not exists(mxDir) or not isdir(mxDir):
721 return None 720 return None
722 if not _suites.has_key(d): 721 if len([s for s in _suites.itervalues() if s.dir == d]) == 0:
723 suite = Suite(d, primary) 722 s = Suite(d, primary)
724 _suites[d] = suite 723 _suites[s.name] = s
725 return suite 724 return s
726 725
727 def suites(): 726 def suites():
728 """ 727 """
729 Get the list of all loaded suites. 728 Get the list of all loaded suites.
730 """ 729 """