mirror of
https://github.com/robweber/xbmcbackup.git
synced 2025-11-23 11:41:30 +01:00
Show File Transfer Size (#160)
adds file transfer size to progress bar - closes #157
This commit is contained in:
@@ -53,3 +53,16 @@ def getRegionalTimestamp(date_time, dateformat=['dateshort']):
|
||||
result = result + ("%s " % date_time.strftime(xbmc.getRegion(aFormat)))
|
||||
|
||||
return result.strip()
|
||||
|
||||
|
||||
def diskString(fSize):
|
||||
# convert a size in kilobytes to the best possible match and return as a string
|
||||
fSize = float(fSize)
|
||||
i = 0
|
||||
sizeNames = ['KB', 'MB', 'GB', 'TB']
|
||||
|
||||
while(fSize > 1024):
|
||||
fSize = fSize / 1024
|
||||
i = i + 1
|
||||
|
||||
return "%0.2f%s" % (fSize, sizeNames[i])
|
||||
|
||||
Reference in New Issue
Block a user