@@ -0,0 +1,3083 @@
+#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0Aimport requests%0A%0Afrom SakaiPy import RequestHandler%0Afrom SakaiPy.SakaiTools import SakaiSite, Announcement, Assignment, Calendar, Content, Forums, Gradebook, News%0A%0AloginURL = %22/direct/session?_username=%7B0%7D&_password=%7B1%7D%22%0A%0Asession = requests.Session()%0A%0A%0Aclass SakaiPy(object):%0A    %22%22%22%0A    The main entry point for the program. Use this class to access all of the other tools.%0A    %22%22%22%0A%0A    def __init__(self, connectioninfo):%0A        %22%22%22%0A        Create the main SakaiPy object. All logic for the program flows through this object%0A        :param connectioninfo: A dict containin the connection/credential information neccsary to authenticate the user.%0A        :return: A SakaiPy object%0A        %22%22%22%0A%0A        %22%22%22Generate the session cookie%22%22%22%0A        self.baseURL = connectioninfo%5B'baseURL'%5D%0A%0A        # Generate a session cookie & store it in the requesting session%0A        session.post(self.baseURL + loginURL.format(%0A            connectioninfo%5B'username'%5D,%0A            connectioninfo%5B'password'%5D%0A        ))%0A%0A        self.requester = RequestHandler.RequestHandler(session, self.baseURL)%0A%0A    def getSakaiSite(self, siteid):%0A        %22%22%22%0A        Generate and return a SakaiSite object%0A        :param siteid: The id of the site.%0A        :return: A SakaiSite object%0A        %22%22%22%0A        return SakaiSite.SakaiSite(self.requester, siteid)%0A%0A    def getAnnouncementObject(self):%0A        %22%22%22%0A        Generate and return an Announcement object for the current user.%0A        :return: An announcement object for the currently logged in user.%0A        %22%22%22%0A        return Announcement.Announcement(self.requester)%0A%0A    def getAssignmentObject(self):%0A        %22%22%22%0A        Generate and return an Assignment object for the current user.%0A        :return: An assignment object for the currently logged in user.%0A        %22%22%22%0A        return Assignment.Assignment(self.requester)%0A%0A    def getCalendarObject(self):%0A        %22%22%22%0A        Generate and return a Calendar object for the current user.%0A        :return: A calendar object for the currently logged in user.%0A        %22%22%22%0A        return Calendar.Calendar(self.requester)%0A%0A    def getContentObject(self):%0A        %22%22%22%0A        Generate and return a Content object for the current user.%0A        :return: A content object for the currently logged in user.%0A        %22%22%22%0A        return Content.Content(self.requester)%0A%0A    def getForumsObject(self):%0A        %22%22%22%0A        Generate and return a Forums object for the current user.%0A        :return: A Forums object for the currently logged in user.%0A        %22%22%22%0A        return Forums.Forums(self.requester)%0A%0A    def getGradebookObject(self):%0A        %22%22%22%0A        Generate and return a Gradebook object for the current user.%0A        :return: A Gradebook object for the currently logged in user.%0A        %22%22%22%0A        return Gradebook.Gradebook(self.requester)%0A%0A    def getNewsObject(self):%0A        %22%22%22%0A        Generate and return a News object for the current user.%0A        :return: A News object for the currently logged in user.%0A        %22%22%22%0A        return News.News(self.requester)%0A

Create SakaiPy class. This is the entry point for the program now.