Exemplo n.º 1
0
def main():
    # Add cryptikchaos path
    import pythonpath
    pythonpath.AddSysPath('.') # ./main.py (pwd: src)
    pythonpath.AddSysPath('../..') # ../../main.py (pwd: test dir)
    
    try:
        from cryptikchaos.app import CryptikChaosApp
    except KeyboardInterrupt:
        Logger.error("MAIN APP: Cryptikchaos services was interrupted.")
    else:
        from cryptikchaos.libs.utilities import run_kivy_app
        run_kivy_app(CryptikChaosApp)
Exemplo n.º 2
0
            text = "{}{}[color={}]{}[/color] : {}".format(
                constants.GUI_LABEL_LEFT_PADDING, constants.GUI_LABEL_PROMPT_SYM, rcc, str(peerid), msg
            )

        text = "\n{}".format(text)

        # Send text to console
        self.display_text("\n" + text)

        # Print in log
        if constants.ENABLE_CMD_LOG:
            # Get peer id for log
            if not peerid:
                logger_peerid = constants.PEER_NAME
            else:
                logger_peerid = peerid

            Logger.debug("TESTSERVER: [{}] => {}".format(logger_peerid, msg))

    def display_text(self, text):

        # Append line to label
        self.test_win.text += "\n[color={}]{}[/color]".format(constants.GUI_FONT_COLOR, text)


if __name__ == "__main__":

    from cryptikchaos.libs.utilities import run_kivy_app

    run_kivy_app(CryptikChaosTestApp)
Exemplo n.º 3
0
# Add cryptikchaos path
import pythonpath
pythonpath.AddSysPath('../../src')
    
from cryptikchaos.core.services import CoreServices


class CryptikChaosApp(CoreServices):

    """
    Main Application class.
    Inherits from GUI service. (gui.service.GUIService)

    """
    
    def __init__(self, **kwargs):

        # Init GUI Service
        super(CryptikChaosApp, self).__init__(**kwargs)
        
    def __del__(self):
        
        #Constructor calls
        super(CryptikChaosApp, self).__del__()
              
        
if __name__ == '__main__':
    
    from cryptikchaos.libs.utilities import run_kivy_app
    run_kivy_app(CryptikChaosApp)