mirror of
https://github.com/KevinMidboe/transatlanticTorrentExpress.git
synced 2025-10-29 18:00:19 +00:00
Ensure always writing a number to file
This commit is contained in:
2
utils.py
2
utils.py
@@ -38,7 +38,7 @@ def writeAvgSpeedToDisk(speed):
|
|||||||
path = os.path.join(pwd, '.avgspeed.txt')
|
path = os.path.join(pwd, '.avgspeed.txt')
|
||||||
|
|
||||||
with open(path, 'w') as f:
|
with open(path, 'w') as f:
|
||||||
f.write(str(int(speed)))
|
f.write(str(int(speed or 100)))
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
def readAvgSpeedFromDisk():
|
def readAvgSpeedFromDisk():
|
||||||
|
|||||||
Reference in New Issue
Block a user