From 8503f08cd7d555c2296698f2cedbfbdb957bd616 Mon Sep 17 00:00:00 2001 From: Clement Verna Date: May 29 2016 20:47:12 +0000 Subject: Modify fedorahosted import to diplay the ticket repo found in the tmp folder --- diff --git a/pagure_importer/commands/fedorahosted.py b/pagure_importer/commands/fedorahosted.py index 403d269..253aa08 100644 --- a/pagure_importer/commands/fedorahosted.py +++ b/pagure_importer/commands/fedorahosted.py @@ -1,9 +1,12 @@ import click +import os import getpass -from pagure_importer.app import app, REPO_NAME, REPO_PATH -from pagure_importer.utils import importer_trac +from pagure_importer.app import app, REPO_NAME +from pagure_importer.utils import importer_trac, display_repo from pagure_importer.utils.fas import FASclient +REPO_PATH='/tmp/' + @app.command() @click.argument('project_url') @click.option('--tags', help="Import pagure tags:", is_flag=True) @@ -17,6 +20,8 @@ def fedorahosted(project_url, tags): url_index = project_url.find('://') rpc_url = project_url[:url_index+3] + rpc_login + project_url[url_index+3:]\ + '/login/xmlrpc' + display_repo() + repo_name = raw_input('Choose the import destination repo : ') trac_importer = importer_trac.TracImporter(rpc_url, fasclient) - trac_importer.import_issues(repo_path=REPO_NAME, repo_folder=REPO_PATH, + trac_importer.import_issues(repo_path=repo_name, repo_folder=REPO_PATH, tags=tags) diff --git a/pagure_importer/utils/__init__.py b/pagure_importer/utils/__init__.py index 05ccdb8..5afed11 100644 --- a/pagure_importer/utils/__init__.py +++ b/pagure_importer/utils/__init__.py @@ -11,6 +11,13 @@ from requests.auth import HTTPBasicAuth from pagure_importer.utils.exceptions import FileNotFound, EmailNotFound +def display_repo(): + print '#### Repo available ####' + for file in os.listdir('/tmp/'): + if file.endswith('.git'): + print ' * ' + file + print + def generate_json_for_github_contributors(github_username, github_password, \ github_project_name): ''' Creates a file containing a list of dicts containing the username and