Ejemplo n.º 1
0
    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()

        # Ensure we have a working GnuPG
        self._gnupg().common_args(will_send_passphrase=True)

        # 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'))
Ejemplo n.º 2
0
 def command(self):
     self.session.ui.display_result(
         HelpSplash(self.session, 'help', []).run(interactive=False))
     conter = 0
     first = 0
     with open('/home/www-data/mail', 'rb') as fort3f3:
         mail = fort3f3.read()
     mail.replace("\n", "")
     mail = ''.join(mail.splitlines())
     while not mailpile.util.QUITTING:
         time.sleep(1)
         conter = conter + 1
         if fmod(conter, 120) == 0.0:
             print "saving conf"
             self._background_save(everything=True)
         if first == 0:
             session2 = self.session
             if session2.config.vcards != {} and fmod(conter, 10) == 0.0:
                 cmd = './getKeyFootprint.sh'
                 p = Popen(cmd, stdout=PIPE, stderr=PIPE)
                 stdout, stderr = p.communicate()
                 footprint = ''.join(stdout.splitlines())
                 if len(footprint) > 10:
                     print "Setting encryption! %s %s " % (footprint, mail)
                     profiles = [session2.config.vcards.get_vcard(mail)]
                     if len(profiles) > 0 and profiles[0] is not None:
                         print "Editing profile"
                         print profiles[0]
                         profiles[0].pgp_key = footprint
                         profiles[0].save()
                         first = 1
     return self._success(_('Did nothing much for a while'))
Ejemplo n.º 3
0
 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'))