Apply pycodestyle recommendations in tasks.py

This commit is contained in:
Kumi 2019-04-21 08:55:29 +00:00
parent 41f872fad5
commit e9267c984c

View file

@ -12,6 +12,7 @@ import crypt
import subprocess
import datetime
@shared_task
def mkfirmware(device, path):
BEFORE = os.getcwd()
@ -77,11 +78,15 @@ def mkfirmware(device, path):
os.chdir(BEFORE)
os.rename(glob.glob(SRCDIR + "/bin/targets/ar71xx/generic/*squashfs-sysupgrade.bin")[0], "%s/%s.bin" % (path, device.id))
genfile = glob.glob(
SRCDIR + "/bin/targets/ar71xx/generic/*squashfs-sysupgrade.bin"
)[0]
os.rename(genfile, "%s/%s.bin" % (path, device.id))
try:
os.remove(SRCDIR + "/.kumilock")
except:
except FileNotFoundError:
pass
os.system("rm -rf " + SRCDIR + "/files/")
@ -92,4 +97,3 @@ def mkfirmware(device, path):
os.remove(SRCDIR + "/.kumilock")
os.chdir(BEFORE)
return False