def creating_issues(self, client, project_name, owner):
     """Create an issue."""
     return client.add_issue(project_name,
                             'my title',
                             'my summary',
                             owner,
                             labels=['label0'])
 def get_data(queue):
     # Create a client and login
     client = self.gdata.projecthosting.client.ProjectHostingClient()
     client.client_login(
         settings.ERROR_CAPTURE_GOOGLE_CODE_LOGIN,
         settings.ERROR_CAPTURE_GOOGLE_CODE_PASSWORD,
         source='error-capture-middleware',
         service='code',
     )
     # Setup the templates
     title_tpl = loader.get_template(
         'django_error_capture_middleware/googlecode/title.txt')
     body_tpl = loader.get_template(
         'django_error_capture_middleware/googlecode/body.txt')
     # Add the issue
     result = client.add_issue(
         settings.ERROR_CAPTURE_GOOGLE_CODE_PROJECT,
         title_tpl.render(self.context),
         body_tpl.render(self.context),
         settings.ERROR_CAPTURE_GOOGLE_CODE_LOGIN, 'open',
         labels=[settings.ERROR_CAPTURE_GOOGLE_CODE_TYPE])
     # pull the data we want out and throw it in the queue
     issue_url = result.find_html_link()
     id = issue_url.split('=')[-1]
     queue.put_nowait([id, issue_url])
예제 #3
0
 def creating_issues(self, client, project_name, owner):
   """Create an issue."""
   return client.add_issue(
       project_name,
       'my title',
       'my summary',
       owner,
       labels=['label0'])
예제 #4
0
파일: dejirate.py 프로젝트: sah/dejirate
    desc += "Reported by: %s (%s)\n" % (item['reporter']['_text'],
                                        item['reporter']['username'])
    desc += "On: %s\n" % item['created']
    if item['assignee']['_text'] != 'Unassigned':
        desc += "Assigned to: %s (%s)\n" % (item['assignee']['_text'],
                                            item['assignee']['username'])
    desc += "\n" + html2text(item['description'])
    labels = ['jira']
    if 'component' in item:
        if isinstance(item['component'], str):
            labels.append(item['component'])
        else:
            print "weird component:", item['component']
    result = client.add_issue(
        project,
        item['title'],
        desc,
        USERNAME,
        labels=labels)

    comments = item.get('comments', {'comment': []})['comment']
    if isinstance(comments, dict):
        comments = [comments]
    for comment in comments:
        text = "By: %s\nOn: %s\n\n%s" % (comment['author'], comment['created'], comment['_text'])
        client.update_issue(
            project,
            result.get_id().rsplit('/', 1)[1],
            USERNAME,
            comment=html2text(text),
            ccs=[])
예제 #5
0
 def creating_issues(self, client, project_name, owner):
     """Create an issue."""
     return client.add_issue(project_name, "my title", "my summary", owner, labels=["label0"])