Apply pycodestyle recommendations in tasks.py
This commit is contained in:
parent
41f872fad5
commit
e9267c984c
1 changed files with 8 additions and 4 deletions
|
@ -12,6 +12,7 @@ import crypt
|
|||
import subprocess
|
||||
import datetime
|
||||
|
||||
|
||||
@shared_task
|
||||
def mkfirmware(device, path):
|
||||
BEFORE = os.getcwd()
|
||||
|
@ -77,13 +78,17 @@ 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/")
|
||||
os.system("rm " + SRCDIR + "/bin/targets/ar71xx/generic/*")
|
||||
return True
|
||||
|
@ -92,4 +97,3 @@ def mkfirmware(device, path):
|
|||
os.remove(SRCDIR + "/.kumilock")
|
||||
os.chdir(BEFORE)
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in a new issue