summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorpozar2015-09-26 17:31:53 +0200
committerpozar2015-09-26 17:31:53 +0200
commitf141159130d1fcfec9090a9e2e4305de8b0c3d83 (patch)
tree821ba3f8206e2183be3015b10790626aee9b005d
parent26a48f27da55f9817af6a7965915b12e4fb04c43 (diff)
downloadaur-f141159130d1fcfec9090a9e2e4305de8b0c3d83.tar.gz
Update to 0.6.6
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD16
-rw-r--r--arch.patch53
3 files changed, 70 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 60214c8d9190..f9e4b2c5918c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,16 @@
pkgbase = pyarchey
pkgdesc = A simple python scrip to display an OS logo in ASCII art along with basic system information.
- pkgver = 0.6.2
+ pkgver = 0.6.6
pkgrel = 1
url = https://pypi.python.org/pypi/pyarchey/
arch = any
license = GPL
depends = python
depends = python-psutil
- source = https://pypi.python.org/packages/source/p/pyarchey/pyarchey-0.6.2.tar.gz
- md5sums = c48f20072d1a167140a3f91b4bf3e597
+ source = https://pypi.python.org/packages/source/p/pyarchey/pyarchey-0.6.6.tar.gz
+ source = arch.patch
+ md5sums = 218d9b49bcfa68a38b0797a2c773c713
+ md5sums = 61a1cf1639c259c06d8d4eb1c1f2e222
pkgname = pyarchey
diff --git a/PKGBUILD b/PKGBUILD
index b247ac295f48..831fad75864f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,18 +2,26 @@
pkgname=pyarchey
pkgdesc="A simple python scrip to display an OS logo in ASCII art along with basic system information."
-pkgver=0.6.2
+pkgver=0.6.6
pkgrel=1
+arch=('i686','x86_64')
url="https://pypi.python.org/pypi/pyarchey/"
license=('GPL')
arch=('any')
depends=('python'
'python-psutil')
-source="https://pypi.python.org/packages/source/p/pyarchey/pyarchey-${pkgver}.tar.gz"
-md5sums=('c48f20072d1a167140a3f91b4bf3e597')
+source=("https://pypi.python.org/packages/source/p/pyarchey/pyarchey-${pkgver}.tar.gz"
+ 'arch.patch')
+md5sums=('218d9b49bcfa68a38b0797a2c773c713'
+ '61a1cf1639c259c06d8d4eb1c1f2e222')
-package(){
+prepare(){
tar -zxvf pyarchey-${pkgver}.tar.gz
+ # some fixes
+ patch -p1 -i "${srcdir}/arch.patch"
+}
+
+package(){
cd pyarchey-${pkgver}
python setup.py install --root="${pkgdir}" --optimize=1
}
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()')
+