windows fixes

This commit is contained in:
j 2016-02-23 17:27:15 +05:30
commit a37a63d8da
4 changed files with 14 additions and 4 deletions

View file

@ -5,6 +5,7 @@
from datetime import datetime
import os
import shutil
import stat
import time
import ox
@ -235,7 +236,11 @@ def run_import(options=None):
file.move()
added += 1
elif options.get('mode') == 'move':
os.unlink(f_import)
try:
os.chmod(f_import, stat.S_IWRITE)
os.unlink(f_import)
except:
pass
if listname:
listitems.append(file.item.id)
if state.activity.get('cancel'):