# Path: igor/client/junitless.py
# def clearscreen():
#     def __init__(self, txt, with_markup=True):
#     def plain(self):
#     def bold(self):
#     def italic(self):
#     def underline(self):
#     def inverse(self):
#     def markup(self):
#     def black(self):
#     def red(self):
#     def green(self):
#     def yellow(self):
#     def blue(self):
#     def magenta(self):
#     def cyan(self):
#     def white(self):
#     def write(self, msg):
#     def writeln(self, msg):
#     def indented(self, size=1):
#             def __enter__(self):
#             def __exit__(self, exc_type, exc_value, traceback):
#     def _indented(self, msg):
#     def warn(self, msg=None):
#     def error(self, msg):
#     def ok(self, msg=None):
#     def success(self, msg):
#     def fail(self, msg):
#     def header(self, msg):
#     def subhead(self, msg):
#     def debug(self, msg):
#     def __init__(self, log=None):
#     def from_file(self, filename):
#     def from_txt(self, txt):
#     def from_xml(self, xml):
#     def build(self, node):
#     def _build_testsuites(self, node):
#     def _build_testsuite(self, node):
#     def _build_testcase(self, node):
#         def sanitize_name(name):
#     def pp(tree):
# class ansi(unicode):
# class Log(object):
#         class IndentedLog(Log):
# class LogBuilder(object):
# 
# Path: igor/client/event.py
# REPORTBASE = "http://{host}:{port}/jobs/{sessionid}/status?format=xml"
# def follow_events(server, port):
# def __FIXME_retrieve_report(remote, port, sessionid):
# 
# Path: igor/client/main.py
# class IgordAPI(object):
#     """An interface to the basic REST-API of igor
#     """
#     _http = None
#     _logger = None
#     host = None
#     port = None
# 
#     def __init__(self, host="127.0.0.1", port=8080):
#         self.host = host
#         self.port = port
#         self._http = HTTPHelper()
#         self._logger = logging.getLogger(self.__module__)
# 
#     @property
#     def logger(self):
#         return self._logger
# 
#     def url(self, route="/", query={}, **route_args):
#         """Returns the URL of the remote Igord server with the given route
#         """
#         _route = route
#         if route_args:
#             _route = re.sub("<([^>:]*)(:[^>]*)?>", "{\\1}", _route)
#             _route = _route.format(**route_args)
#         _query = "?" + urllib.urlencode(query.items()) if query else ""
#         if "<" in _route:
#             self.logger.debug("Route: %s" % route)
#             self.logger.debug("RouteArgs: %s" % route_args)
#             self.logger.debug("Query: %s" % query)
#             self.logger.debug("New Route: %s" % _route)
#             self.logger.debug("New Query: %s" % _query)
#             raise RuntimeError("Some placeholders weren't filled in route.")
#         return "http://{host}:{port}{route}{query}".format(host=self.host,
#                                                            port=self.port,
#                                                            route=_route,
#                                                            query=_query)
# 
#     def route_request(self, route, **route_args):
#         """Request a route and return an XML tree
#         """
#         url = self.url(route, {"format": "xml"}, **route_args)
#         pagedata = self._http.request(url)
#         tree = etree.XML(pagedata) if pagedata else None
#         return tree
# 
#     def jobs(self):
#         return self.route_request(routes.jobs)
# 
#     def testsuites(self):
#         return self.route_request(routes.testsuites)
# 
#     def hosts(self):
#         return self.route_request(routes.hosts)
# 
#     def profiles(self):
#         return self.route_request(routes.profiles)
# 
#     def testplans(self):
#         return self.route_request(routes.testplans)
# 
#     def testsuite(self, name):
#         return TestsuiteAPI(self.host, self.port, name)
# 
#     def job(self, sessionid):
#         return JobAPI(self.host, self.port, sessionid)
# 
#     def profile(self, name):
#         return ProfileAPI(self.host, self.port, name)
# 
#     def testplan(self, name):
#         return TestplanAPI(self.host, self.port, name)
# 
#     def datastore(self):
#         return DatastoreAPI(self.host, self.port)


from igor.client import junitless, event
from igor.client.main import IgordAPI
from lxml import etree
import argparse
import cmd
import logging
import os
import shlex
import subprocess
import urlparse
        return True

    def do_env(self, args):
        """env
        Get environment variables
        """
        env = self.ctx.__dict__
        print("\n".join("%s: %s" % i for i in env.items()))
        print("(%d variables)" % len(env))

    def _parse_do_args(self, prog, line, arguments):
        parser = argparse.ArgumentParser(prog=prog)
        for args, kwargs in arguments:
            args = (args,) if type(args) in [str, unicode] else args
            parser.add_argument(*args, **kwargs)
        return parser.parse_args(shlex.split(line))

    def do_set(self, line):
        """set <key> [<value>]
        Set environment variables
        """
        pargs = [("key", {}),
                 ("value", {"nargs": "?"})]
        _args = self._parse_do_args("set", line, pargs)
        if _args.value:
            self.ctx.__dict__[_args.key] = _args.value

    def __igorapi(self):
        remote = self.ctx.remote
        port = self.ctx.port

# Path: igor/client/junitless.py
# def clearscreen():
#     def __init__(self, txt, with_markup=True):
#     def plain(self):
#     def bold(self):
#     def italic(self):
#     def underline(self):
#     def inverse(self):
#     def markup(self):
#     def black(self):
#     def red(self):
#     def green(self):
#     def yellow(self):
#     def blue(self):
#     def magenta(self):
#     def cyan(self):
#     def white(self):
#     def write(self, msg):
#     def writeln(self, msg):
#     def indented(self, size=1):
#             def __enter__(self):
#             def __exit__(self, exc_type, exc_value, traceback):
#     def _indented(self, msg):
#     def warn(self, msg=None):
#     def error(self, msg):
#     def ok(self, msg=None):
#     def success(self, msg):
#     def fail(self, msg):
#     def header(self, msg):
#     def subhead(self, msg):
#     def debug(self, msg):
#     def __init__(self, log=None):
#     def from_file(self, filename):
#     def from_txt(self, txt):
#     def from_xml(self, xml):
#     def build(self, node):
#     def _build_testsuites(self, node):
#     def _build_testsuite(self, node):
#     def _build_testcase(self, node):
#         def sanitize_name(name):
#     def pp(tree):
# class ansi(unicode):
# class Log(object):
#         class IndentedLog(Log):
# class LogBuilder(object):
# 
# Path: igor/client/event.py
# REPORTBASE = "http://{host}:{port}/jobs/{sessionid}/status?format=xml"
# def follow_events(server, port):
# def __FIXME_retrieve_report(remote, port, sessionid):
# 
# Path: igor/client/main.py
# class IgordAPI(object):
#     """An interface to the basic REST-API of igor
#     """
#     _http = None
#     _logger = None
#     host = None
#     port = None
# 
#     def __init__(self, host="127.0.0.1", port=8080):
#         self.host = host
#         self.port = port
#         self._http = HTTPHelper()
#         self._logger = logging.getLogger(self.__module__)
# 
#     @property
#     def logger(self):
#         return self._logger
# 
#     def url(self, route="/", query={}, **route_args):
#         """Returns the URL of the remote Igord server with the given route
#         """
#         _route = route
#         if route_args:
#             _route = re.sub("<([^>:]*)(:[^>]*)?>", "{\\1}", _route)
#             _route = _route.format(**route_args)
#         _query = "?" + urllib.urlencode(query.items()) if query else ""
#         if "<" in _route:
#             self.logger.debug("Route: %s" % route)
#             self.logger.debug("RouteArgs: %s" % route_args)
#             self.logger.debug("Query: %s" % query)
#             self.logger.debug("New Route: %s" % _route)
#             self.logger.debug("New Query: %s" % _query)
#             raise RuntimeError("Some placeholders weren't filled in route.")
#         return "http://{host}:{port}{route}{query}".format(host=self.host,
#                                                            port=self.port,
#                                                            route=_route,
#                                                            query=_query)
# 
#     def route_request(self, route, **route_args):
#         """Request a route and return an XML tree
#         """
#         url = self.url(route, {"format": "xml"}, **route_args)
#         pagedata = self._http.request(url)
#         tree = etree.XML(pagedata) if pagedata else None
#         return tree
# 
#     def jobs(self):
#         return self.route_request(routes.jobs)
# 
#     def testsuites(self):
#         return self.route_request(routes.testsuites)
# 
#     def hosts(self):
#         return self.route_request(routes.hosts)
# 
#     def profiles(self):
#         return self.route_request(routes.profiles)
# 
#     def testplans(self):
#         return self.route_request(routes.testplans)
# 
#     def testsuite(self, name):
#         return TestsuiteAPI(self.host, self.port, name)
# 
#     def job(self, sessionid):
#         return JobAPI(self.host, self.port, sessionid)
# 
#     def profile(self, name):
#         return ProfileAPI(self.host, self.port, name)
# 
#     def testplan(self, name):
#         return TestplanAPI(self.host, self.port, name)
# 
#     def datastore(self):
#         return DatastoreAPI(self.host, self.port)


# Path: igor/client/__main__.py
from igor.client import junitless, event
from igor.client.main import IgordAPI
from lxml import etree
import argparse
import cmd
import logging
import os
import shlex
import subprocess
import urlparse

        return True

    def do_env(self, args):
        """env
        Get environment variables
        """
        env = self.ctx.__dict__
        print("\n".join("%s: %s" % i for i in env.items()))
        print("(%d variables)" % len(env))

    def _parse_do_args(self, prog, line, arguments):
        parser = argparse.ArgumentParser(prog=prog)
        for args, kwargs in arguments:
            args = (args,) if type(args) in [str, unicode] else args
            parser.add_argument(*args, **kwargs)
        return parser.parse_args(shlex.split(line))

    def do_set(self, line):
        """set <key> [<value>]
        Set environment variables
        """
        pargs = [("key", {}),
                 ("value", {"nargs": "?"})]
        _args = self._parse_do_args("set", line, pargs)
        if _args.value:
            self.ctx.__dict__[_args.key] = _args.value

    def __igorapi(self):
        remote = self.ctx.remote
        port = self.ctx.port

        return IgordAPI(remote, port)