mirror of
https://github.com/gryf/wmdocklib.git
synced 2025-12-20 12:58:08 +01:00
really this was the first version of the program. put here anyways for historical reasons.
This commit is contained in:
@@ -11,11 +11,6 @@ Licensed under the GNU General Public License.
|
|||||||
|
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
2003-09-01 Kristoffer Erlandsson
|
|
||||||
Fixed a bug where the numbers wouldn't show if they were between 1000 and 1024.
|
|
||||||
|
|
||||||
2003-06-25 Kristoffer Erlandsson
|
|
||||||
Fixed a bug where a mouse click caused the app to enter an infinite loop
|
|
||||||
|
|
||||||
2003-06-24 Kristoffer Erlandsson
|
2003-06-24 Kristoffer Erlandsson
|
||||||
Additional fine tuning
|
Additional fine tuning
|
||||||
@@ -206,7 +201,6 @@ class PywmHDMon:
|
|||||||
while not event is None:
|
while not event is None:
|
||||||
if event['type'] == 'destroynotify':
|
if event['type'] == 'destroynotify':
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
event = pywmhelpers.getEvent()
|
|
||||||
|
|
||||||
def mainLoop(self):
|
def mainLoop(self):
|
||||||
counter = -1
|
counter = -1
|
||||||
@@ -322,36 +316,19 @@ def bytesToStr(bytes):
|
|||||||
gb = 1024 * mb
|
gb = 1024 * mb
|
||||||
tb = 1024 * gb
|
tb = 1024 * gb
|
||||||
pb = 1024 * tb
|
pb = 1024 * tb
|
||||||
|
numDigits = 3
|
||||||
if bytes < kb:
|
if bytes < kb:
|
||||||
size = bytes
|
return makeNumDigits(bytes, numDigits) + 'B'
|
||||||
letter = 'B'
|
|
||||||
#return makeNumDigits(bytes, numDigits) + 'B'
|
|
||||||
elif bytes < mb:
|
elif bytes < mb:
|
||||||
size = bytes / kb
|
return makeNumDigits(bytes/kb, numDigits) + 'k'
|
||||||
letter = 'k'
|
|
||||||
#return makeNumDigits(bytes/kb, numDigits) + 'k'
|
|
||||||
elif bytes < gb:
|
elif bytes < gb:
|
||||||
size = bytes / mb
|
return makeNumDigits(bytes/mb, numDigits) + 'M'
|
||||||
letter = 'M'
|
|
||||||
#return makeNumDigits(bytes/mb, numDigits) + 'M'
|
|
||||||
elif bytes < tb:
|
elif bytes < tb:
|
||||||
size = bytes / gb
|
return makeNumDigits(bytes/gb, numDigits) + 'G'
|
||||||
letter = 'G'
|
|
||||||
#return makeNumDigits(bytes/gb, numDigits) + 'G'
|
|
||||||
elif bytes < pb:
|
elif bytes < pb:
|
||||||
size = bytes / tb
|
return makeNumDigits(bytes/tb, numDigits) + 'T'
|
||||||
letter = 'T'
|
|
||||||
#return makeNumDigits(bytes/tb, numDigits) + 'T'
|
|
||||||
else:
|
else:
|
||||||
size = bytes / pb
|
return makeNumDigits(bytes/pb, numDigits) + 'P'
|
||||||
letter = 'p'
|
|
||||||
#return makeNumDigits(bytes/pb, numDigits) + 'P'
|
|
||||||
if size >= 1000:
|
|
||||||
res = makeNumDigits(size, 4)
|
|
||||||
else:
|
|
||||||
res = makeNumDigits(size, 3)
|
|
||||||
res += letter
|
|
||||||
return res
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
Reference in New Issue
Block a user