Beispiel #1
0
    def parse(self, data):
        converter = self.get_converter()

        if codecs.BOM_UTF8 == data[:3]:
            data = data.decode("utf-8-sig")

        if "\r\n" in data:
            data = data.split("\r\n")
        else:
            data = data.split("\n")

        reader = csv.DictReader(data, delimiter=self.delimiter)
        for bug_desc in reader:
            bug_desc = decoded_dict(bug_desc, encoding=self.encoding)
            yield self.bug_class(tracker=self.tracker, **converter(bug_desc))
Beispiel #2
0
    def parse_dependson_and_blocked_bugs_csv(self, data):
        try:
            reader = csv.DictReader(data.split('\n'), delimiter=self.delimiter)
            for bug_desc in reader:
                bug_desc = decoded_dict(bug_desc, encoding=self.encoding)
                status = bug_desc.get('status')
                bug_id = bug_desc.get('id')
                summary = bug_desc.get('summary')

                if status:
                    self.dependson_and_blocked_status[bug_id]['resolved'] = status in ('closed', 'resolved', 'verified')
                if summary:
                    self.dependson_and_blocked_status[bug_id]['desc'] = summary
           
        except BaseException, e:
            self.failed(e)
Beispiel #3
0
    def parse(self, data):
        if codecs.BOM_UTF8 == data[:3]:
            data = data.decode('utf-8-sig')
        else:
            data = data.encode('utf-8')

        if '\r\n' in data:
            data = data.split('\r\n')
        else:
            data = data.split('\n')

        reader = csv.DictReader(data,  delimiter=self.delimiter)
        result = []
        for bug_desc in reader:
            bug_desc = decoded_dict(bug_desc, encoding=self.encoding)
            result.append(bug_desc)
        return result
Beispiel #4
0
    def parse(self, data):
        if codecs.BOM_UTF8 == data[:3]:
            data = data.decode('utf-8-sig')
        else:
            data = data.encode('utf-8')

        if '\r\n' in data:
            data = data.split('\r\n')
        else:
            data = data.split('\n')

        reader = csv.DictReader(data, delimiter=self.delimiter)
        result = []
        for bug_desc in reader:
            bug_desc = decoded_dict(bug_desc, encoding=self.encoding)
            result.append(bug_desc)
        return result
Beispiel #5
0
    def parse(self, data):
        converter = self.get_converter()

        if codecs.BOM_UTF8 == data[:3]:
            data = data.decode('utf-8-sig')

        if '\r\n' in data:
            data = data.split('\r\n')
        else:
            data = data.split('\n')

        reader = csv.DictReader(data,  delimiter=self.delimiter)
        for bug_desc in reader:
            bug_desc = decoded_dict(bug_desc, encoding=self.encoding)
            yield self.bug_class(
                tracker=self.tracker,
                **converter(bug_desc)
            )
Beispiel #6
0
    def parse_dependson_and_blocked_bugs_csv(self, data):
        try:
            reader = csv.DictReader(data.split('\n'), delimiter=self.delimiter)
            for bug_desc in reader:
                bug_desc = decoded_dict(bug_desc, encoding=self.encoding)
                status = bug_desc.get('status')
                bug_id = bug_desc.get('id')
                summary = bug_desc.get('summary')

                if status:
                    self.dependson_and_blocked_status[bug_id][
                        'resolved'] = status in ('closed', 'resolved',
                                                 'verified')
                if summary:
                    self.dependson_and_blocked_status[bug_id]['desc'] = summary

        except BaseException, e:
            self.failed(e)