コード例 #1
0
ファイル: repository_handler.py プロジェクト: httpdss/deam
 def load_apps(self):
     """ Parse the apps file and load each application to the list """
     cfg = ConfigHandler(self.location)
     for app_values in cfg.parse_apps_file():
         app_type = app_values.get('type') or detect_type(app_values.get('url'))
         repo = {'hg' : HgApplication(app_values),
                 'svn' : SvnApplication(app_values),
                 'git' : GitApplication(app_values),
                 'file' : SingleFileApplication(app_values),
                 None : None,
                 }[app_type]
         self.append(repo)
コード例 #2
0
ファイル: repositories.py プロジェクト: httpdss/deam
    def __init__(self, val_dict):
        """
        Constructor.
        vcs_type -- type of the version control system. possible
                    values: svn, git and hg
        url -- url of repository
        folder -- project subfolder
        """

        #TODO validate format and throw exceptions
        #   if config.get(sec,'type') not in self.config['repos']:
        #       raise InvalidVCSTypeError(app['type'])
        self._alert = val_dict.get('alert') or False
        self._directory = val_dict.get('directory') or ''
        self._location = val_dict['location']
        self._name = val_dict['name']
        self._url = val_dict['url']
        self._vcs_type = detect_type(val_dict.get('url'), \
                                     default = val_dict.get('type'))