Browse Source

Python 3 complatible.

windows
Florian N 11 years ago
parent
commit
cbf05be474
  1. 3
      README.rst
  2. 24
      pydash/services.py
  3. 8
      pydash/views.py
  4. 8
      setup.py

3
README.rst

@ -1,4 +1,4 @@
pyDash - v1.4.5
pyDash - v1.4.6
===============
A reusable django app for monitoring your linux server.
@ -8,6 +8,7 @@ Supported Python versions:
::
Python 2.x
Python 3.x
Requirements:

24
pydash/services.py

@ -18,7 +18,7 @@ def get_uptime():
uptime_time = str(timedelta(seconds=uptime_seconds))
data = uptime_time.split('.', 1)[0]
except Exception, err:
except Exception as err:
data = str(err)
return data
@ -51,7 +51,7 @@ def get_ipaddress():
data = ips
except Exception, err:
except Exception as err:
data = str(err)
return data
@ -75,7 +75,7 @@ def get_cpus():
data = {'cpus': cpus, 'type': data}
except Exception, err:
except Exception as err:
data = str(err)
return data
@ -95,7 +95,7 @@ def get_users():
else:
data = [i.split(None, 3) for i in data]
except Exception, err:
except Exception as err:
data = str(err)
return data
@ -126,7 +126,7 @@ def get_traffic(request):
data = all_traffic
except Exception, err:
except Exception as err:
data = str(err)
return data
@ -145,7 +145,7 @@ def get_platform():
data = {'osname': osname, 'hostname': uname[1], 'kernel': uname[2]}
except Exception, err:
except Exception as err:
data = str(err)
return data
@ -163,7 +163,7 @@ def get_disk():
data = [i.split(None, 6) for i in data]
except Exception, err:
except Exception as err:
data = str(err)
return data
@ -199,7 +199,7 @@ def get_disk_rw():
data = rws
except Exception, err:
except Exception as err:
data = str(err)
return data
@ -231,7 +231,7 @@ def get_mem():
data = mem_usage
except Exception, err:
except Exception as err:
data = str(err)
return data
@ -264,7 +264,7 @@ def get_cpu_usage():
data = cpu_used
except Exception, err:
except Exception as err:
data = str(err)
return data
@ -276,7 +276,7 @@ def get_load():
"""
try:
data = os.getloadavg()[0]
except Exception, err:
except Exception as err:
data = str(err)
return data
@ -295,7 +295,7 @@ def get_netstat():
data = [i.split(None, 4) for i in data]
except Exception, err:
except Exception as err:
data = str(err)
return data

8
pydash/views.py

@ -280,7 +280,7 @@ def memusage(request):
mem_usage = 0
try:
cookies = request._cookies['memory_usage']
cookies = request.COOKIES['memory_usage']
except Exception:
cookies = None
@ -399,7 +399,7 @@ def loadaverage(request):
load_average = 0
try:
cookies = request._cookies['load_average']
cookies = request.COOKIES['load_average']
except Exception:
cookies = None
@ -466,7 +466,7 @@ def gettraffic(request):
traffic = 0
try:
cookies = request._cookies['traffic']
cookies = request.COOKIES['traffic']
except Exception:
cookies = None
@ -588,7 +588,7 @@ def getdiskio(request):
diskrw = 0
try:
cookies = request._cookies['diskrw']
cookies = request.COOKIES['diskrw']
except Exception:
cookies = None

8
setup.py

@ -8,7 +8,7 @@ os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-pydash-app',
version='1.4.5',
version='1.4.6',
packages=['pydash'],
include_package_data=True,
license='MIT',
@ -27,6 +27,12 @@ setup(
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.0',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],

Loading…
Cancel
Save