# Path: webtools/management/base.py
# class Command(object):
#     def __init__(self, cmdapp):
#         self.cmdapp = cmdapp
# 
#     @classmethod
#     def get_name(cls):
#         name = cls.__name__.lower()
#         if name.endswith("command"):
#             name = name[:-7]
#         elif name.endswith("cmd"):
#             name = name[:-3]
#         return name
# 
#     @classmethod
#     def get_description(cls):
#         doc = inspect.getdoc(cls)
#         if not doc:
#             return ""
# 
#         return doc.strip().split("\n")[0]
# 
#     @classmethod
#     def get_parser(cls, root_parser):
#         """
#         Return an :class:`argparse.ArgumentParser`.
#         """
#         return root_parser
# 
#     def take_action(self, parsed_args):
#         """
#         Override to do something useful.
#         """
#         raise NotImplementedError
# 
#     def run(self, parsed_args):
#         """
#         Invoked by the application when the command is run.
# 
#         Developers implementing commands should override
#         :meth:`take_action`.
# 
#         Developers creating new command base classes (such as
#         :class:`Lister` and :class:`ShowOne`) should override this
#         method to wrap :meth:`take_action`.
#         """
#         self.take_action(parsed_args)
#         return 0
# 
# Path: webtools/utils/imp.py
# def load_class(path):
#     """
#     Load class from path.
#     """
# 
#     mod_name, klass_name = None, None
# 
#     try:
#         mod_name, klass_name = path.rsplit('.', 1)
#         mod = import_module(mod_name)
#     except AttributeError as e:
#         raise RuntimeError("Error importing {0}: '{1}'".format(mod_name, e))
# 
#     try:
#         klass = getattr(mod, klass_name)
#     except AttributeError:
#         raise RuntimeError('Module "{0}" does not define a "{1}" class'.format(mod_name, klass_name))
# 
#     return klass


from webtools.management.base import Command
from webtools.utils.imp import load_class
        from webtools.application import Application
        import tornado.ioloop



class RunserverCommand(Command):
    def take_action(self, options):
        if not options.settings:
            raise RuntimeError("For start serverm --settings parameter"
                                " is mandatory!")
        try:

# Path: webtools/management/base.py
# class Command(object):
#     def __init__(self, cmdapp):
#         self.cmdapp = cmdapp
# 
#     @classmethod
#     def get_name(cls):
#         name = cls.__name__.lower()
#         if name.endswith("command"):
#             name = name[:-7]
#         elif name.endswith("cmd"):
#             name = name[:-3]
#         return name
# 
#     @classmethod
#     def get_description(cls):
#         doc = inspect.getdoc(cls)
#         if not doc:
#             return ""
# 
#         return doc.strip().split("\n")[0]
# 
#     @classmethod
#     def get_parser(cls, root_parser):
#         """
#         Return an :class:`argparse.ArgumentParser`.
#         """
#         return root_parser
# 
#     def take_action(self, parsed_args):
#         """
#         Override to do something useful.
#         """
#         raise NotImplementedError
# 
#     def run(self, parsed_args):
#         """
#         Invoked by the application when the command is run.
# 
#         Developers implementing commands should override
#         :meth:`take_action`.
# 
#         Developers creating new command base classes (such as
#         :class:`Lister` and :class:`ShowOne`) should override this
#         method to wrap :meth:`take_action`.
#         """
#         self.take_action(parsed_args)
#         return 0
# 
# Path: webtools/utils/imp.py
# def load_class(path):
#     """
#     Load class from path.
#     """
# 
#     mod_name, klass_name = None, None
# 
#     try:
#         mod_name, klass_name = path.rsplit('.', 1)
#         mod = import_module(mod_name)
#     except AttributeError as e:
#         raise RuntimeError("Error importing {0}: '{1}'".format(mod_name, e))
# 
#     try:
#         klass = getattr(mod, klass_name)
#     except AttributeError:
#         raise RuntimeError('Module "{0}" does not define a "{1}" class'.format(mod_name, klass_name))
# 
#     return klass


# Path: webtools/management/commands/runserver.py
from webtools.management.base import Command
from webtools.utils.imp import load_class
        from webtools.application import Application
        import tornado.ioloop




class RunserverCommand(Command):
    def take_action(self, options):
        if not options.settings:
            raise RuntimeError("For start serverm --settings parameter"
                                " is mandatory!")
        try:

            settings_cls = load_class(options.settings)