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)
def help_import(): View.display("Import data from a file " "that is specified in the command line.\n") View.help_import()