# Path: wikked/commands/base.py
# class WikkedCommand(object):
#     def __init__(self):
#         self.name = None
#         self.description = None
#         self.requires_wiki = True
# 
#     def setupParser(self, parser):
#         raise NotImplementedError()
# 
#     def run(self, ctx):
#         raise NotImplementedError()
# 
#     def _doRun(self, ctx):
#         if ctx.wiki is None and self.requires_wiki:
#             raise Exception("No wiki found here.")
#         result = self.run(ctx)
#         if result is None:
#             result = 0
#         return result
# 
# def register_command(cls):
#     command_classes.append(cls)
#     return cls


import os
import os.path
import imp
import logging
        import wikked.settings
from wikked.commands.base import WikkedCommand, register_command
        from wikked.web import app
        from wikked.tasks import celery_app
                help="Pass some configuration value to the Flask application. "
                     "This must be of the form: name=value",
                nargs="*")

    def run(self, ctx):
        # Change working directory because the Flask app can currently
        # only initialize itself relative to that...
        # TODO: make the Flask initialization more clever.
        os.chdir(ctx.params.root)

        # Setup some settings that need to be set before the app is created.
        if ctx.args.usetasks:
            wikked.settings.WIKI_ASYNC_UPDATE = True
        if ctx.args.config:
            for cv in ctx.args.config:
                cname, cval = cv.split('=')
                if cval in ['true', 'True', 'TRUE']:
                    setattr(wikked.settings, cname, True)
                else:
                    setattr(wikked.settings, cname, cval)

        # Remove Flask's default logging handler. Since the app is under the
        # overall Wikked package, logging is handled by the root logger
        # already.
        wikked.settings.WIKI_NO_FLASK_LOGGER = True

        # When running from the command line, we only have one web server
        # so make it also serve static files.
        wikked.settings.WIKI_SERVE_FILES = True
        if not ctx.args.no_update:

# Path: wikked/commands/base.py
# class WikkedCommand(object):
#     def __init__(self):
#         self.name = None
#         self.description = None
#         self.requires_wiki = True
# 
#     def setupParser(self, parser):
#         raise NotImplementedError()
# 
#     def run(self, ctx):
#         raise NotImplementedError()
# 
#     def _doRun(self, ctx):
#         if ctx.wiki is None and self.requires_wiki:
#             raise Exception("No wiki found here.")
#         result = self.run(ctx)
#         if result is None:
#             result = 0
#         return result
# 
# def register_command(cls):
#     command_classes.append(cls)
#     return cls


# Path: wikked/commands/web.py
import os
import os.path
import imp
import logging
        import wikked.settings
from wikked.commands.base import WikkedCommand, register_command
        from wikked.web import app
        from wikked.tasks import celery_app

                help="Pass some configuration value to the Flask application. "
                     "This must be of the form: name=value",
                nargs="*")

    def run(self, ctx):
        # Change working directory because the Flask app can currently
        # only initialize itself relative to that...
        # TODO: make the Flask initialization more clever.
        os.chdir(ctx.params.root)

        # Setup some settings that need to be set before the app is created.
        if ctx.args.usetasks:
            wikked.settings.WIKI_ASYNC_UPDATE = True
        if ctx.args.config:
            for cv in ctx.args.config:
                cname, cval = cv.split('=')
                if cval in ['true', 'True', 'TRUE']:
                    setattr(wikked.settings, cname, True)
                else:
                    setattr(wikked.settings, cname, cval)

        # Remove Flask's default logging handler. Since the app is under the
        # overall Wikked package, logging is handled by the root logger
        # already.
        wikked.settings.WIKI_NO_FLASK_LOGGER = True

        # When running from the command line, we only have one web server
        # so make it also serve static files.
        wikked.settings.WIKI_SERVE_FILES = True
        if not ctx.args.no_update:

            wikked.settings.WIKI_AUTO_RELOAD = True