From cfd94529a6ce6f7c574a1eda7a4e9297daa1132f Mon Sep 17 00:00:00 2001 From: Pat Beirne Date: Fri, 4 Dec 2015 11:44:12 -0500 Subject: [PATCH] just a checkpoint --- dirnotes | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dirnotes b/dirnotes index f081e90..644f5d5 100755 --- a/dirnotes +++ b/dirnotes @@ -47,7 +47,7 @@ class DataBase: c.execute("select * from dirnotes") except sqlite3.OperationalError: print("Table %s created" % ("dirnotes")) - c.execute("create table dirnotes (name TEXT, date REAL, size INTEGER, comment TEXT, comment_date REAL)") + c.execute("create table dirnotes (name TEXT, date DATETIME, size INTEGER, comment TEXT, comment_date DATETIME)") def getData(self, fileName): c = self.db.cursor() @@ -64,8 +64,8 @@ class DataBase: c = self.db.cursor() s = os.stat(fileName) print "params: %s %f %d %s %f" % ((os.path.abspath(fileName), s.st_mtime, s.st_size, comment, time.time())) - c.execute("insert into dirnotes values (?,?,?,?,?)", - (fileName, s.st_mtime, s.st_size, str(comment), time.time())) + c.execute("insert into dirnotes values (?,datetime(?,'unixepoch','localtime'),?,?,datetime(?,'unixepoch','localtime'))", + (os.path.abspath(fileName), s.st_mtime, s.st_size, str(comment), time.time())) self.db.commit() def parse(): @@ -90,7 +90,7 @@ class FileObj(): try: self.comment = xattr.getxattr(fileName,COMMENT_KEY) except Exception as e: - print("comment read on %s failed, execption %s" % (self.fileName,e)) + #print("comment read on %s failed, execption %s" % (self.fileName,e)) pass def getName(self): return self.fileName @@ -184,7 +184,6 @@ if __name__=="__main__": p = parse() if p.dirname[-1]=='/': p.dirname = p.dirname[:-1] - print(dir(p)) print(p.dirname) db = DataBase()