def __init__(self, branch='master', version_file='VERSION'): url = maskGenPreferences.get_key('git.api.url', 'https://gitlab.mediforprogram.com') repo = maskGenPreferences.get_key('repo', '503') if 'gitlab' in url: self.api = GitLabAPI(branch=branch, version_file=version_file, url=url, repo=repo) else: self.api = GitHub(branch=branch, version_file=version_file, url=url, repo=repo)
def __init__(self, branch='master', version_file='VERSION', repo='rwgdrummer/maskgen', url='https://api.github.com'): self.file = '{url}/repos/{repo}/repository/files/{version_file}/raw'.format( url=url, repo=repo, version_file=version_file) self.commits = '{url}/repos/{repo}/repository/files/{version_file}/raw'.format( url=url, repo=repo, version_file=version_file) self.token = maskGenPreferences.get_key('git.token') self.branch = branch
def __init__(self, branch='master', version_file='VERSION', repo='', url='https://gitlab.mediforprogram.com'): self.file = '{url}/api/v4/projects/{repo}/repository/files/{version_file}/raw'.format( url=url, repo=repo, version_file=version_file) self.commits = '{url}/api/v4/projects/{repo}/repository/commits'.format( url=url, repo=repo, version_file=version_file) self.token = maskGenPreferences.get_key('git.token') self.branch = branch
def fixUserNameGraph(self, graph, start, end): """ :param graph: :param start: :param end: :return: @type graph: ImageGraph """ user = maskGenPreferences.get_key('username', 'NA') if user not in self.names: raise ValueError('Cannot fix name until the username is correct in the system settings') graph.setDataItem('username',user)
def fixUserNameEdge(self, graph, start, end): user = graph.getDataItem('username', maskGenPreferences.get_key('username', 'NA')) if user not in self.names: raise ValueError('Cannot fix name until the project username is correct in the project properties') edge = graph.get_edge(start, end) edge['username'] = user