Ejemplo n.º 1
0
 def __init__(self, session, debug=False):
     self.loop = None
     self.session = session
     self.footer = urwid.AttrMap(
         urwid.Text([
             ("key", "ESC"),
             " Quit  ",
             ("key", "Tab"),
             " Move Selection  ",
             ("key", "F1"),
             " Help  ",
             ("key", "F2"),
             " Reset ",
             ("key", "F5"),
             " Add Test Case ",
             ("key", "F6"),
             " Add Test Suite ",
             ("key", "F9"),
             " Add Equipment ",
             ("key", "F10"),
             " Add Environment ",
         ]), "foot")
     self.reset()
     self.top = urwid.Frame(urwid.AttrMap(self.form, 'body'),
                            footer=self.footer)
     if debug:
         from pycopia import logwindow
         widgets.DEBUG = logwindow.DebugLogWindow()
Ejemplo n.º 2
0
def main(argv):
    """qashell [-dD]
    Run the QA shell.
    """
    from pycopia import getopt
    debug = 0
    try:
        optlist, longopts, args = getopt.getopt(argv[1:], "?hdD")
    except getopt.GetoptError:
        print(main.__doc__)
        return
    for opt, val in optlist:
        if opt in ("-?", "-h"):
            print(main.__doc__)
            return
        elif opt == "-d":
            debug += 1
        elif opt == "-D":
            from pycopia import autodebug

    if debug:
        from pycopia import logwindow
        widgets.DEBUG = logwindow.DebugLogWindow(do_stderr=True)

    app = TestRunnerShell()
    try:
        app.run()
    except:
        if debug:
            ex, val, tb = sys.exc_info()
            from pycopia import debugger
            if debug > 1:
                from pycopia import IOurxvt
                io = IOurxvt.UrxvtIO()
            else:
                io = None
            debugger.post_mortem(tb, ex, val, io)
            widgets.DEBUG.close()
            if debug > 1:
                io.close()
        else:
            raise
Ejemplo n.º 3
0
        return urwid.Pile([urwid.LineBox(listbox), urwid.LineBox(treebox)])

    def _build_tree(self, contents):
        return []  # XXX


def _test(argv):

    #pprint(construct_example_tree())
    TCLIST = [
        "testcases.unittests.process.expect",
        "testcases.unittests.process.expect.BasicExpect",
        "testcases.unittests.process.expect.TimeoutExpect",
        "testcases.unittests.storage.imported",
        "testcases.unittests.core.scheduler",
        "testcases.unittests.core.scheduler.BasicSleepTest",
        "testcases.unittests.core.scheduler.BasicTimer",
    ]
    app = TestForm("Test Form", TCLIST)
    print(app.run())


if __name__ == "__main__":
    from pprint import pprint
    from pycopia.db.tui import eventloop
    from pycopia import autodebug
    from pycopia import logwindow
    DEBUG = logwindow.DebugLogWindow()
    walkers.DEBUG = DEBUG
    _test(sys.argv)