def patch_item(self, item): if not hasattr(item, "label"): if hasattr(item, "alias"): item.label = item.alias else: item.label = item.name.replace('_', ' ').capitalize() if not hasattr(item, "criteria"): item.__class__.criteria = property(fget=get_criteria) GenericManager.patch_item(self, item)
def patch_item(self, item): if not hasattr(item, "name_conversion"): item.name_conversion = 2 if not hasattr(item, "criteria"): item.__class__.criteria = property(fget=get_criteria) GenericManager.patch_item(self, item) # Look in class dict instead of hasattr(item, 'implementation') to avoid loading implementation if not hasattr(item.__class__, 'implementation'): item.__class__.implementation = property(fget=get_implementation)
def __init__(self, items=None, item_proxy=None, autoload=['entry_points']): # GenericManager GenericManager.__init__(self, items, item_proxy, autoload) self.default_group = "local" # ProjectManager self.tmpdir = Path(get_openalea_tmp_dir()) self._cproject = None self._cwd = Path('.').abspath() self.old_syspath = sys.path self.cm = ControlManager() self.repositories = self.search_path() self.previous_project = "temp" self.shell = interpreter() self.cproject = None
def clear(self): """ Clear the list of projects. """ GenericManager.clear(self) self.cproject = self.default()