Commit db87277ac3a11b25c64b47004c4ad6fd55dcb678
Committed by
Sergio Oliveira
1 parent
74fb0ff3
Applying flake8
Signed-off-by: Thiago Ribeiro <thagitosouza@hotmail.com>
Showing
2 changed files
with
11 additions
and
12 deletions
Show diff stats
colab/proxy/trac/data_api.py
... | ... | @@ -15,7 +15,7 @@ class TracDataAPI(ProxyDataAPI): |
15 | 15 | self.fetch_data_attachment(cursor) |
16 | 16 | self.fetch_data_ticket(cursor) |
17 | 17 | self.fetch_data_revision(cursor) |
18 | - | |
18 | + | |
19 | 19 | def fetch_data_attachment(self, cursor): |
20 | 20 | attachment = Attachment() |
21 | 21 | cursor.execute(''' SELECT * from attachment; ''') |
... | ... | @@ -32,7 +32,7 @@ class TracDataAPI(ProxyDataAPI): |
32 | 32 | + "/" + attachment.filename |
33 | 33 | local_time = line['time']/1000000 |
34 | 34 | attachment.modified = time.strftime('%Y-%m-%d %H:%M:%S', |
35 | - time.localtime(local_time)) | |
35 | + time.localtime(local_time)) | |
36 | 36 | if match("\.(\w+)$", attachment.filename): |
37 | 37 | attachment.mimetype = attachment.filename.lower() |
38 | 38 | attachment.save() |
... | ... | @@ -52,7 +52,7 @@ class TracDataAPI(ProxyDataAPI): |
52 | 52 | revision.created = time.strftime('%Y-%m-%d %H:%M:%S', |
53 | 53 | time.localtime(local_time)) |
54 | 54 | revision.repository_name = repository_dict[line['value']] |
55 | - | |
55 | + | |
56 | 56 | def fetch_data_ticket(self, cursor): |
57 | 57 | ticket = Ticket() |
58 | 58 | collaborators = [] |
... | ... | @@ -74,13 +74,12 @@ class TracDataAPI(ProxyDataAPI): |
74 | 74 | ticket.author = ticket.reporter |
75 | 75 | local_time = line['time']/1000000 |
76 | 76 | ticket.created = time.strftime('%Y-%m-%d %H:%M:%S', |
77 | - time.localtime(local_time)) | |
77 | + time.localtime(local_time)) | |
78 | 78 | ticket.modified = str(timezone.now()) |
79 | 79 | ticket.modified_by = ticket.author |
80 | 80 | if line['report'] not in collaborators: |
81 | - collaborators.append(line['report']) | |
81 | + collaborators.append(line['report']) | |
82 | 82 | ticket.collaborators = collaborators |
83 | - | |
84 | 83 | |
85 | 84 | def fetch_data_wiki(self, cursor): |
86 | 85 | wiki = Wiki() | ... | ... |
colab/proxy/trac/models.py
... | ... | @@ -60,7 +60,7 @@ class Revision(models.Model, HitCounterModelMixin): |
60 | 60 | repository_name = models.TextField(blank=True) |
61 | 61 | created = models.DateTimeField(blank=True, null=True) |
62 | 62 | modified = models.DateTimeField(blank=True, null=True) |
63 | - | |
63 | + | |
64 | 64 | @property |
65 | 65 | def title(self): |
66 | 66 | return u'{} [{}]'.format(self.repository_name, self.rev) |
... | ... | @@ -99,17 +99,17 @@ class Ticket(models.Model, HitCounterModelMixin): |
99 | 99 | created = models.DateTimeField(blank=True, null=True) |
100 | 100 | modified = models.DateTimeField(blank=True, null=True) |
101 | 101 | modified_by = models.TextField(blank=True) |
102 | - | |
102 | + | |
103 | 103 | @property |
104 | 104 | def title(self): |
105 | - return u'#{} - {}'.format(self.id, self.summary) | |
106 | - | |
105 | + return u'#{} - {}'.format(self.id, self.summary) | |
106 | + | |
107 | 107 | @property |
108 | 108 | def description(self): |
109 | 109 | return u'{}\n{}\n{}\n{}\n{}\n{}\n{}'.format( |
110 | 110 | self.description, self.milestone, self.component, self.severity, |
111 | 111 | self.reporter, self.keywords, self.collaborators |
112 | - ) | |
112 | + ) | |
113 | 113 | |
114 | 114 | class Meta: |
115 | 115 | verbose_name = _('Attachment') |
... | ... | @@ -143,7 +143,7 @@ class Wiki(Collaboration, HitCounterModelMixin): |
143 | 143 | |
144 | 144 | @property |
145 | 145 | def description(self): |
146 | - return u'{}\n{}'.format(self.wiki_text, self.collaborators) | |
146 | + return u'{}\n{}'.format(self.wiki_text, self.collaborators) | |
147 | 147 | |
148 | 148 | class Meta: |
149 | 149 | verbose_name = _('Attachment') | ... | ... |