hi,
Actually i am using windows with python2.5. Here is my code. If I
tried to import gdata.calendar.service it is showing that error No
module named gdata.calendar.service
i just kept this code in gdata.py-1.1.1 and executing
try:
from xml.etree import ElementTree
except ImportError:
from elementtree import ElementTree
import gdata.calendar.service
import gdata.service
import atom.service
import gdata.calendar
##import atom
##import getopt
##import sys
##import string
import cgi, sys
import cgitb; cgitb.enable() # for troubleshooting
import time
##print "Content-type: text/html"
##
##print """
## <html>
##
## <head><title>Sample Script</title></head>
##
## <body>
##
## <h3> Sample CGI Script </h3>
## """
sys.stderr = sys.stdout
html = """
<p>Previous message : %s</p>
<p> Time is %s</p>
<p> PWD is %s</p>
<form action="" method="post">
Enter the User name : <input type="text" name="message"><br/>
Enter the Password : <input type="password" name="age">
Select a value :
<select name="dropdown>
<option value="RED">red</option>
<option value="ORANGE">orange</option>
<option value="BLUE">blue</option>
</select>
<input type="submit" value="Submit">
</form>
</body>
</html>
"""
class CalendarExample:
def __init__(self):
print 'In Class'
print "You're talking to a %s server." % (sys.platform)
## print "Version is %s " % (sys.version)
## print "<br/>Path is %s" % (sys.path)
def login(self, email, password):
"""Creates a CalendarService and provides ClientLogin auth details
to it.
The email and password are required arguments for ClientLogin.
The
CalendarService automatically sets the service to be 'cl', as is
appropriate for calendar. The 'source' defined below is an
arbitrary
string, but should be used to reference your name or the name of
your
organization, the app name and version, with '-' between each of
the three
values. The account_type is specified to authenticate either
Google Accounts or Google Apps accounts. See gdata.service or
http://code.google.com/apis/accounts/AuthForInstalledApps.html for
more
info on ClientLogin. NOTE: ClientLogin should only be used for
installed
applications and not for multi-user web applications."""
print "<h1>Hello</h1>"
print "<p>Id is %s " % (email,)
self.cal_client = gdata.calendar.service.CalendarService()
self.cal_client.email = email
self.cal_client.password = password
self.cal_client.source = 'Google-Calendar_Python_Sample-1.0'
self.cal_client.ProgrammaticLogin()
def main():
form = cgi.FieldStorage()
message = form.getvalue("message", "")
age = form.getvalue("age", "")
now = time.gmtime()
displayedtime = time.strftime("%A %d %B %Y, %X", now)
contentheader = "Content-type: text/html"
print contentheader
print html % (message, displayedtime, age)
sample = CalendarExample()
sample.login(message, age)
if __name__ == '__main__':
# print '\n Main If condition'
main()
may be i need to add any files
thanks
regards,
moparthi
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---