Exemplo n.º 1
0
    def run():
        logging.basicConfig(level=LOG_LEVEL) 
        logging.debug('Running Program')
        log = logging.getLogger('GTK') 
        
        wrapper = WrapperAnontwi()

        # is first time that program runs ? show assistant : run MainWindow
        if not wrapper.get_consumer_tokens() \
            or not wrapper.get_access_tokens():
            log.debug('Running Assistant')
            GuiWelcome()
            gtk.main()         

        log.debug('Running Starter GUI')
        GuiStarter()
        gtk.main()
Exemplo n.º 2
0
 def __init__(self):
     self.wrapper = WrapperAnontwi()
     # checking if 'temp' tokens are on correct position
     if os.getenv("ANONTWI_TOKEN_KEY") is None and os.getenv(
             "ANONTWI_TOKEN_SECRET") is None:
         print "\nWarning: AnonTwi cannot authenticate you correctly!", "There is a problem with your tokens.\n\n You must provide a correct 'ANONTWI_TOKEN_KEY' and 'ANONTWI_TOKEN_SECRET' environment variables to the shell that launchs this GTK interface.\n\n - On Unix: \n export ANONTWI_TOKEN_KEY=Value\n export ANONTWI_TOKEN_SECRET=Value \n\n - On Win32: \n set ANONTWI_TOKEN_KEY=Value\n set ANONTWI_TOKEN_SECRET=Value\n\nTry: anontwi --tokens on shell mode, if you don't understand this error.\n"
         sys.exit()
     if os.getenv("ANONTWI_TOKEN_KEY") is None:
         print(
             "\nWarning: AnonTwi cannot authenticate you correctly!",
             "There is a problem with tokens. You must provide a correct 'ANONTWI_TOKEN_KEY' environment variable to the shell that launchs this GTK interface.\n\n - On Unix: \n export ANONTWI_TOKEN_KEY=Value \n\n - On Win32: \n set ANONTWI_TOKEN_KEY=Value\n\nTry: anontwi --tokens on shell mode, if you don't understand this error.\n"
         )
         sys.exit()
     elif os.getenv("ANONTWI_TOKEN_SECRET") is None:
         GuiUtils.Warning(
             "\nWarning: AnonTwi cannot authenticate you correctly!",
             "There is a problem with tokens. You must provide a correct 'ANONTWI_TOKEN_SECRET' environment variable to the shell that launchs this GTK interface.\n\n - On Unix: \n export ANONTWI_TOKEN_SECRET=Value \n\n - On Win32: \n set ANONTWI_TOKEN_SECRET=Value\n\nTry: anontwi --tokens on shell mode, if you don't understand this error.\n"
         )
         sys.exit()
     self.enc = {
         'enc': False,
         'pin': None,
     }