1
0
mirror of https://github.com/gryf/pygtktalog.git synced 2025-12-17 11:30:19 +01:00

* Changes in old version.

This commit is contained in:
2007-06-23 17:06:19 +00:00
parent afc1e325b0
commit 9f512ec834
2 changed files with 44 additions and 341 deletions

16
db.py
View File

@@ -117,10 +117,24 @@ class dbfile:
def getParent(self, idn):
#{{{
self.cur.execute("SELECT parent FROM files_connect WHERE child = ? AND depth = 1",idn)
self.cur.execute("SELECT parent FROM files_connect WHERE child = ? AND depth = 1",(idn,))
parentId = self.cur.fetchone()
if parentId:
return parentId[0]
return None
#}}}
def getInfo(self,idn):
#{{{
self.cur.execute("SELECT filename, date, size, type FROM files WHERE id = ?",(idn,))
set = self.cur.fetchone()
if set == None:
return ''
string = """Filename: %s
Date: %s
Size: %s
type: %s""" % (set[0],datetime.datetime.fromtimestamp(set[1]),set[2],set[3])
return string
#}}}