示例#1
0
class ChopGui:
    def __init__(self, ui_stop_fn=None, lib_stop_fn=None):
        from ChopShopCurses import ChopShopCurses

        self.cui = ChopShopCurses(ui_stop_fn, lib_stop_fn)
        self.cui.go()

    def handle_message(self, message):
        if message['data']['suppress']:
            newline = ""
        else:
            newline = "\n"

        self.cui.add_data(message['id'], message['data']['data'] + newline,
                          message['data']['color'])

    def handle_ctrl(self, message):
        if message['data']['msg'] == 'addmod':
            self.cui.add_panel(message['data']['id'], message['data']['name'])

        if message['data']['msg'] == 'finished' and message['data'][
                'status'] == 'error':
            self.stop()
            raise Exception(message['data']['errors'])

    def stop(self):
        CSD.debug_out("ChopGui stop called\n")
        self.cui.stop()
        self.cui.join()
示例#2
0
class ChopGui:
    def __init__(self, ui_stop_fn = None, lib_stop_fn = None):
        from ChopShopCurses import ChopShopCurses

        self.cui = ChopShopCurses(ui_stop_fn, lib_stop_fn)
        self.cui.go()

    def handle_message(self, message):
        if message['data']['suppress']:
            newline = ""
        else:
            newline = "\n"

        self.cui.add_data(message['id'], message['data']['data'] + newline, message['data']['color'])         

    def handle_ctrl(self, message):
        if message['data']['msg'] == 'addmod':
            self.cui.add_panel(message['data']['id'],message['data']['name'])

        if message['data']['msg'] == 'finished' and message['data']['status'] == 'error':
            self.stop()
            raise ChopLibException(message['data']['errors'])
    
    def stop(self):
        CSD.debug_out("ChopGui stop called\n")
        self.cui.stop()
        self.cui.join()
示例#3
0
class ChopGui:
    def __init__(self, ui_stop_fn=None, lib_stop_fn=None):
        from ChopShopCurses import ChopShopCurses

        self.cui = ChopShopCurses(ui_stop_fn, lib_stop_fn)
        self.cui.go()

    def handle_message(self, message):
        if message["data"]["suppress"]:
            newline = ""
        else:
            newline = "\n"

        self.cui.add_data(message["id"], message["data"]["data"] + newline, message["data"]["color"])

    def handle_ctrl(self, message):
        if message["data"]["msg"] == "addmod":
            self.cui.add_panel(message["data"]["id"], message["data"]["name"])

        if message["data"]["msg"] == "finished" and message["data"]["status"] == "error":
            self.stop()
            raise ChopLibException(message["data"]["errors"])

    def stop(self):
        CSD.debug_out("ChopGui stop called\n")
        self.cui.stop()
        self.cui.join()
示例#4
0
    def __init__(self, ui_stop_fn=None, lib_stop_fn=None):
        from ChopShopCurses import ChopShopCurses

        self.cui = ChopShopCurses(ui_stop_fn, lib_stop_fn)
        self.cui.go()
示例#5
0
    def __init__(self, ui_stop_fn = None, lib_stop_fn = None):
        from ChopShopCurses import ChopShopCurses

        self.cui = ChopShopCurses(ui_stop_fn, lib_stop_fn)
        self.cui.go()