Exemplo n.º 1
0
 def get_rev(self,path):
     path=format_path(path)
     ret=system_ret("""svn info  "%s%s" |grep vision| grep difica""" % (self.dataread,path))
     #grep francophone !!!
     try:
         r=int(ret.split(':',1)[1].split('/n')[0].strip())
     except:
         self.log.debug(path)
         self.log.debug(ret)
         r=0
     return r
Exemplo n.º 2
0
 def date(self,path,rev=None):
     path=format_path(path)
     if rev:
         txtrev="-r %s " % rev
     else:
         txtrev=""
     filename='%s%s' % (self.dataread,path)
     ret=system_ret("""svn info %s "%s" |grep Date| grep difica""" % (txtrev,filename))
     #grep francophone !!!
     datestr=ret.split(':',1)[1].split('(')[0].strip()
     return datestr
Exemplo n.º 3
0
 def diff(self,path,r1,r2):
     path=format_path(path)
     if r1>r2:
         r3=r1
         r1=r2
         r2=r3
     try:
         filename='%s/%s' % (self.dataread,path)
         ret=system_ret("""svn diff -r %s:%s "%s" """ % (r1,r2,filename) )
         diff=ret.split('\n',4)[4]
         return diff
     except:
         return None
Exemplo n.º 4
0
 def get_revs(self,path):
     path=format_path(path)
     filename='%s%s' % (self.dataread,path)
     ret=system_ret("""svn log  "%s" """ % filename )
     mods=ret.split('------------------------------------------------------------------------')
     ids=[]
     for m in mods:
         try:
             v=int(m.split('|',1)[0].strip()[1:])
             ids.append(v)
         except:
             pass
     return ids
Exemplo n.º 5
0
def get_structure_db_sqlite3(file_db,log,read):
    ret=system_ret('sqlite3 %s .tables' % file_db)
    ret=ret.replace('\n',' ')
    liste_tables=ret.split(' ')
    try:
        while 1:
            liste_tables.remove('')
    except:
        pass
    structure={}
    for tableid in liste_tables:
        st=read('PRAGMA table_info(%s);' % tableid)
        t={}
        for l in st:
            t[l[1]]=l[2]
        structure[tableid]=t
    return structure