Beispiel #1
0
def main():
    github_user, github_password, github_repo, youtrack_url, youtrack_login, youtrack_password = sys.argv[
        1:8]
    issues_csv_file = CSV_FILE.format(repo=github_repo, data='issues')
    comments_csv_file = CSV_FILE.format(repo=github_repo, data='comments')
    github2csv(issues_csv_file, comments_csv_file, github_user,
               github_password, github_repo)
    csv2youtrack.csv2youtrack(issues_csv_file, youtrack_url, youtrack_login,
                              youtrack_password, comments_csv_file)
def main():
    github_user, github_password, github_repo, youtrack_url, youtrack_login, youtrack_password = sys.argv[1:8]
    if github_repo.find('/') > -1:
        github_repo_owner, github_repo = github_repo.split('/')
        github_repo = github_repo.replace('/', '_')
    else:
        github_repo_owner = github_user
    issues_csv_file = CSV_FILE.format(repo=github_repo, data='issues')
    comments_csv_file = CSV_FILE.format(repo=github_repo, data='comments')
    github2csv(issues_csv_file, comments_csv_file, github_user, github_password, github_repo, github_repo_owner)
    csv2youtrack.csv2youtrack(issues_csv_file, youtrack_url, youtrack_login, youtrack_password, comments_csv_file)
def main():
    github_user, github_password, github_repo, youtrack_url, youtrack_login, youtrack_password = sys.argv[
        1:8]
    if github_repo.find('/') > -1:
        github_repo_owner, github_repo = github_repo.split('/')
        github_repo = github_repo.replace('/', '_').replace('-', '_')
    else:
        github_repo_owner = github_user
    issues_csv_file = CSV_FILE.format(repo=github_repo, data='issues')
    comments_csv_file = CSV_FILE.format(repo=github_repo, data='comments')
    github2csv(issues_csv_file, comments_csv_file, github_user,
               github_password, github_repo, github_repo_owner)
    csv2youtrack.csv2youtrack(issues_csv_file, youtrack_url, youtrack_login,
                              youtrack_password, comments_csv_file)
def main():
    try:
        params = {}
        opts, args = getopt.getopt(sys.argv[1:], 'hu:p:t:T:')
        for opt, val in opts:
            if opt == '-h':
                usage()
                sys.exit(0)
            elif opt == '-u':
                params['login'] = val
            elif opt == '-p':
                params['password'] = val
            elif opt == '-t':
                params['token'] = val
            elif opt == '-T':
                check_file_and_save(val, params, 'token_file')
    except getopt.GetoptError as e:
        print(e)
        usage()
        sys.exit(1)

    try:
        params[
            'target_url'], gitlab_api_endpoint, gitlab_user, gitlab_token, gitlab_project_name, gitlab_project_id = args
    except (ValueError, KeyError, IndexError):
        print("Bad arguments")
        usage()
        sys.exit(1)

    if gitlab_project_name.find('/') > -1:
        gitlab_project_owner, gitlab_project_name = gitlab_project_name.split(
            '/')
    else:
        gitlab_project_owner = gitlab_user

    params['issues_file'] = CSV_FILE.format(repo=gitlab_project_name,
                                            data='issues')
    params['comments_file'] = CSV_FILE.format(repo=gitlab_project_name,
                                              data='comments')

    gitlab2csv(params['issues_file'], params['comments_file'],
               gitlab_api_endpoint, gitlab_user, gitlab_token,
               gitlab_project_name, gitlab_project_owner, gitlab_project_id)

    try:
        csv2youtrack.csv2youtrack(params)
    except youtrack.YouTrackException as e:
        print e
        pass
def main():
    github_user, github_password, github_repo, youtrack_url, youtrack_login, youtrack_password = sys.argv[1:8]
    issues_csv_file = CSV_FILE.format(repo=github_repo, data='issues')
    comments_csv_file = CSV_FILE.format(repo=github_repo, data='comments')
    github2csv(issues_csv_file, comments_csv_file, github_user, github_password, github_repo)
    csv2youtrack.csv2youtrack(issues_csv_file, youtrack_url, youtrack_login, youtrack_password, comments_csv_file)