config.add_section('database')
config.set('database', 'type', 'psycopg2')
config.set('database', 'database', 'abe')
+ config.set('database', 'limit', '500')
config.set('server', 'backend', 'abe')
for path in ('/etc/', ''):
if msg.find('\n') != -1: break
s.close()
r = json.loads(msg).get('result')
- if command == 'stop': print r
- elif command == 'info':
+
+ if command == 'info':
+ now = time.time()
+ print 'type address sub version time'
for item in r:
- print '%15s %3s %7s'%( item.get('address'), item.get('subscriptions'), item.get('version') )
+ print '%4s %15s %3s %7s %.2f'%( item.get('name'),
+ item.get('address'),
+ item.get('subscriptions'),
+ item.get('version'),
+ (now - item.get('time')) )
+ else:
+ print r
if __name__ == '__main__':
config = create_config()