Created
February 28, 2017 08:16
Revisions
-
linuxluigi created this gist
Feb 28, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ import argparse # import data2tabshop # from data2tabshop import __version__ __version__ = '0.1.0' __author__ = u'Steffen Exler' def get_parser(): """ Creates a new argument parser. """ parser = argparse.ArgumentParser('Data2TabShop') version = '%(prog)s ' + __version__ parser.add_argument('--version', '-v', action='version', version=version) parser.add_argument('--loadDatabase', '-l', type=load_database, help='Load a File to Google Spreadsheet: -l data.xml', ) return parser def load_database(file): print("File will be loaded") print(file) def main(args=None): """ Main entry point for your project. Args: args : list A of arguments as if they were input in the command line. Leave it None to use sys.argv. """ parser = get_parser() args = parser.parse_args(args) if __name__ == '__main__': main()