From e74eb1336611623e44ef6a7970488c7b8ccaa4eb Mon Sep 17 00:00:00 2001 From: William Grzybowski Date: Sat, 20 Sep 2014 15:19:34 +0000 Subject: www/calendarserver: Calendar and Contacts Server from Apple (RFC 4791, RFC 6352) The open source Calendar and Contacts Server project is a standards-compliant server implementing the CalDAV and CardDAV protocols (RFC 4791, RFC 6352). It provides a shared location on the network allowing multiple users to store and edit calendaring and contact information. WWW: http://www.calendarserver.org PR: 186201 (with changes) Submitted by: Axel.Rau Chaos1 de --- www/calendarserver/files/patch-twext_python_log.py | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 www/calendarserver/files/patch-twext_python_log.py (limited to 'www/calendarserver/files/patch-twext_python_log.py') diff --git a/www/calendarserver/files/patch-twext_python_log.py b/www/calendarserver/files/patch-twext_python_log.py new file mode 100644 index 000000000000..d33e79bd125f --- /dev/null +++ b/www/calendarserver/files/patch-twext_python_log.py @@ -0,0 +1,52 @@ +Index: twext/trunk/twext/python/log.py +=================================================================== +--- twext/python/log.py.orig 2013-09-17 23:08:55.000000000 +0000 ++++ twext/python/log.py 2014-01-22 09:29:56.000000000 +0000 +@@ -932,24 +932,29 @@ + # Don't patch this module + if moduleName is __name__: + continue +- +- for name, obj in module.__dict__.iteritems(): +- newLogger = Logger(namespace=module.__name__) +- legacyLogger = LegacyLogger(logger=newLogger) +- +- if obj is twisted.python.log: +- log.info("Replacing Twisted log module object {0} in {1}" +- .format(name, module.__name__)) +- setattr(module, name, legacyLogger) +- elif obj is twisted.python.log.msg: +- log.info("Replacing Twisted log.msg object {0} in {1}" +- .format(name, module.__name__)) +- setattr(module, name, legacyLogger.msg) +- elif obj is twisted.python.log.err: +- log.info("Replacing Twisted log.err object {0} in {1}" +- .format(name, module.__name__)) +- setattr(module, name, legacyLogger.err) +- ++ ++ try: ++ for name, obj in module.__dict__.iteritems(): ++ newLogger = Logger(namespace=module.__name__) ++ legacyLogger = LegacyLogger(logger=newLogger) ++ ++ if obj is twisted.python.log: ++ log.info("Replacing Twisted log module object {0} in {1}" ++ .format(name, module.__name__)) ++ setattr(module, name, legacyLogger) ++ elif obj is twisted.python.log.msg: ++ log.info("Replacing Twisted log.msg object {0} in {1}" ++ .format(name, module.__name__)) ++ setattr(module, name, legacyLogger.msg) ++ elif obj is twisted.python.log.err: ++ log.info("Replacing Twisted log.err object {0} in {1}" ++ .format(name, module.__name__)) ++ setattr(module, name, legacyLogger.err) ++ except (AttributeError, RuntimeError,): ++ # Can't look up __name__. A hack in the "six" module causes ++ # this. Skip the module. ++ # See https://trac.calendarserver.org/ticket/832 ++ continue + + + ###################################################################### -- cgit v1.2.3