Browse files

added couple of converter for the redis monitor

  • Loading branch information...
1 parent 7d6a170 commit 9dc9802a784ef0cfa8c4b90a8d40e4b98c6b043e @lsbardel committed Aug 18, 2011
Showing with 34 additions and 13 deletions.
  1. +7 −7 README.rst
  2. +12 −0 index.html
  3. +15 −6 stdnet/lib/redisinfo.py
View
14 README.rst
@@ -1,3 +1,10 @@
+**A Python 3 compatible object relational mapper for Redis remote data structures.**
+
+The data is owned by different, configurable back-end databases and it is accessed using a
+light-weight Object Relational Mapper (ORM_) inspired by Django_ and SQLAlchemy_.
+The `source code`__ and documentation__ are hosted at github while Downloads__ are available via PyPi.
+
+--
:Documentation: http://lsbardel.github.com/python-stdnet/
:Dowloads: http://pypi.python.org/pypi/python-stdnet/
@@ -6,13 +13,6 @@
:Mailing List: https://groups.google.com/group/python-stdnet
:Keywords: server, database, cache, redis, orm
---
-
-**A Python 3 compatible object relational mapper for Redis remote data structures.**
-
-The data is owned by different, configurable back-end databases and it is accessed using a
-light-weight Object Relational Mapper (ORM_) inspired by Django_ and SQLAlchemy_.
-The `source code`__ and documentation__ are hosted at github while Downloads__ are available via PyPi.
__ http://github.com/lsbardel/python-stdnet
__ http://lsbardel.github.com/python-stdnet/
View
12 index.html
@@ -0,0 +1,12 @@
+<html>
+ <head>
+ <title>A web page that points a browser to a different page after 2 seconds</title>
+ <meta http-equiv="refresh" content="2; URL=http://lsbardel.github.com/python-stdnet/">
+ <meta name="keywords" content="automatic redirection">
+ </head>
+ <body>
+ <h3>Python stdnet's documentation is maintained at github.</h3>
+ <p>You will be redirected to the new documentation within 2 seconds.</p>
+ <p>If the browser does not automatically redirect you, you may want to go to <a href="http://lsbardel.github.com/python-stdnet/">github</a> manually.</p>
+ </body>
+</html>
View
21 stdnet/lib/redisinfo.py
@@ -295,7 +295,9 @@ def fill(self):
class RedisInfo22(RedisInfo):
names = ('Server','Memory','Persistence','Diskstore',
'Replication','Clients','Stats','CPU')
- converters = {'last_save_time': 'date'}
+ converters = {'last_save_time': ('date',None),
+ 'uptime_in_seconds': ('timedelta','uptime'),
+ 'uptime_in_days':None}
def makekeys(self):
return self._makekeys(self.info['Keyspace'])
@@ -308,14 +310,21 @@ def makepanel(self, name):
nicebool = self.formatter.format_bool
boolval = (0,1)
for k,v in iteritems(self.info[name]):
+ add = True
if k in self.converters:
- formatter = getattr(self.formatter,
- 'format_{0}'.format(self.converters[k]))
- v = formatter(v)
+ fdata = self.converters[k]
+ if fdata:
+ formatter = getattr(self.formatter,
+ 'format_{0}'.format(fdata[0]))
+ k = fdata[1] or k
+ v = formatter(v)
+ else:
+ add = False
elif v in boolval:
v = nicebool(v)
- pa.append({'name':nicename(k),
- 'value':v})
+ if add:
+ pa.append({'name':nicename(k),
+ 'value':v})
def fill(self):
info = self.info

0 comments on commit 9dc9802

Please sign in to comment.