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 subprocess
import datetime import datetime
@shared_task @shared_task
def mkfirmware(device, path): def mkfirmware(device, path):
BEFORE = os.getcwd() BEFORE = os.getcwd()
@ -77,13 +78,17 @@ def mkfirmware(device, path):
os.chdir(BEFORE) 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: try:
os.remove(SRCDIR + "/.kumilock") os.remove(SRCDIR + "/.kumilock")
except: except FileNotFoundError:
pass pass
os.system("rm -rf " + SRCDIR + "/files/") os.system("rm -rf " + SRCDIR + "/files/")
os.system("rm " + SRCDIR + "/bin/targets/ar71xx/generic/*") os.system("rm " + SRCDIR + "/bin/targets/ar71xx/generic/*")
return True return True
@ -92,4 +97,3 @@ def mkfirmware(device, path):
os.remove(SRCDIR + "/.kumilock") os.remove(SRCDIR + "/.kumilock")
os.chdir(BEFORE) os.chdir(BEFORE)
return False return False