diff options
Diffstat (limited to 'arch.patch')
-rw-r--r-- | arch.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/arch.patch b/arch.patch new file mode 100644 index 000000000000..79a74b21958c --- /dev/null +++ b/arch.patch @@ -0,0 +1,53 @@ +--- src/pyarchey-0.6.6/pyarchey/pyarchey.py 2015-09-26 17:16:41.076808842 +0200 ++++ src/pyarchey-0.6.6/pyarchey/pyarchey.py 2015-09-26 17:21:38.420151890 +0200 +@@ -444,7 +444,7 @@ + Does the printing. Either picture and info to screen or dumps json. + """ + if js: +- print json.dumps(self.json) ++ print(json.dumps(self.json)) + else: + print(logosDict[self.distro].format(color = colorDict[self.distro], results = self.results)) + +@@ -555,9 +555,13 @@ + + class Disk(object): + def __init__(self,json=False): +- p = ps.disk_usage('/') +- total = p.total +- used = p.used ++ #p = ps.disk_usage('/') ++ #total = p.total ++ #used = p.used ++ total = sum([ps.disk_usage(part.mountpoint).total for part in ps.disk_partitions()]) ++ used = sum([ps.disk_usage(part.mountpoint).used for part in ps.disk_partitions()]) ++ ++ + + used,total,size = autoSize(used,total) + +@@ -566,11 +570,11 @@ + if json: + disk = '%s / %s %s' % (used, total, size) + else: +- if usedpercent <= 33: ++ if usedpercent <= 50: + disk = '%s%s %s/ %s %s' % (colorDict['Sensors'][1], used, colorDict['Clear'][0], total, size) +- if usedpercent > 33 and usedpercent < 67: ++ if usedpercent > 50 and usedpercent < 75: + disk = '%s%s %s/ %s %s' % (colorDict['Sensors'][2], used, colorDict['Clear'][0], total, size) +- if usedpercent >= 67: ++ if usedpercent >= 75: + disk = '%s%s %s/ %s %s' % (colorDict['Sensors'][0], used, colorDict['Clear'][0], total, size) + self.key = 'Disk' + self.value = disk +@@ -592,7 +596,8 @@ + if host.find('.local') < 0: + host=host + '.local' + +- ip = socket.gethostbyname(host) ++ #ip = socket.gethostbyname(host) ++ ip = [(s.connect(('8.8.8.8', 80)), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1] + except: + print('Error in IP()') + |