# Path: skema/config.py
# def get_config():
#     global _config
#     if _config is not None:
#         return _config
#     _config = SkemaConfig()
#     return _config


import os
import sys
import skema.command
import skema.suite
        import skema
from optparse import make_option
from traceback import format_exc
from skema.config import get_config
        from skema.suiteutils import suiteloader
        from skema.suiteutils import suiteloader
        from skema.suiteutils import suiteloader
        from skema.tagutils import tagloader
        from skema.tagutils import tagloader
        from skema import suites
        from pkgutil import walk_packages
        from skema import tags
        from pkgutil import walk_packages
            suite.install()
        except RuntimeError as strerror:
            print "Suite installation error: %s" % strerror
            sys.exit(1)


class cmd_run_suite(skema.command.SkemaCmd):
    """
    Run suites
    """
    arglist = ['*suitename']
    options = [make_option('-q', '--quiet', action='store_true',
                           default=False, dest='quiet'),
               make_option('-o', '--output',  action='store',
                           default=None, metavar="DIR",
                           help="Store processed suite output to DIR")
               ]

    def run(self):

        if len(self.args) != 1:
            print "please specify the name of the suite to run"
            sys.exit(1)
        suite = suiteloader(self.args[0])
        try:
            return suite.run(quiet=self.opts.quiet, output=self.opts.output)

        except Exception as strerror:
            print "Suite execution error: %s" % strerror
            print (format_exc())

# Path: skema/config.py
# def get_config():
#     global _config
#     if _config is not None:
#         return _config
#     _config = SkemaConfig()
#     return _config


# Path: skema/builtins.py
import os
import sys
import skema.command
import skema.suite
        import skema
from optparse import make_option
from traceback import format_exc
from skema.config import get_config
        from skema.suiteutils import suiteloader
        from skema.suiteutils import suiteloader
        from skema.suiteutils import suiteloader
        from skema.tagutils import tagloader
        from skema.tagutils import tagloader
        from skema import suites
        from pkgutil import walk_packages
        from skema import tags
        from pkgutil import walk_packages

            suite.install()
        except RuntimeError as strerror:
            print "Suite installation error: %s" % strerror
            sys.exit(1)


class cmd_run_suite(skema.command.SkemaCmd):
    """
    Run suites
    """
    arglist = ['*suitename']
    options = [make_option('-q', '--quiet', action='store_true',
                           default=False, dest='quiet'),
               make_option('-o', '--output',  action='store',
                           default=None, metavar="DIR",
                           help="Store processed suite output to DIR")
               ]

    def run(self):

        if len(self.args) != 1:
            print "please specify the name of the suite to run"
            sys.exit(1)
        suite = suiteloader(self.args[0])
        try:
            return suite.run(quiet=self.opts.quiet, output=self.opts.output)

        except Exception as strerror:
            print "Suite execution error: %s" % strerror
            print (format_exc())

            config = get_config()