[CalendarServer-changes] [4947] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Jan 20 15:55:05 PST 2010


Revision: 4947
          http://trac.macosforge.org/projects/calendarserver/changeset/4947
Author:   wsanchez at apple.com
Date:     2010-01-20 15:55:03 -0800 (Wed, 20 Jan 2010)
Log Message:
-----------
Use latest Pyflakes.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/provision/root.py
    CalendarServer/trunk/calendarserver/sidecar/task.py
    CalendarServer/trunk/calendarserver/tools/principals.py
    CalendarServer/trunk/calendarserver/tools/warmup.py
    CalendarServer/trunk/calendarserver/webadmin/resource.py
    CalendarServer/trunk/support/build.sh
    CalendarServer/trunk/twext/internet/tcp.py
    CalendarServer/trunk/twistedcaldav/directory/apache.py
    CalendarServer/trunk/twistedcaldav/directory/resourceinfo.py
    CalendarServer/trunk/twistedcaldav/directory/xmlfile.py
    CalendarServer/trunk/twistedcaldav/dropbox.py
    CalendarServer/trunk/twistedcaldav/extensions.py
    CalendarServer/trunk/twistedcaldav/ical.py
    CalendarServer/trunk/twistedcaldav/mail.py
    CalendarServer/trunk/twistedcaldav/notify.py
    CalendarServer/trunk/twistedcaldav/test/test_index.py
    CalendarServer/trunk/twistedcaldav/test/test_mkcalendar.py

Modified: CalendarServer/trunk/calendarserver/provision/root.py
===================================================================
--- CalendarServer/trunk/calendarserver/provision/root.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/calendarserver/provision/root.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -15,7 +15,6 @@
 ##
 
 __all__ = [
-    "RootACLMixIn",
     "RootResource",
 ]
 

Modified: CalendarServer/trunk/calendarserver/sidecar/task.py
===================================================================
--- CalendarServer/trunk/calendarserver/sidecar/task.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/calendarserver/sidecar/task.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -16,9 +16,10 @@
 from __future__ import with_statement
 
 __all__ = [
-    "CalDAVService",
-    "CalDAVOptions",
-    "CalDAVServiceMaker",
+    "CalDAVTaskService",
+    "CalDAVTaskServiceMaker",
+    "CalDAVTaskOptions",
+    "Task",
 ]
 
 from calendarserver.provision.root import RootResource
@@ -117,8 +118,7 @@
     originator = LocalCalendarUser(originator, originatorPrincipal)
     recipients = (owner,)
     scheduler = DirectScheduler(FakeRequest(rootResource, "PUT"), inboxItemFile)
-    result = (yield scheduler.doSchedulingViaPUT(originator, recipients,
-        calendar, internal_request=False))
+    yield scheduler.doSchedulingViaPUT(originator, recipients, calendar, internal_request=False)
 
     if os.path.exists(inboxItemFile.fp.path):
         os.remove(inboxItemFile.fp.path)
@@ -365,8 +365,6 @@
         #
         # Setup the Directory
         #
-        directories = []
-
         directoryClass = namedClass(config.DirectoryService.type)
 
         self.log_info("Configuring directory service of type: %s"

Modified: CalendarServer/trunk/calendarserver/tools/principals.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/principals.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/calendarserver/tools/principals.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -494,8 +494,6 @@
 
     print ""
 
-    resource = None
-
     for opt, arg in optargs:
 
         if opt in ("-s", "--search",):

Modified: CalendarServer/trunk/calendarserver/tools/warmup.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/warmup.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/calendarserver/tools/warmup.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -81,7 +81,6 @@
         usage(e)
 
     configFileName = None
-    outputFileName = None
 
     calendarHomes = set()
     records = set()
@@ -168,7 +167,7 @@
                 child = calendarCollection.getChild(name)
 
                 #sys.stdout.write("+")
-                childCalendar = child.iCalendarText()
+                child.iCalendarText()
 
                 readProperties(child)
 
@@ -180,7 +179,7 @@
 def readProperties(resource):
     #sys.stdout.write("-")
     for qname in resource.deadProperties().list():
-        property = resource.readDeadProperty(qname)
+        resource.readDeadProperty(qname)
         #sys.stdout.write(".")
 
 if __name__ == "__main__":

Modified: CalendarServer/trunk/calendarserver/webadmin/resource.py
===================================================================
--- CalendarServer/trunk/calendarserver/webadmin/resource.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/calendarserver/webadmin/resource.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -154,7 +154,7 @@
             # Update the auto-schedule value if specified.
             if autoSchedule is not None and (autoSchedule == "true" or autoSchedule == "false"):
                 if principal.record.recordType != "users" and principal.record.recordType != "groups":
-                    result = (yield principal.setAutoSchedule(autoSchedule == "true"))
+                    (yield principal.setAutoSchedule(autoSchedule == "true"))
 
             # Update the proxies if specified.
             for proxyId in removeProxies:
@@ -263,7 +263,7 @@
         if davPropertyName:
             try:
                 namespace, name = davPropertyName.split("#")
-            except Exception, e:
+            except Exception:
                 propertyHtml += "<div>Unable to parse property to read: <b>%s</b></div>" % davPropertyName
 
             result = (yield resource.readProperty((namespace, name), None))

Modified: CalendarServer/trunk/support/build.sh
===================================================================
--- CalendarServer/trunk/support/build.sh	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/support/build.sh	2010-01-20 23:55:03 UTC (rev 4947)
@@ -332,7 +332,6 @@
 
 # Declare a dependency on a Python project.
 py_dependency () {
-
   # args
   local            name="$1"; shift; # the name of the package (for display)
   local          module="$1"; shift; # the name of the python module.
@@ -349,9 +348,9 @@
   local        skip_egg="$1"; shift; # skip even the 'egg_info' step, because nothing
                                      # needs to be built.
   local        revision="$1"; shift; # what revision to check out (for SVN dependencies)
-  # end args
-  local          srcdir="${top}/${distribution}"
 
+  local srcdir="${top}/${distribution}"
+
   if "${override_system}" || ! py_have_module "${module}"; then
     "${get_type}_get" "${name}" "${srcdir}" "${get_uri}" "${revision}"
     if "${inplace}"; then
@@ -372,9 +371,9 @@
   fi;
 
   if "$inplace"; then
-    local  add_path="${srcdir}";
+    local add_path="${srcdir}";
   else
-    local  add_path="${srcdir}/build/${py_platform_libdir}";
+    local add_path="${srcdir}/build/${py_platform_libdir}";
   fi;
   export PYTHONPATH="${PYTHONPATH}:${add_path}";
 }
@@ -415,8 +414,11 @@
 # or, it may do as much as download and install all dependencies.
 dependencies () {
 
+  #
+  # Dependencies compiled from C source code
+  #
+
   if ! type memcached > /dev/null 2>&1; then
-    # Dependencies compiled from C source code
     local le="libevent-1.4.8-stable";
     c_dependency "libevent" "${le}" \
       "http://monkey.org/~provos/libevent-1.4.8-stable.tar.gz";
@@ -425,7 +427,17 @@
       --enable-threads --with-libevent="${top}/${le}/_root";
   fi;
 
+  if ! type postgres > /dev/null 2>&1; then
+    c_dependency "PostgreSQL" "postgresql-8.4.2" \
+      "http://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/v8.4.2/postgresql-8.4.2.tar.gz" \
+      --with-python;
+    :;
+  fi;
+
+  #
   # Python dependencies
+  #
+
   py_dependency "Zope Interface" "zope.interface" "zope.interface-3.3.0" \
     "www" "http://www.zope.org/Products/ZopeInterface/3.3.0/zope.interface-3.3.0.tar.gz" \
     false false false false 0;
@@ -454,17 +466,8 @@
       true false false false 0;
   fi;
 
-  case "${USER}" in
-    wsanchez)
-      proto="svn+ssh";
-      ;;
-    *)
-      proto="svn";
-      ;;
-  esac;
-
   py_dependency "Twisted" "twisted" "Twisted" \
-    "svn" "${proto}://svn.twistedmatrix.com/svn/Twisted/branches/dav-take-two-3081-4" \
+    "svn" "svn://svn.twistedmatrix.com/svn/Twisted/branches/dav-take-two-3081-4" \
     false true true false 27622;
 
   # twisted.web2 doesn't get installed by default, so in the install phase
@@ -497,7 +500,7 @@
 
   # Tool dependencies.  The code itself doesn't depend on these, but you probably want them.
   svn_get "CalDAVTester" "${top}/CalDAVTester" "${svn_uri_base}/CalDAVTester/trunk" 4912;
-  svn_get "Pyflakes" "${top}/Pyflakes" http://divmod.org/svn/Divmod/trunk/Pyflakes 17198;
+  svn_get "Pyflakes" "${top}/Pyflakes" http://divmod.org/svn/Divmod/trunk/Pyflakes HEAD;
 }
 
 

Modified: CalendarServer/trunk/twext/internet/tcp.py
===================================================================
--- CalendarServer/trunk/twext/internet/tcp.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/twext/internet/tcp.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -19,10 +19,8 @@
 """
 
 __all__ = [
-    "InheritedPort",
-    "InheritedSSLPort",
-    "InheritTCPServer",
-    "InheritSSLServer",
+    "MaxAcceptTCPServer",
+    "MaxAcceptSSLServer",
 ]
 
 from OpenSSL import SSL
@@ -35,22 +33,29 @@
 
 
 class MaxAcceptPortMixin(object):
-    """ Mixin for resetting maxAccepts """
-
+    """
+    Mixin for resetting maxAccepts.
+    """
     def doRead(self):
         self.numberAccepts = min(self.factory.maxRequests - self.factory.outstandingRequests, self.factory.maxAccepts)
         tcp.Port.doRead(self)
 
 class MaxAcceptTCPPort(MaxAcceptPortMixin, tcp.Port):
-    """ Use for non-inheriting tcp ports """
+    """
+    Use for non-inheriting tcp ports.
+    """
     pass
 
 class MaxAcceptSSLPort(MaxAcceptPortMixin, ssl.Port):
-    """ Use for non-inheriting SSL ports """
+    """
+    Use for non-inheriting SSL ports.
+    """
     pass
 
 class InheritedTCPPort(MaxAcceptTCPPort):
-    """ A tcp port which uses an inherited file descriptor """
+    """
+    A tcp port which uses an inherited file descriptor.
+    """
 
     def __init__(self, fd, factory, reactor):
         tcp.Port.__init__(self, 0, factory, reactor=reactor)
@@ -72,7 +77,9 @@
 
 
 class InheritedSSLPort(InheritedTCPPort):
-    """ An SSL port which uses an inherited file descriptor """
+    """
+    An SSL port which uses an inherited file descriptor.
+    """
 
     _socketShutdownMethod = 'sock_shutdown'
 
@@ -88,9 +95,10 @@
         return tcp.Port._preMakeConnection(self, transport)
 
 class MaxAcceptTCPServer(internet.TCPServer):
-    """ TCP server which will uses MaxAcceptTCPPorts (and optionally,
-        inherited ports)
     """
+    TCP server which will uses MaxAcceptTCPPorts (and optionally,
+    inherited ports)
+    """
 
     def __init__(self, *args, **kwargs):
         internet.TCPServer.__init__(self, *args, **kwargs)
@@ -112,9 +120,10 @@
         return port
 
 class MaxAcceptSSLServer(internet.SSLServer):
-    """ SSL server which will uses MaxAcceptSSLPorts (and optionally,
-        inherited ports)
     """
+    SSL server which will uses MaxAcceptSSLPorts (and optionally,
+    inherited ports)
+    """
 
     def __init__(self, *args, **kwargs):
         internet.SSLServer.__init__(self, *args, **kwargs)

Modified: CalendarServer/trunk/twistedcaldav/directory/apache.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/apache.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/twistedcaldav/directory/apache.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -129,7 +129,7 @@
 
         try:
             handle = recordFile.open()
-        except IOError, OSError:
+        except (IOError, OSError):
             self.log_error("Auth file (for %s) not found: %s" % (recordType, recordFile.path))
             return
 

Modified: CalendarServer/trunk/twistedcaldav/directory/resourceinfo.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/resourceinfo.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/twistedcaldav/directory/resourceinfo.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -76,7 +76,7 @@
         self.setAutoScheduleInDatabase(guid, autoSchedule)
 
         # Update cache
-        _ignore = (yield self._memcacher.setAutoSchedule(guid, autoSchedule))
+        (yield self._memcacher.setAutoSchedule(guid, autoSchedule))
 
     def setAutoScheduleInDatabase(self, guid, autoSchedule):
         """
@@ -104,7 +104,7 @@
             autoSchedule = self._db_value_for_sql("select AUTOSCHEDULE from RESOURCEINFO where GUID = :1", guid)
             if autoSchedule is not None:
                 autoSchedule = autoSchedule == 1
-                result = (yield self._memcacher.setAutoSchedule(guid, autoSchedule))
+                (yield self._memcacher.setAutoSchedule(guid, autoSchedule))
         returnValue(autoSchedule)
 
     def _add_to_db(self, guid, autoSchedule):

Modified: CalendarServer/trunk/twistedcaldav/directory/xmlfile.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/xmlfile.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/twistedcaldav/directory/xmlfile.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -116,7 +116,7 @@
                         return True
                 elif matchType == 'contains':
                     try:
-                        _ignore_discard = testValue.index(value)
+                        testValue.index(value)
                         return True
                     except ValueError:
                         pass

Modified: CalendarServer/trunk/twistedcaldav/dropbox.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/dropbox.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/twistedcaldav/dropbox.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -21,7 +21,6 @@
 __all__ = [
     "DropBoxHomeResource",
     "DropBoxCollectionResource",
-    "DropBoxChildResource",
 ]
 
 from twext.web2.dav.davxml import ErrorResponse

Modified: CalendarServer/trunk/twistedcaldav/extensions.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/extensions.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/twistedcaldav/extensions.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -26,7 +26,7 @@
     "DAVFile",
     "ReadOnlyWritePropertiesResourceMixIn",
     "ReadOnlyResourceMixIn",
-    "CachingXattrPropertyStore",
+    "CachingPropertyStore",
 ]
 
 import cPickle as pickle

Modified: CalendarServer/trunk/twistedcaldav/ical.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/ical.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/twistedcaldav/ical.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -1242,8 +1242,8 @@
         timezone_refs    = set()
         timezones        = set()
         got_master       = False
-        got_override     = False
-        master_recurring = False
+       #got_override     = False
+       #master_recurring = False
         
         for subcomponent in self.subcomponents():
             # Disallowed in CalDAV-Access-08, section 4.1
@@ -1291,9 +1291,10 @@
                         raise ValueError(msg)
                     else:
                         got_master = True
-                        master_recurring = subcomponent.hasProperty("RRULE") or subcomponent.hasProperty("RDATE")
+                        # master_recurring =
+                        subcomponent.hasProperty("RRULE") or subcomponent.hasProperty("RDATE")
                 else:
-                    got_override = True
+                    pass # got_override = True
                             
                 # Check that if an override is present then the master is recurring
                 # Leopard iCal sometimes does this for overridden instances that an Attendee receives and
@@ -1301,6 +1302,7 @@
                 # scheduling with verify the validity of the components and raise if they don't make sense.
                 # If no scheduling is happening then we allow this - that may cause other clients to choke.
                 # If it does we will have to reinstate this check but only after we have checked for implicit.
+# UNCOMMENT OUT master_recurring AND got_override ASSIGNMENTS ABOVE
 #                if got_override and got_master and not master_recurring:
 #                    msg = "Calendar resources must have a recurring master component if there is an overridden one (%s)" % (subcomponent.propertyValue("UID"),)
 #                    log.debug(msg)

Modified: CalendarServer/trunk/twistedcaldav/mail.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/mail.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/twistedcaldav/mail.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -608,7 +608,6 @@
         )
 
         # Authenticated /inbox
-        credentialFactories = []
         portal = Portal(auth.DavRealm())
         portal.registerChecker(directory)
         realm = directory.realmName or ""
@@ -652,7 +651,7 @@
     def checkDSN(self, message):
         # returns (isDSN, Action, icalendar attachment)
 
-        report = deliveryStatus = original = calBody = None
+        report = deliveryStatus = calBody = None
 
         for part in message.walk():
             content_type = part.get_content_type()
@@ -663,7 +662,7 @@
                 deliveryStatus = part
                 continue
             elif content_type == "message/rfc822":
-                original = part
+                #original = part
                 continue
             elif content_type == "text/calendar":
                 calBody = part.get_payload(decode=True)

Modified: CalendarServer/trunk/twistedcaldav/notify.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/notify.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/twistedcaldav/notify.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -641,8 +641,7 @@
             publishElement['node'] = nodeName
             if self.settings["NodeConfiguration"]["pubsub#deliver_payloads"] == '1':
                 itemElement = publishElement.addElement('item')
-                payloadElement = itemElement.addElement('plistfrag',
-                    defaultUri='plist-apple')
+                itemElement.addElement('plistfrag', defaultUri='plist-apple')
 
             self.sendDebug("Publishing (%s)" % (nodeName,), iq)
             d = iq.send(to=self.settings['ServiceAddress'])

Modified: CalendarServer/trunk/twistedcaldav/test/test_index.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_index.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/twistedcaldav/test/test_index.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -776,7 +776,7 @@
     
             try:
                 instances = calendar.expandTimeRanges(expand, ignoreInvalidInstances=reCreate)
-            except InvalidOverriddenInstanceError, e:
+            except InvalidOverriddenInstanceError:
                 raise
     
             self._delete_from_db(name, uid, None)

Modified: CalendarServer/trunk/twistedcaldav/test/test_mkcalendar.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_mkcalendar.py	2010-01-20 21:00:02 UTC (rev 4946)
+++ CalendarServer/trunk/twistedcaldav/test/test_mkcalendar.py	2010-01-20 23:55:03 UTC (rev 4947)
@@ -157,7 +157,6 @@
         Make calendar with no parent
         """
         uri  = "/no/parent/for/calendar"
-        path = os.path.join(self.docroot, uri[1:])
 
         def do_test(response):
             response = IResponse(response)
@@ -214,7 +213,6 @@
                     self.fail("Incorrect response to nested MKCALENDAR: %s" % (response.code,))
 
             nested_uri  = os.path.join(first_uri, "nested")
-            nested_path = os.path.join(self.docroot, nested_uri[1:])
 
             request = SimpleRequest(self.site, "MKCALENDAR", nested_uri)
             self.send(request, do_test)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100120/324dfb86/attachment-0001.html>


More information about the calendarserver-changes mailing list