Revision: 6456 http://trac.macosforge.org/projects/calendarserver/changeset/6456 Author: wsanchez@apple.com Date: 2010-10-22 15:12:40 -0700 (Fri, 22 Oct 2010) Log Message: ----------- pyflakes Modified Paths: -------------- CalendarServer/trunk/calendarserver/tap/caldav.py CalendarServer/trunk/calendarserver/tools/config.py CalendarServer/trunk/calendarserver/tools/export.py CalendarServer/trunk/calendarserver/tools/fixcalendardata.py CalendarServer/trunk/pyflakes CalendarServer/trunk/twext/python/filepath.py CalendarServer/trunk/twext/web2/dav/xattrprops.py CalendarServer/trunk/twistedcaldav/directory/opendirectorybacker.py CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipalmembers.py CalendarServer/trunk/twistedcaldav/extensions.py CalendarServer/trunk/twistedcaldav/localization.py CalendarServer/trunk/twistedcaldav/test/test_upgrade.py CalendarServer/trunk/txdav/base/datastore/subpostgres.py CalendarServer/trunk/txdav/caldav/datastore/index_file.py CalendarServer/trunk/txdav/caldav/resource.py CalendarServer/trunk/txdav/common/inotifications.py Modified: CalendarServer/trunk/calendarserver/tap/caldav.py =================================================================== --- CalendarServer/trunk/calendarserver/tap/caldav.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/calendarserver/tap/caldav.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -43,7 +43,7 @@ from twisted.python.reflect import namedClass from twisted.plugin import IPlugin from twisted.internet.defer import gatherResults -from twisted.internet import error, reactor +from twisted.internet import reactor from twisted.internet.reactor import addSystemEventTrigger from twisted.internet.process import ProcessExitedAlready from twisted.internet.protocol import Protocol, Factory Modified: CalendarServer/trunk/calendarserver/tools/config.py =================================================================== --- CalendarServer/trunk/calendarserver/tools/config.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/calendarserver/tools/config.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -24,11 +24,9 @@ import os, sys from getopt import getopt, GetoptError -from twistedcaldav import config from twistedcaldav.config import ConfigurationError from twistedcaldav.stdconfig import DEFAULT_CONFIG_FILE -from calendarserver.tools.util import UsageError from calendarserver.tools.util import loadConfig def usage(e=None): Modified: CalendarServer/trunk/calendarserver/tools/export.py =================================================================== --- CalendarServer/trunk/calendarserver/tools/export.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/calendarserver/tools/export.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -36,7 +36,6 @@ from getopt import getopt, GetoptError from os.path import dirname, abspath -from twistedcaldav import config from twistedcaldav.config import ConfigurationError from twistedcaldav.ical import Component as iComponent, Property as iProperty from twistedcaldav.ical import iCalendarProductID Modified: CalendarServer/trunk/calendarserver/tools/fixcalendardata.py =================================================================== --- CalendarServer/trunk/calendarserver/tools/fixcalendardata.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/calendarserver/tools/fixcalendardata.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -322,7 +322,7 @@ doFix = False # Parse command line options - opts, _ignore_args = getopt.getopt(sys.argv[1:], "f:ho:v", ["config", "scan", "fix", "help",]) + opts, _ignore_args = getopt.getopt(sys.argv[1:], "f:ho:", ["config", "scan", "fix", "help",]) for option, value in opts: if option in ("-h", "--help"): usage() @@ -332,8 +332,6 @@ usage("Path does not exist: %s" % (plistPath,)) elif option == "-o": scanPath = value - elif option == "-v": - verbose = True elif option == "--scan": doScan = True elif option == "--fix": Modified: CalendarServer/trunk/pyflakes =================================================================== --- CalendarServer/trunk/pyflakes 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/pyflakes 2010-10-22 22:12:40 UTC (rev 6456) @@ -9,7 +9,7 @@ export PYTHONPATH="${flakes}:${PYTHONPATH:-}"; if [ $# -eq 0 ]; then - set - calendarserver twistedcaldav twext txdav; + set - calendarserver twext twisted twistedcaldav txdav; fi; cd "${wd}" && "${flakes}/bin/pyflakes" "$@" | sed \ Modified: CalendarServer/trunk/twext/python/filepath.py =================================================================== --- CalendarServer/trunk/twext/python/filepath.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/twext/python/filepath.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -129,6 +129,7 @@ # Work with vanilla FilePath destinations to pacify the tests. if hasattr(destination, "changed"): destination.changed() + return result def remove(self): @@ -143,4 +144,4 @@ CachingFilePath.clonePath = CachingFilePath -__all__ = ['CachingFilePath'] +__all__ = ["CachingFilePath"] Modified: CalendarServer/trunk/twext/web2/dav/xattrprops.py =================================================================== --- CalendarServer/trunk/twext/web2/dav/xattrprops.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/twext/web2/dav/xattrprops.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -34,7 +34,6 @@ __all__ = ["xattrPropertyStore"] import urllib -import os import sys import zlib import errno Modified: CalendarServer/trunk/twistedcaldav/directory/opendirectorybacker.py =================================================================== --- CalendarServer/trunk/twistedcaldav/directory/opendirectorybacker.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/twistedcaldav/directory/opendirectorybacker.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -34,7 +34,6 @@ from os.path import join, abspath from tempfile import mkstemp, gettempdir from random import random -from urllib import unquote import opendirectory import dsattributes @@ -59,7 +58,6 @@ from twistedcaldav.directory.directory import DirectoryService, DirectoryRecord from twistedcaldav.ical import iCalendarProductID from twistedcaldav.memcachelock import MemcacheLock, MemcacheLockTimeoutError -from twistedcaldav.method.put_addressbook_common import StoreAddressObjectResource from twistedcaldav.query import addressbookqueryfilter from twistedcaldav.vcard import Component, Property Modified: CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipalmembers.py =================================================================== --- CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipalmembers.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipalmembers.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -21,7 +21,6 @@ from twistedcaldav.directory.directory import DirectoryService from twistedcaldav.test.util import xmlFile, augmentsFile, proxiesFile from twistedcaldav.directory.principal import DirectoryPrincipalProvisioningResource -from twistedcaldav.directory.xmlaccountsparser import XMLAccountsParser from twistedcaldav.directory.xmlfile import XMLDirectoryService import twistedcaldav.test.util Modified: CalendarServer/trunk/twistedcaldav/extensions.py =================================================================== --- CalendarServer/trunk/twistedcaldav/extensions.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/twistedcaldav/extensions.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -21,7 +21,7 @@ __all__ = [ "DAVResource", - "DAVResourceWithChildren", + "DAVResourceWithChildrenMixin", "DAVPrincipalResource", "DAVFile", "ReadOnlyWritePropertiesResourceMixIn", Modified: CalendarServer/trunk/twistedcaldav/localization.py =================================================================== --- CalendarServer/trunk/twistedcaldav/localization.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/twistedcaldav/localization.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -21,7 +21,6 @@ import os import struct import array -import codecs from locale import normalize from twext.python.log import Logger Modified: CalendarServer/trunk/twistedcaldav/test/test_upgrade.py =================================================================== --- CalendarServer/trunk/twistedcaldav/test/test_upgrade.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/twistedcaldav/test/test_upgrade.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -15,7 +15,7 @@ ## -from twisted.internet.defer import inlineCallbacks, returnValue +from twisted.internet.defer import inlineCallbacks from twext.web2.dav import davxml from twistedcaldav.config import config from twistedcaldav.directory.calendaruserproxy import ProxySqliteDB Modified: CalendarServer/trunk/txdav/base/datastore/subpostgres.py =================================================================== --- CalendarServer/trunk/txdav/base/datastore/subpostgres.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/txdav/base/datastore/subpostgres.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -14,26 +14,23 @@ # See the License for the specific language governing permissions and # limitations under the License. ## -import sys """ Run and manage PostgreSQL as a subprocess. """ import os import pwd -import thread +#import thread - from hashlib import md5 from twisted.python.procutils import which from twisted.internet.protocol import ProcessProtocol from twisted.python.reflect import namedAny -from twisted.python import log +from twext.python.log import Logger from twext.python.filepath import CachingFilePath - pgdb = namedAny("pgdb") from twisted.protocols.basic import LineReceiver @@ -42,6 +39,7 @@ from twisted.application.service import MultiService +log = Logger() # This appears in the postgres log to indicate that it is accepting # connections. @@ -71,6 +69,7 @@ def execute(self, sql, args=()): self.connectionWrapper.state = 'executing %r' % (sql,) +# Use log.debug # sys.stdout.write( # "Really executing SQL %r in thread %r\n" % # ((sql % tuple(args)), thread.get_ident()) @@ -84,6 +83,7 @@ def fetchall(self): results = self.realCursor.fetchall() +# Use log.debug # sys.stdout.write( # "Really fetching results %r thread %r\n" % # (results, thread.get_ident()) Modified: CalendarServer/trunk/txdav/caldav/datastore/index_file.py =================================================================== --- CalendarServer/trunk/txdav/caldav/datastore/index_file.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/txdav/caldav/datastore/index_file.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -42,7 +42,7 @@ from vobject.icalendar import utc -from twisted.internet.defer import maybeDeferred, succeed, inlineCallbacks +from twisted.internet.defer import maybeDeferred, succeed from twext.python.log import Logger, LoggingMixIn Modified: CalendarServer/trunk/txdav/caldav/resource.py =================================================================== --- CalendarServer/trunk/txdav/caldav/resource.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/txdav/caldav/resource.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -40,6 +40,7 @@ from twistedcaldav.caldavxml import caldav_namespace from twistedcaldav.config import config from twistedcaldav.extensions import DAVResource +from twistedcaldav.ical import allowedComponents class CalDAVResource(DAVResource, LoggingMixIn): Modified: CalendarServer/trunk/txdav/common/inotifications.py =================================================================== --- CalendarServer/trunk/txdav/common/inotifications.py 2010-10-22 22:12:06 UTC (rev 6455) +++ CalendarServer/trunk/txdav/common/inotifications.py 2010-10-22 22:12:40 UTC (rev 6456) @@ -24,7 +24,7 @@ __all__ = [ "INotificationCollection", - "INotification", + "INotificationObject", ] class INotificationCollection(Interface):