Commit 412f0e00b985e8466b30c7eb6261eb22a09d8bed

Authored by carol15022
Committed by Sergio Oliveira
1 parent 2dddb4ce
Exists in trac_indexing

Add trac_revision in colab.

Signed-off-by: Thiago Ribeiro <hiagitosouza@hotmail.com>
Showing 1 changed file with 15 additions and 3 deletions   Show diff stats
colab/proxy/trac/data_api.py
... ... @@ -34,12 +34,24 @@ class TracDataAPI(ProxyDataAPI):
34 34 attachment.mimetype = attachment.filename.lower()
35 35 attachment.save()
36 36  
  37 + def fetch_data_revision(self, cursor):
  38 + revision = Revision()
  39 + cursor.execute('''SELECT * FROM revision;''')
  40 + revision_dict = self.dictfetchall(cursor)
  41 + cursor.execute('''SELECT * FROM repository;''')
  42 + repository_dict = self.dictfetchall(cursor)
  43 + for line in revision_dict:
  44 + revision.author = line['author']
  45 + revision.rev = line['rev']
  46 + revision.message = line['message']
  47 + local_time = line['time']/1000000
  48 + revision.created = time.strftime('%Y-%m-%d %H:%M:%S',
  49 + time.localtime(local_time))
  50 + revision.repository_name = repository_dict[line['value']]
  51 +
37 52 #def fetch_data_ticket(self, cursor)
38 53 # ticket = Ticket()
39 54  
40   - #def fetch_data_revision(self, cursor)
41   - # revision = Revision()
42   -
43 55 def fetch_data_wiki(self, cursor):
44 56 wiki = Wiki()
45 57 cursor.execute('''SELECT * FROM wiki;''')
... ...