Calculate, log & save estimated & actual transfer speed

This commit is contained in:
2022-11-28 00:43:04 +01:00
parent 2fc9948836
commit 23d7b7513f
2 changed files with 85 additions and 2 deletions

View File

@@ -15,4 +15,23 @@ def getConfig():
config.read(path)
# logger.debug('Sections parsed: {}'.format(config.sections()))
return config
return config
def writeAvgSpeedToDisk(speed):
path = os.path.join(pwd, '.avgspeed.txt')
with open(path, 'w') as f:
f.write(str(int(speed)))
f.close()
def readAvgSpeedFromDisk():
path = os.path.join(pwd, '.avgspeed.txt')
with open(path, 'r') as f:
data = f.readline()
f.close()
if data == '':
data = '1'
return int(data)