chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmig...@apache.org
Subject svn commit: r1836992 - in /chemistry/cmislib/branches/py3_compat/src/cmislib: atompub/binding.py browser/binding.py net.py util.py
Date Sun, 29 Jul 2018 16:54:46 GMT
Author: lmignon
Date: Sun Jul 29 16:54:46 2018
New Revision: 1836992

URL: http://svn.apache.org/viewvc?rev=1836992&view=rev
Log:
py3compat: import from right place according to the used python version 

Modified:
    chemistry/cmislib/branches/py3_compat/src/cmislib/atompub/binding.py
    chemistry/cmislib/branches/py3_compat/src/cmislib/browser/binding.py
    chemistry/cmislib/branches/py3_compat/src/cmislib/net.py
    chemistry/cmislib/branches/py3_compat/src/cmislib/util.py

Modified: chemistry/cmislib/branches/py3_compat/src/cmislib/atompub/binding.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/branches/py3_compat/src/cmislib/atompub/binding.py?rev=1836992&r1=1836991&r2=1836992&view=diff
==============================================================================
--- chemistry/cmislib/branches/py3_compat/src/cmislib/atompub/binding.py (original)
+++ chemistry/cmislib/branches/py3_compat/src/cmislib/atompub/binding.py Sun Jul 29 16:54:46
2018
@@ -22,23 +22,30 @@ Module containing the Atom Pub binding-s
 provider.
 """
 import sys
+import datetime
+import logging
+import mimetypes
+import re
+from xml.dom import minidom
+from xml.parsers.expat import ExpatError
 
 from cmislib import messages
-from cmislib.net import RESTService as Rest
+from cmislib.cmis_services import Binding, RepositoryServiceIfc
+from cmislib.domain import CmisId, CmisObject, ObjectType, Property, ACL, ACE, \
+    ChangeEntry, ResultSet, Rendition
 from cmislib.exceptions import CmisException, \
     ObjectNotFoundException, InvalidArgumentException, \
     NotSupportedException
-from cmislib.util import multiple_replace, parsePropValue, parseBoolValue, toCMISValue, parseDateTimeValue,
safe_quote
+from cmislib.net import RESTService as Rest
+from cmislib.util import multiple_replace, parsePropValue, parseBoolValue, \
+    toCMISValue, parseDateTimeValue, safe_quote
 
-from urllib import quote
-from urlparse import urlparse, urlunparse
-import re
-import mimetypes
-from xml.parsers.expat import ExpatError
-import datetime
-import StringIO
-import logging
-from xml.dom import minidom
+if sys.version_info >= (3,):
+    from urllib.parse import urlparse, urlunparse
+    import io as StringIO
+else:
+    from urlparse import urlparse, urlunparse
+    import StringIO
 
 moduleLogger = logging.getLogger('cmislib.atompub.binding')
 

Modified: chemistry/cmislib/branches/py3_compat/src/cmislib/browser/binding.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/branches/py3_compat/src/cmislib/browser/binding.py?rev=1836992&r1=1836991&r2=1836992&view=diff
==============================================================================
--- chemistry/cmislib/branches/py3_compat/src/cmislib/browser/binding.py (original)
+++ chemistry/cmislib/branches/py3_compat/src/cmislib/browser/binding.py Sun Jul 29 16:54:46
2018
@@ -21,19 +21,27 @@
 Module containing the browser binding-specific objects used to work with a CMIS
 provider.
 """
-from cmislib.cmis_services import Binding, RepositoryServiceIfc
-from cmislib.domain import CmisId, CmisObject, ObjectType, ACL, ACE, ChangeEntry
-from cmislib.exceptions import CmisException, InvalidArgumentException,\
-                               NotSupportedException, ObjectNotFoundException
-from cmislib.net import RESTService as Rest
-from cmislib.util import parsePropValueByType, parseDateTimeValue, safe_quote,\
-                        safe_urlencode
-from cmislib import messages
 import json
 import logging
-import StringIO
+import sys
 import time
 
+from cmislib import messages
+from cmislib.cmis_services import Binding, RepositoryServiceIfc
+from cmislib.domain import CmisId, CmisObject, ObjectType, ACL, ACE, \
+    ChangeEntry
+from cmislib.exceptions import CmisException, InvalidArgumentException, \
+    NotSupportedException, ObjectNotFoundException
+from cmislib.net import RESTService as Rest
+from cmislib.util import parsePropValueByType, parseDateTimeValue, safe_quote, \
+    safe_urlencode
+
+if sys.version_info >= (3,):
+    import io as StringIO
+else:
+    import StringIO
+
+
 CMIS_FORM_TYPE = 'application/x-www-form-urlencoded;charset=utf-8'
 
 moduleLogger = logging.getLogger('cmislib.browser.binding')
@@ -1043,7 +1051,6 @@ class BrowserRepository(object):
             typesUrl += "&typeId=%s" % (safe_quote(typeId))
         if depth is not None:
             typesUrl += "&depth=%s" % (depth)
-        print typesUrl
 
         result = self._cmisClient.binding.get(typesUrl,
                                               self._cmisClient.username,

Modified: chemistry/cmislib/branches/py3_compat/src/cmislib/net.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/branches/py3_compat/src/cmislib/net.py?rev=1836992&r1=1836991&r2=1836992&view=diff
==============================================================================
--- chemistry/cmislib/branches/py3_compat/src/cmislib/net.py (original)
+++ chemistry/cmislib/branches/py3_compat/src/cmislib/net.py Sun Jul 29 16:54:46 2018
@@ -23,7 +23,13 @@ not know anything about CMIS or do anyth
 response it receives.
 """
 
-from urllib import urlencode
+import sys
+
+if sys.version_info >= (3,):
+    from urllib.parse import urlencode
+else:
+    from urllib import urlencode
+
 import logging
 import httplib2
 

Modified: chemistry/cmislib/branches/py3_compat/src/cmislib/util.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/branches/py3_compat/src/cmislib/util.py?rev=1836992&r1=1836991&r2=1836992&view=diff
==============================================================================
--- chemistry/cmislib/branches/py3_compat/src/cmislib/util.py (original)
+++ chemistry/cmislib/branches/py3_compat/src/cmislib/util.py Sun Jul 29 16:54:46 2018
@@ -20,12 +20,18 @@
 """
 This module contains handy utility functions.
 """
+import sys
 import re
 import iso8601
 import logging
 import datetime
 from cmislib.domain import CmisId
-from urllib import urlencode, quote
+
+if sys.version_info >= (3,):
+    from urllib.parse import urlencode, quote
+else:
+    from urllib import urlencode, quote
+
 
 moduleLogger = logging.getLogger('cmislib.util')
 



Mime
View raw message