maybe now

This commit is contained in:
ville rantanen
2014-06-29 16:54:16 +03:00
parent 2db914a4ca
commit 8a7fce10c1

View File

@@ -48,7 +48,7 @@ def setup_options():
BADDIRS.extend(options.exclude) BADDIRS.extend(options.exclude)
if options.duplicate: if options.duplicate:
options.add=not options.add options.add=not options.add
options.startpath=unicode(optins.startpath, "UTF-8") options.startpath=unicode(options.startpath, "UTF-8")
return options return options
def createdb(fname): def createdb(fname):
@@ -161,7 +161,7 @@ def add_single(conn,filename,change=False,hash=None,minsize=0):
hash=get_md5(filename) hash=get_md5(filename)
ftime=os.path.getmtime(filename) ftime=os.path.getmtime(filename)
fsize=os.path.getsize(filename) fsize=os.path.getsize(filename)
mime=MIME.file(filename) mime=MIME.file(filename.encode('UTF-8'))
if change: if change:
db.execute("UPDATE list SET date=?, hash=?, size=?, mime=? \ db.execute("UPDATE list SET date=?, hash=?, size=?, mime=? \
WHERE file=?",(ftime,hash,fsize,mime,filename)) WHERE file=?",(ftime,hash,fsize,mime,filename))