def ExportIssues(github_owner_username, github_repo_name, github_oauth_token,
                 issue_file_path, project_name, user_file_path, rate_limit,
                 rewrite_comments):
  """Exports all issues for a given project."""
  github_service = github_services.GitHubService(
      github_owner_username, github_repo_name, github_oauth_token,
      rate_limit)
  issue_service = github_services.IssueService(github_service)
  user_service = github_services.UserService(github_service)

  issue_data = issues.LoadIssueData(issue_file_path, project_name)
  user_map = issues.LoadUserData(user_file_path, user_service)

  # Add a special "user_requesting_export" user, which comes in handy.
  user_map["user_requesting_export"] = github_owner_username

  issue_exporter = issues.IssueExporter(
      issue_service, user_service, issue_data, project_name, user_map)

  try:
    issue_exporter.Init(rewrite_comments)
    issue_exporter.Start(rewrite_comments)
    print "\nDone!\n"
  except IOError, e:
    print "[IOError] ERROR: %s" % e
def ExportIssues(issue_file_path, project_name, user_file_path,
                 default_issue_kind):
    """Exports all issues for a given project.
  """
    issue_service = IssueService()
    user_service = UserService()

    issue_data = issues.LoadIssueData(issue_file_path, project_name)
    user_map = issues.LoadUserData(user_file_path, user_service)

    issue_exporter = issues.IssueExporter(issue_service, user_service,
                                          issue_data, project_name, user_map)

    try:
        issue_exporter.Init()
        issue_exporter.Start()
        issue_service.WriteIssueData(default_issue_kind)
        print "\nDone!\n"
    except IOError, e:
        print "[IOError] ERROR: %s" % e
Пример #3
0
def ExportIssues(github_owner_username, github_repo_name, github_oauth_token,
                 issue_file_path, project_name, user_file_path, rate_limit):
  """Exports all issues for a given project.
  """
  github_service = GitHubService(
      github_owner_username, github_repo_name, github_oauth_token,
      rate_limit)
  issue_service = IssueService(github_service)
  user_service = UserService(github_service)

  issue_data = issues.LoadIssueData(issue_file_path, project_name)
  user_map = issues.LoadUserData(
      user_file_path, github_owner_username, user_service)

  issue_exporter = issues.IssueExporter(
      issue_service, user_service, issue_data, project_name, user_map)

  try:
    issue_exporter.Init()
    issue_exporter.Start()
    print "\nDone!\n"
  except IOError, e:
    print "[IOError] ERROR: %s" % e
Пример #4
0
 def testLoadUserData(self):
   # Verify the "identity dictionary" behavior.
   user_data_dict = issues.LoadUserData(None, None)
   self.assertEqual(user_data_dict["*****@*****.**"], "*****@*****.**")