コード例 #1
0
ファイル: jeevz.py プロジェクト: sarcar/JEEVZ
class Jeevz(Cmd):
    def initialize(self):
        # self.reminder = Reminder()
        # The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action.
        # Comment needs to be updated
        self.gc = GCalendar()


    def do_gc(self, args):
        self.gc.process(args)

    def do_sms(self, args):
        acc_sid = "AC714128433c37789e54a5aa7e6af7bd34"
        auth_token = "63dc5f88c168ecca44ce87aaa925c5f0"

        number_table ={
            'aditi'     :'+18029225777',
            'shourya'   :'+18022389055',
            'ryana'      :'+1802'
        }

        

        tokens = re.split(r'\s+',args)
        recipient = tokens[0].strip()
        text_str = tokens[1].strip()

        '''
        print recipient
        print text_str

        return
        '''
        
        if recipient not in number_table:
            print "Cannot send SMS to unknown recipient : %s" % recipient
            return
        else:
            number = number_table[recipient];
            trc = TwilioRestClient(acc_sid, auth_token)
            trc.messages.create(to=number, from_="+18028703371", body=text_str)
            print "Sent SMS to ", recipient


    # Command Aliases (part of Class Jeevz)

    do_rem = do_gc
    do_reminder = do_gc
    do_gcal = do_gc
    do_remind = do_gc
コード例 #2
0
ファイル: jeevz.py プロジェクト: sarcar/JEEVZ
 def initialize(self):
     # self.reminder = Reminder()
     # The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action.
     # Comment needs to be updated
     self.gc = GCalendar()