Updated the admin module.
Minor tweaks in configuration. Added deprecated decorator.
This commit is contained in:
parent
5592bc4a91
commit
861f9e6105
|
@ -1 +1,2 @@
|
||||||
__author__ = 'dorian'
|
__author__ = 'dorian'
|
||||||
|
__version__ = '0.2.0'
|
||||||
|
|
|
@ -51,20 +51,25 @@ def main():
|
||||||
|
|
||||||
|
|
||||||
def build_argument_parser():
|
def build_argument_parser():
|
||||||
|
|
||||||
|
from rookeries import __version__ as app_version
|
||||||
# TODO Document.
|
# TODO Document.
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="Admin utility for managing a Rookeries site for development and production.")
|
description="Admin utility for managing a Rookeries site for development and production.")
|
||||||
|
|
||||||
cmd_subparser = parser.add_subparsers(title='subcommands', description='valid subcommands', help='additional help')
|
parser.add_argument("--version", "-v", action="version", version="Rookeries Admin - " + app_version)
|
||||||
|
sub_parser = parser.add_subparsers(title="commands", description="Valid commands that can be run by the admin.",
|
||||||
|
help="command help")
|
||||||
|
|
||||||
rebuild_db_subparser = cmd_subparser.add_parser("rebuild_db", help="Rebuilds the database.")
|
config_parser = sub_parser.add_parser("config", help="Configuration tweaking.")
|
||||||
rebuild_db_subparser.add_argument("--drop-tables", nargs="?", help="Drops the existing tables.")
|
config_parser.add_argument("--json", choices=["regular", "in-line"], default="regular", type=bool,
|
||||||
rebuild_db_subparser.add_argument("--init-data", nargs="?", help="Drops the existing tables.")
|
help="Print out in JSON format.")
|
||||||
rebuild_db_subparser.set_defaults(func=rebuild_database)
|
config_parser.set_defaults(func=print_configuration_opt)
|
||||||
|
|
||||||
config_subparser = cmd_subparser.add_parser("config", help="Configuration tweaking.")
|
rebuild_db_parser = sub_parser.add_parser("rebuild_db", help="Rebuilds the database.")
|
||||||
config_subparser.add_argument("--json-out", nargs="?", help="Print out in JSON format.")
|
rebuild_db_parser.add_argument("--drop-tables", nargs="?", help="Drops the existing tables.")
|
||||||
config_subparser.set_defaults(func=print_configuration_opt)
|
rebuild_db_parser.add_argument("--init-data", nargs="?", help="Drops the existing tables.")
|
||||||
|
rebuild_db_parser.set_defaults(func=rebuild_database)
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
__author__ = 'dorian'
|
__author__ = 'dorian'
|
||||||
|
__version__ = '0.2.0'
|
||||||
|
|
Loading…
Reference in New Issue