Exemple #1
0
 def do_export(self, line):
     """
     Export command
     :param line: (String) [-pk] [file path]
     :return: None
     :Author: Zhiming Liu
     """
     args = list(arg.lower() for arg in str(line).split())
     if args[0] == "-pk" and len(args) > 1:
         try:
             pk = PickleOperations()
             pk.pickle_dump(args[1], self._std.get_all_data())
         except Exception as e:
             View.error(e)
             View.help_export()
         else:
             View.success("Data has been saved to %s" % args[1])
     else:
         View.info("Invalid command")
         View.help_export()
Exemple #2
0
 def help_export():
     View.display("Export data to a local file "
                  "that is specified in the command line.\n")
     View.help_export()