def cull_files(args): from pysph.tools.cull import main main(args)
def manage_cache(args): from pysph.tools.manage_cache import main main(args)
def make_binder(args): from pysph.tools.binder import main main(args)
def output_vtk(args): from pysph.solver.vtk_output import main main(args)
def run_examples(args): from pysph.examples.run import main main(args)
def run_viewer(args): from pysph.tools.mayavi_viewer import main main(args)
binder = subparsers.add_parser( 'binder', help='Make a mybinder.org compatible directory for upload to a ' + 'host repo', add_help=False) binder.set_defaults(func=make_binder) cull = subparsers.add_parser( 'cull', help='Cull files in a given directory by a specified culling_factor', add_help=False) cull.set_defaults(func=cull_files) cache = subparsers.add_parser('cache', help='Show cache directories or clear them', add_help=False) cache.set_defaults(func=manage_cache) if (len(sys.argv) == 1 or (len(sys.argv) > 1 and sys.argv[1] in ['-h', '--help'])): parser.print_help() sys.exit() args, extra = parser.parse_known_args() args.func(extra) if __name__ == '__main__': main()