[CalendarServer-changes] [15276] CalendarServer/branches/users/cdaboo/update-packages

source_changes at macosforge.org source_changes at macosforge.org
Mon Nov 2 13:50:00 PST 2015


Revision: 15276
          http://trac.calendarserver.org//changeset/15276
Author:   cdaboo at apple.com
Date:     2015-11-02 13:50:00 -0800 (Mon, 02 Nov 2015)
Log Message:
-----------
No more twisted.python.hashlib.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/update-packages/twistedcaldav/storebridge.py
    CalendarServer/branches/users/cdaboo/update-packages/txdav/base/datastore/file.py
    CalendarServer/branches/users/cdaboo/update-packages/txdav/caldav/datastore/sql.py
    CalendarServer/branches/users/cdaboo/update-packages/txdav/caldav/datastore/test/common.py
    CalendarServer/branches/users/cdaboo/update-packages/txdav/carddav/datastore/file.py
    CalendarServer/branches/users/cdaboo/update-packages/txdav/carddav/datastore/sql.py
    CalendarServer/branches/users/cdaboo/update-packages/txdav/carddav/datastore/test/common.py
    CalendarServer/branches/users/cdaboo/update-packages/txdav/common/datastore/file.py
    CalendarServer/branches/users/cdaboo/update-packages/txweb2/auth/digest.py
    CalendarServer/branches/users/cdaboo/update-packages/txweb2/test/test_httpauth.py
    CalendarServer/branches/users/cdaboo/update-packages/txweb2/test/test_stream.py

Modified: CalendarServer/branches/users/cdaboo/update-packages/twistedcaldav/storebridge.py
===================================================================
--- CalendarServer/branches/users/cdaboo/update-packages/twistedcaldav/storebridge.py	2015-11-02 21:40:23 UTC (rev 15275)
+++ CalendarServer/branches/users/cdaboo/update-packages/twistedcaldav/storebridge.py	2015-11-02 21:50:00 UTC (rev 15276)
@@ -25,7 +25,6 @@
 from twext.python.log import Logger
 from twisted.internet.defer import succeed, inlineCallbacks, returnValue, maybeDeferred
 from twisted.internet.protocol import Protocol
-from twisted.python.hashlib import md5
 from twisted.python.util import FancyEqMixin
 from twistedcaldav import customxml, carddavxml, caldavxml, ical
 from twistedcaldav.caldavxml import (
@@ -657,7 +656,7 @@
 
             try:
                 # Create a new name if one was not provided
-                name = md5(str(index) + component.resourceUID() + str(time.time()) + request.path).hexdigest() + self.resourceSuffix()
+                name = hashlib.md5(str(index) + component.resourceUID() + str(time.time()) + request.path).hexdigest() + self.resourceSuffix()
 
                 # Get a resource for the new item
                 newchildURL = joinURL(request.path, name)
@@ -3342,7 +3341,7 @@
 
             try:
                 # Create a new name if one was not provided
-                name = md5(str(index) + component.resourceUID() + str(time.time()) + request.path).hexdigest() + self.resourceSuffix()
+                name = hashlib.md5(str(index) + component.resourceUID() + str(time.time()) + request.path).hexdigest() + self.resourceSuffix()
 
                 # Get a resource for the new item
                 newchildURL = joinURL(request.path, name)

Modified: CalendarServer/branches/users/cdaboo/update-packages/txdav/base/datastore/file.py
===================================================================
--- CalendarServer/branches/users/cdaboo/update-packages/txdav/base/datastore/file.py	2015-11-02 21:40:23 UTC (rev 15275)
+++ CalendarServer/branches/users/cdaboo/update-packages/txdav/base/datastore/file.py	2015-11-02 21:50:00 UTC (rev 15276)
@@ -22,7 +22,7 @@
 
 from zope.interface.declarations import implements
 
-from twisted.python import hashlib
+import hashlib
 
 from twext.python.log import Logger
 from twext.enterprise.ienterprise import AlreadyFinishedError

Modified: CalendarServer/branches/users/cdaboo/update-packages/txdav/caldav/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/cdaboo/update-packages/txdav/caldav/datastore/sql.py	2015-11-02 21:40:23 UTC (rev 15275)
+++ CalendarServer/branches/users/cdaboo/update-packages/txdav/caldav/datastore/sql.py	2015-11-02 21:50:00 UTC (rev 15276)
@@ -41,7 +41,6 @@
 from txweb2.stream import readStream
 
 from twisted.internet.defer import inlineCallbacks, returnValue, succeed
-from twisted.python import hashlib
 from twisted.python.failure import Failure
 
 from twistedcaldav import customxml, ical
@@ -114,6 +113,7 @@
 from urlparse import urlparse, urlunparse
 import collections
 import datetime
+import hashlib
 import itertools
 import urllib
 import uuid

Modified: CalendarServer/branches/users/cdaboo/update-packages/txdav/caldav/datastore/test/common.py
===================================================================
--- CalendarServer/branches/users/cdaboo/update-packages/txdav/caldav/datastore/test/common.py	2015-11-02 21:40:23 UTC (rev 15275)
+++ CalendarServer/branches/users/cdaboo/update-packages/txdav/caldav/datastore/test/common.py	2015-11-02 21:50:00 UTC (rev 15276)
@@ -24,7 +24,6 @@
 from twisted.internet.defer import Deferred, inlineCallbacks, returnValue, \
     maybeDeferred
 from twisted.internet.protocol import Protocol
-from twisted.python import hashlib
 
 from twext.python.clsprop import classproperty
 from twistedcaldav.ical import Component as VComponent
@@ -54,6 +53,7 @@
 from twistedcaldav.config import config
 from calendarserver.push.util import PushPriority
 
+import hashlib
 import json
 
 

Modified: CalendarServer/branches/users/cdaboo/update-packages/txdav/carddav/datastore/file.py
===================================================================
--- CalendarServer/branches/users/cdaboo/update-packages/txdav/carddav/datastore/file.py	2015-11-02 21:40:23 UTC (rev 15275)
+++ CalendarServer/branches/users/cdaboo/update-packages/txdav/carddav/datastore/file.py	2015-11-02 21:50:00 UTC (rev 15276)
@@ -33,7 +33,6 @@
 from txweb2.dav.resource import TwistedGETContentMD5
 from txweb2.http_headers import MimeType
 
-from twisted.python import hashlib
 
 from twistedcaldav.vcard import Component as VComponent, InvalidVCardDataError
 from txdav.carddav.datastore.index_file import AddressBookIndex as OldIndex
@@ -53,6 +52,8 @@
 
 from zope.interface import implements
 
+import hashlib
+
 contentTypeKey = PropertyName.fromElement(GETContentType)
 md5key = PropertyName.fromElement(TwistedGETContentMD5)
 

Modified: CalendarServer/branches/users/cdaboo/update-packages/txdav/carddav/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/cdaboo/update-packages/txdav/carddav/datastore/sql.py	2015-11-02 21:40:23 UTC (rev 15275)
+++ CalendarServer/branches/users/cdaboo/update-packages/txdav/carddav/datastore/sql.py	2015-11-02 21:50:00 UTC (rev 15276)
@@ -38,7 +38,6 @@
 from txweb2.responsecode import FORBIDDEN
 
 from twisted.internet.defer import inlineCallbacks, returnValue, succeed
-from twisted.python import hashlib
 
 from twistedcaldav.config import config
 from twistedcaldav.vcard import Component as VCard, InvalidVCardDataError, Property, \
@@ -69,7 +68,9 @@
 
 from zope.interface.declarations import implements
 
+import hashlib
 
+
 class AddressBookHome(CommonHome):
 
     implements(IAddressBookHome)

Modified: CalendarServer/branches/users/cdaboo/update-packages/txdav/carddav/datastore/test/common.py
===================================================================
--- CalendarServer/branches/users/cdaboo/update-packages/txdav/carddav/datastore/test/common.py	2015-11-02 21:40:23 UTC (rev 15275)
+++ CalendarServer/branches/users/cdaboo/update-packages/txdav/carddav/datastore/test/common.py	2015-11-02 21:50:00 UTC (rev 15276)
@@ -24,7 +24,6 @@
 from txweb2.responsecode import FORBIDDEN
 
 from twisted.internet.defer import inlineCallbacks, returnValue, maybeDeferred
-from twisted.python import hashlib
 
 from twistedcaldav.vcard import Component as VComponent
 
@@ -42,7 +41,9 @@
 from txdav.xml.element import WebDAVUnknownElement
 from calendarserver.push.util import PushPriority
 
+import hashlib
 
+
 storePath = FilePath(__file__).parent().child("addressbook_store")
 
 home1Root = storePath.child("ho").child("me").child("home1")

Modified: CalendarServer/branches/users/cdaboo/update-packages/txdav/common/datastore/file.py
===================================================================
--- CalendarServer/branches/users/cdaboo/update-packages/txdav/common/datastore/file.py	2015-11-02 21:40:23 UTC (rev 15275)
+++ CalendarServer/branches/users/cdaboo/update-packages/txdav/common/datastore/file.py	2015-11-02 21:50:00 UTC (rev 15276)
@@ -30,7 +30,6 @@
 
 from twisted.internet.defer import succeed, inlineCallbacks, returnValue
 from twisted.python.util import FancyEqMixin
-from twisted.python import hashlib
 from twisted.python.failure import Failure
 
 from twistedcaldav import customxml
@@ -60,6 +59,7 @@
 from errno import EEXIST, ENOENT
 from zope.interface import implements, directlyProvides
 
+import hashlib
 import json
 import uuid
 from twistedcaldav.sql import AbstractSQLDatabase, db_prefix

Modified: CalendarServer/branches/users/cdaboo/update-packages/txweb2/auth/digest.py
===================================================================
--- CalendarServer/branches/users/cdaboo/update-packages/txweb2/auth/digest.py	2015-11-02 21:40:23 UTC (rev 15275)
+++ CalendarServer/branches/users/cdaboo/update-packages/txweb2/auth/digest.py	2015-11-02 21:50:00 UTC (rev 15276)
@@ -31,7 +31,8 @@
 
 from zope.interface import implements
 
-from twisted.python.hashlib import md5, sha1
+from hashlib import md5, sha1
+
 from twisted.cred import credentials
 
 # FIXME: Technically speaking - although you can't tell from looking at them -

Modified: CalendarServer/branches/users/cdaboo/update-packages/txweb2/test/test_httpauth.py
===================================================================
--- CalendarServer/branches/users/cdaboo/update-packages/txweb2/test/test_httpauth.py	2015-11-02 21:40:23 UTC (rev 15275)
+++ CalendarServer/branches/users/cdaboo/update-packages/txweb2/test/test_httpauth.py	2015-11-02 21:50:00 UTC (rev 15276)
@@ -1,7 +1,6 @@
 # Copyright (c) 2006-2009 Twisted Matrix Laboratories.
 # See LICENSE for details.
 
-from twisted.python.hashlib import md5
 from twisted.internet import address
 from twisted.trial import unittest
 from twisted.cred import error
@@ -13,6 +12,7 @@
 from txweb2.test import test_server
 
 import base64
+from hashlib import md5
 
 _trivial_GET = SimpleRequest(None, 'GET', '/')
 

Modified: CalendarServer/branches/users/cdaboo/update-packages/txweb2/test/test_stream.py
===================================================================
--- CalendarServer/branches/users/cdaboo/update-packages/txweb2/test/test_stream.py	2015-11-02 21:40:23 UTC (rev 15275)
+++ CalendarServer/branches/users/cdaboo/update-packages/txweb2/test/test_stream.py	2015-11-02 21:50:00 UTC (rev 15276)
@@ -5,6 +5,7 @@
 Tests for the stream implementations in L{txweb2}.
 """
 
+from hashlib import md5
 import os
 import sys
 import tempfile
@@ -13,7 +14,6 @@
 
 from twisted.python.util import sibpath
 sibpath # sibpath is *not* unused - the doctests use it.
-from twisted.python.hashlib import md5
 from twisted.internet import reactor, defer, interfaces
 from twisted.trial import unittest
 from txweb2 import stream
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20151102/6c79fcf0/attachment-0001.html>


More information about the calendarserver-changes mailing list