dbassembly

dbassembly Module

Contains global variables

dbassembly.cli Module

Module that contains the command line app.

Why does this file exist, and why not put this in __main__?

You might be tempted to import things from __main__() later, but that will cause problems: the code will get executed twice:

  • When you run python -mdbassembly Python will execute __main__.py as a script. That means there won’t be any dbassembly.__main__() in sys.modules.
  • When you import __main__ it will get executed again (as a module) because there’s no dbassembly.__main__() in sys.modules.

Also see (1) from http://click.pocoo.org/5/setuptools/#setuptools-integration

dbassembly.cli.basename(path)[source]

Returns basename of current path

Parameters:path (str) – path
Returns:relative path
dbassembly.cli.main(argv=None)[source]

Main entry point

Parameters:argv (list) – Arguments to parse or None (=use sys.argv)
Returns:result from App.process()
dbassembly.cli.main_app(cli)[source]

Main entry point for testing purpose

Parameters:cli (dict) – dictionary from docopt parsing
Returns:success code (0 => ok; !=0 => error)
dbassembly.cli.parsecli(argv=None)[source]

Parse command line arguments with docopt

Parameters:argv (list) – Arguments to parse or None (=use sys.argv)
Returns:parsed arguments
Return type:docopt.Dict