You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
810 B

  1. import nilmdb
  2. from nilmdb.utils.printf import *
  3. from argparse import ArgumentDefaultsHelpFormatter as def_form
  4. def setup(self, sub):
  5. cmd = sub.add_parser("info", help="Server information",
  6. formatter_class = def_form,
  7. description="""
  8. List information about the server, like
  9. version.
  10. """)
  11. cmd.set_defaults(handler = cmd_info)
  12. def cmd_info(self):
  13. """Print info about the server"""
  14. printf("Client version: %s\n", nilmdb.__version__)
  15. printf("Server version: %s\n", self.client.version())
  16. printf("Server URL: %s\n", self.client.geturl())
  17. printf("Server database path: %s\n", self.client.dbpath())
  18. printf("Server database size: %s\n", self.client.dbsize())