def test_functionality(self):
     try:
         tuple_of_capas = e32.get_capabilities()
         db = calendar.open()
         print "No of entries is ", len(db)
         print "The time since the user is inactive: ", inactivity()
         if len(information) != 5:
             self.fail("Broken")
         if not len(get_capabilities()):
             self.fail("Broken")
         print "The log of calls are: ", calls()
     except:
         self.fail("Something is broken")
Exemple #2
0
    def __init__(self):
        self.connected = False
        self.service = False
        self.useCanvas = True
        self.client = None

        self.inbox = inbox.Inbox(inbox.EInbox)
        self.sent = inbox.Inbox(inbox.ESent)
        self.contactDb = contacts.open()
        self.calendarDb = calendar.open()
        self.currentMessage = None
        self.__partialMessage = ""

        #FIXME: I shouldn't need this
        e32.ao_sleep(1)
        self.inbox.bind(self.newMessage)
        #telephone.call_state(self.handleCall)

        self.initUi()
        self.startService()
Exemple #3
0
    def __init__(self):
        self.connected = False
        self.service = False
        self.useCanvas = True
        self.client = None

        self.inbox = inbox.Inbox(inbox.EInbox)
        self.sent = inbox.Inbox(inbox.ESent)
        self.contactDb = contacts.open()
        self.calendarDb = calendar.open()
        self.currentMessage = None
        self.__partialMessage = ""

        #FIXME: I shouldn't need this
        e32.ao_sleep(1)
        self.inbox.bind(self.newMessage)
        #telephone.call_state(self.handleCall)

        self.initUi()
        self.startService()
Exemple #4
0
def main():
    syncday = appuifw.query(u"The date to be uploaded",u"date",time())
    if syncday is None:
        appuifw.note(u"User Cancelled")
        return
    cal = calendar.open()
    entries = cal.daily_instances(syncday,appointments=1,events=1)
    if len(entries)>0:
        ap_names = []
        ap_list_of_dicts = socket.access_points()
        for item in ap_list_of_dicts:
            ap_names.append(item['name'])
        ap_offset = appuifw.popup_menu(ap_names, u"Select default access point")
        if ap_offset is None:
        	appuifw.note(u"Cancelled!")
        	return
        socket.set_default_access_point(ap_names[ap_offset])
        u=appuifw.query(u'email','text',u"@gmail.com")
        p=appuifw.query(u'password','code',u"")
        n=appuifw.query(u'username','text',u"")
        if u is None or p is None or n is None:
            appuifw.note(u"User Cancelled")
            return
        u=u.encode("utf8")
        p=p.encode("utf8")
        n=n.encode("utf8")
        feedloc = '/calendar/feeds/'+u+'/private/full'
        try:
        	auth = GoogleAuth( u, p )
        	sess = SessionUrl( auth, feedloc )
        	for entry in entries:
        		event = cal[entry['id']]
        		dict = dictFromS60Event(event)
        		entry = atomEntryFromDict(u,p,n,dict)
        		entry=entry.encode("utf8")
        		insertGcal(entry,sess,auth)
        		print "  Added : " + event.content
        	print "OK"
        except Exception,msg:
        	#print msg
        	appuifw.note(u"Error")
Exemple #5
0
    def __init__(self):
        self.connected = False
        self.service = False
        self.useCanvas = True
        self.client = None
        self.port = PORT

        self.loadConfig()
        self.initUi()

        self.inbox = inbox.Inbox(inbox.EInbox)
        self.sent = inbox.Inbox(inbox.ESent)
        self.contactDb = contacts.open()
        self.calendarDb = calendar.open()
        self.currentMessage = None
        self.__partialMessage = ""

        self.inbox.bind(self.newMessage)
        # telephone.call_state(self.handleCall)

        self.startService()
Exemple #6
0
    def tearDown(self):
        self.db = e32calendar.open('c:cal_test_db.cdb', 'c')

        for id in self.db:
            del self.db[id]
        del self.db
Exemple #7
0
 def setUp(self):
     self.db = e32calendar.open('c:cal_test_db.cdb', 'n')
# Copyright (c) 2008 Nokia Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import e32calendar as calendar
import thread
import e32


def kill_reference(ref):
    print "Killing reference:"
    e32.ao_sleep(1)
    ref = None
    print "Killed reference."
    e32.ao_sleep(1)


thread.start_new_thread(kill_reference, (calendar.open(), ))
print "Started reference killer thread."
Exemple #9
0
import e32calendar, appuifw

# Open database
db = e32calendar.open()

# Create an appointment entry
appointment = db.add_appointment()

# Add the regular information
appointment.content = appuifw.query(u"Enter subject", "text")
appointment.location = appuifw.query(u"Enter location", "text")

# Ask the user for the start and end time
t1 = appuifw.query(u"Enter start hour", "time")
d1 = appuifw.query(u"Enter start date", "date")
t2 = appuifw.query(u"Enter end hour", "time")
d2 = appuifw.query(u"Enter end date", "date")
 
start_time = t1 + d1
end_time = t2 + d2
 
# Set the start and end time
appointment.set_time(start_time, end_time)
 
# Save the entry
appointment.commit()