def interactive():
        from sr_automation.utils.TimeIt import TimeIt
        from sr_automation.platform.sunriver.Sunriver import Sunriver
        from sr_automation.platform.sunriver.applications.IMAPApp.IMAPApp import IMAPApp
        sunriver = Sunriver()
        sunriver.desktop.start()
        imap = IMAPApp(sunriver)
        imap.start()


        calendar = LinuxCalendar(sunriver.linux)
        import IPython
        IPython.embed()

        imap.stop()
        sunriver.desktop.stop()
Beispiel #2
0
    def send(account_email, to, subject, body):
        """
        python Mail.py send --account_email="*****@*****.**" --to="*****@*****.**" --subject="subject test" --body="body test"
        """
        from sr_automation.utils.TimeIt import TimeIt
        from sr_automation.platform.sunriver.Sunriver import Sunriver
        from sr_automation.platform.sunriver.applications.IMAPApp.IMAPApp import IMAPApp
        sunriver = Sunriver()
        sunriver.desktop.start()
        imap = IMAPApp(sunriver)
        imap.start()

        mail = LinuxMail(sunriver.linux)
        mail.choose_email(account_email).choose_folder("inbox")
        mail.send( to = to
                 , subject = subject
                 , body = body
                 )

        imap.stop()
        sunriver.stop()
Beispiel #3
0
    def interactive(account_email):
        """
        python Mail.py interactive --account_email="*****@*****.**"
        """
        from sr_automation.utils.TimeIt import TimeIt
        from sr_automation.platform.sunriver.Sunriver import Sunriver
        from sr_automation.platform.sunriver.applications.IMAPApp.IMAPApp import IMAPApp
        sunriver = Sunriver()
        sunriver.desktop.start()
        imap = IMAPApp(sunriver)
        imap.start()

        mail = LinuxMail(sunriver.linux)
        t = TimeIt()
        with t.measure():
            mail.choose_email(account_email).choose_folder("inbox").load()
        print t.measured

        import IPython
        IPython.embed()

        imap.stop()
        sunriver.stop()