예제 #1
0
파일: app.py 프로젝트: thooth-inc/Mailpile
    def command(self):
        session, config = self.session, self.session.config

        session.interactive = True
        if sys.stdout.isatty() and sys.platform[:3] != "win":
            session.ui.term = ANSIColors()

        # Create and start the rest of the threads, load the index.
        if config.loaded_config:
            Load(session, '').run(quiet=True)
        else:
            config.prepare_workers(session, daemons=True)

        # Note: We do *not* update the MOTD on startup, to keep things
        #       fast, and to avoid leaking our IP on setup, before Tor
        #       has been configured.
        splash = HelpSplash(session, 'help', []).run()
        motd = MessageOfTheDay(session, 'motd', ['--noupdate']).run()
        session.ui.display_result(splash)
        print  # FIXME: This is a hack!
        session.ui.display_result(motd)

        Interact(session)

        return self._success(_('Ran interactive shell'))
예제 #2
0
파일: app.py 프로젝트: Ayzak/Mailpile
    def command(self):
        session, config = self.session, self.session.config

        session.interactive = True
        if sys.stdout.isatty() and sys.platform != "win32":
            session.ui.term = ANSIColors()

        # Create and start the rest of the threads, load the index.
        if config.loaded_config:
            Load(session, '').run(quiet=True)
        else:
            config.prepare_workers(session, daemons=True)

        session.ui.display_result(HelpSplash(session, 'help', []).run())
        Interact(session)

        return self._success(_('Ran interactive shell'))
예제 #3
0
파일: app.py 프로젝트: stwn/Mailpile
          if longn: longn += '='
        if shortn: shorta += shortn
        if longn: longa.append(longn.replace(' ', '_'))

      opts, args = getopt.getopt(args, shorta, longa)
      for opt, arg in opts:
        Action(session, opt.replace('-', ''), arg.decode('utf-8'))
      if args:
        Action(session, args[0], ' '.join(args[1:]).decode('utf-8'))

    except (getopt.GetoptError, UsageError), e:
      session.error(e)

    if not opts and not args:
      # Create and start the rest of the threads, load the index.
      session.interactive = session.ui.interactive = True
      config.prepare_workers(session, daemons=True)
      Load(session, '').run(quiet=True)
      session.ui.display_result(HelpSplash(session, 'help', []).run())
      Interact(session)

  except KeyboardInterrupt:
    pass

  finally:
    mailpile.util.QUITTING = True
    config.stop_workers()

if __name__ == "__main__":
  Main(sys.argv[1:])
예제 #4
0
파일: app.py 프로젝트: Ayzak/Mailpile
 def command(self):
     self.session.ui.display_result(
         HelpSplash(self.session, 'help', []).run(interactive=False))
     while not mailpile.util.QUITTING:
         time.sleep(1)
     return self._success(_('Did nothing much for a while'))