Ejemplo n.º 1
0
    def parse(self, issue):
        print "Tracker: ", self.tm
        parsed = bugimporters.items.ParsedBug({
            'title': issue['fields']['summary'],
            'description': issue['fields']['description'],
            'status': issue['fields']['status']['name'].lower(),
            'date_reported': printable_datetime(string2naive_datetime(issue['fields']['created'])),
            'last_touched': printable_datetime(string2naive_datetime(issue['fields']['updated'])),
            'submitter_username': issue['fields']['reporter']['name'],
            'submitter_realname': issue['fields']['reporter']['displayName'],
            'canonical_bug_link': urljoin(self.tm.get_base_url(), '/browse/' + issue['key']),
            'looks_closed': (issue['fields']['status']['name'] == 'Closed'),
            'last_polled': printable_datetime(),
            '_project_name': self.tm.tracker_name,
            '_tracker_name': self.tm.tracker_name,
        })

        issue_labels = set([
            l for l in issue['fields']['labels']
        ])
        if self.tm.bitesized_type:
            if self.tm.bitesized_type == 'label':
                b_list = self.tm.bitesized_text.split(',')
                parsed['good_for_newcomers'] = not issue_labels.isdisjoint(b_list)
            elif self.tm.bitesized_type == 'priority':
                parsed['good_for_newcomers'] = issue['fields']['priority']['name'] == self.tm.bitesized_text
            else:
                parsed['good_for_newcomers'] = False

        d_list = self.tm.documentation_text.split(',')
        parsed['concerns_just_documentation'] = not issue_labels.isdisjoint(d_list)

        return parsed
Ejemplo n.º 2
0
    def parse(self, issue):
        parsed = bugimporters.items.ParsedBug({
            'title': issue['title'],
            'description': issue['body'],
            'status': issue['state'],
            'people_involved': self.github_count_people_involved(issue),
            'date_reported': printable_datetime(string2naive_datetime(issue['created_at'])),
            'last_touched': printable_datetime(string2naive_datetime(issue['updated_at'])),
            'submitter_username': issue['user']['login'],
            'submitter_realname': '', # FIXME: can get this from ['user']['url']
            'canonical_bug_link': issue['html_url'],
            'looks_closed': (issue['state'] == 'closed'),
            'last_polled': printable_datetime(),
            '_project_name': self.tm.tracker_name,
        })

        issue_labels = set([
            l['name'] for l in issue['labels']
        ])

        b_list = self.tm.bitesized_tag.split(',')
        parsed['good_for_newcomers'] = not issue_labels.isdisjoint(b_list)

        d_list = self.tm.documentation_tag.split(',')
        parsed['concerns_just_documentation'] = not issue_labels.isdisjoint(d_list)

        return parsed
Ejemplo n.º 3
0
    def parse(self, issue):
        print "Tracker: ", self.tm
        parsed = bugimporters.items.ParsedBug({
            'title':
            issue['fields']['summary'],
            'description':
            issue['fields']['description'],
            'status':
            issue['fields']['status']['name'].lower(),
            'date_reported':
            printable_datetime(
                string2naive_datetime(issue['fields']['created'])),
            'last_touched':
            printable_datetime(
                string2naive_datetime(issue['fields']['updated'])),
            'submitter_username':
            issue['fields']['reporter']['name'],
            'submitter_realname':
            issue['fields']['reporter']['displayName'],
            'canonical_bug_link':
            urljoin(self.tm.get_base_url(), '/browse/' + issue['key']),
            'looks_closed': (issue['fields']['status']['name'] == 'Closed'),
            'last_polled':
            printable_datetime(),
            '_project_name':
            self.tm.tracker_name,
            '_tracker_name':
            self.tm.tracker_name,
        })

        issue_labels = set([l for l in issue['fields']['labels']])
        if self.tm.bitesized_type:
            if self.tm.bitesized_type == 'label':
                b_list = self.tm.bitesized_text.split(',')
                parsed['good_for_newcomers'] = not issue_labels.isdisjoint(
                    b_list)
            elif self.tm.bitesized_type == 'priority':
                parsed['good_for_newcomers'] = issue['fields']['priority'][
                    'name'] == self.tm.bitesized_text
            else:
                parsed['good_for_newcomers'] = False

        d_list = self.tm.documentation_text.split(',')
        parsed['concerns_just_documentation'] = not issue_labels.isdisjoint(
            d_list)

        return parsed
Ejemplo n.º 4
0
    def parse(self, tracker_model):
        """
        Parses the HTML detail page of a google code issue and combines that
        with CSV data to build a ParsedBug object.

        :param tracker_model: the tracker model used for this import
        :returns: :class:`bugimporters.items.ParsedBug`
        """
        # Build the base bug dict
        data = {
            'title': self.bug_data['Summary'],
            'description': self._parse_description(),
            'status': self.bug_data['Status'],
            'importance': self.bug_data['Priority'],
            'people_involved': self._count_people_involved(),
            'date_reported': string2naive_datetime(
                self.bug_data['Opened']).isoformat(),
            'last_touched': string2naive_datetime(
                self.bug_data['Modified']).isoformat(),
            'submitter_username': self.bug_data['Reporter'],
            'submitter_realname': '',  # Can't get this from Google
            'canonical_bug_link': self.bug_url,
            '_project_name': tracker_model.tracker_name,
            '_tracker_name': tracker_model.tracker_name,
            'looks_closed': (self.bug_data['Closed'] != ''),
            'good_for_newcomers': False,
            'concerns_just_documentation': False,
        }

        labels = self._parse_labels()

        # Check for the bitesized keyword(s)
        if tracker_model.bitesized_type:
            b_list = tracker_model.bitesized_text.split(',')
            data['good_for_newcomers'] = any(b in labels for b in b_list)

        # Check whether this is a documentation bug.
        if tracker_model.documentation_type:
            d_list = tracker_model.documentation_text.split(',')
            data['concerns_just_documentation'] = any(
                d in labels for d in d_list)

        return ParsedBug(data)
Ejemplo n.º 5
0
    def parse(self, issue):
        parsed = bugimporters.items.ParsedBug({
            'title':
            issue['title'],
            'description':
            issue['body'],
            'status':
            issue['state'],
            'people_involved':
            self.github_count_people_involved(issue),
            'date_reported':
            printable_datetime(string2naive_datetime(issue['created_at'])),
            'last_touched':
            printable_datetime(string2naive_datetime(issue['updated_at'])),
            'submitter_username':
            issue['user']['login'],
            'submitter_realname':
            '',  # FIXME: can get this from ['user']['url']
            'canonical_bug_link':
            issue['html_url'],
            'looks_closed': (issue['state'] == 'closed'),
            'last_polled':
            printable_datetime(),
            '_project_name':
            self.tm.tracker_name,
            '_tracker_name':
            self.tm.tracker_name,
        })

        issue_labels = set([l['name'] for l in issue['labels']])

        b_list = self.tm.bitesized_tag.split(',')
        parsed['good_for_newcomers'] = not issue_labels.isdisjoint(b_list)

        d_list = self.tm.documentation_tag.split(',')
        parsed['concerns_just_documentation'] = not issue_labels.isdisjoint(
            d_list)

        return parsed
Ejemplo n.º 6
0
 def google_date_to_datetime(date_string):
     return string2naive_datetime(date_string)
Ejemplo n.º 7
0
 def _span2date(span):
     date_string = span.attrib['title']
     date_string = date_string.replace('in Timeline', '')
     date_string = date_string.replace('See timeline at ', '')
     return printable_datetime(string2naive_datetime(date_string))
Ejemplo n.º 8
0
 def bugzilla_date_to_printable_datetime(date_string):
     return string2naive_datetime(date_string).isoformat()
Ejemplo n.º 9
0
 def bugzilla_date_to_datetime(date_string):
     return string2naive_datetime(date_string)
Ejemplo n.º 10
0
 def bugzilla_date_to_printable_datetime(date_string):
     return string2naive_datetime(date_string).isoformat()
Ejemplo n.º 11
0
 def _span2date(span):
     date_string = span.attrib['title']
     date_string = date_string.replace('in Timeline', '')
     date_string = date_string.replace('See timeline at ', '')
     return printable_datetime(string2naive_datetime(date_string))
Ejemplo n.º 12
0
 def github_date_to_datetime(date_string):
     return string2naive_datetime(date_string)
Ejemplo n.º 13
0
 def tigris_date_to_printable_datetime(date_string):
     return string2naive_datetime(date_string).isoformat()