Esempio n. 1
0
    def do_import(self, line):
        """
        Import command
        :param line: (String) [-csv|-pk] [file path]
        :return: None
        :Author: Zhiming Liu
        """
        cmd = ImportCommand(line)

        if cmd.file_type is None or cmd.file_name is None:
            View.info("Invalid command.")
            View.help_import()

        elif cmd.file_type == "csv":
            self.import_csv(cmd.file_name)

        elif cmd.file_type == "pk":
            self.import_pickle(cmd.file_name)
Esempio n. 2
0
 def help_import():
     View.display("Import data from a file "
                  "that is specified in the command line.\n")
     View.help_import()