Small changes for PEP8 and pylint
git-svn-id: https://svn.apache.org/repos/asf/chemistry/cmislib/trunk@1806377 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/cmislib/atompub/binding.py b/src/cmislib/atompub/binding.py
index e7453b3..c69857d 100644
--- a/src/cmislib/atompub/binding.py
+++ b/src/cmislib/atompub/binding.py
@@ -581,8 +581,8 @@
for valNode in valNodeList:
try:
propertyValue.append(parsePropValue(valNode.
- childNodes[0].data,
- node.localName))
+ childNodes[0].data,
+ node.localName))
except IndexError:
pass
else:
@@ -3476,7 +3476,7 @@
"""
ace = AtomPubACE(principalId, access, direct)
if not self._entries:
- self._entries = {ace.principalId : ace}
+ self._entries = {ace.principalId: ace}
else:
if self._entries.has_key(principalId):
if access not in self._entries[principalId].permissions:
@@ -3484,7 +3484,7 @@
perms.append(access)
self.removeEntry(principalId)
if not self._entries:
- self._entries = {principalId : AtomPubACE(principalId, perms, direct)}
+ self._entries = {principalId: AtomPubACE(principalId, perms, direct)}
else:
self._entries[principalId] = AtomPubACE(principalId, perms, direct)
else:
diff --git a/src/cmislib/browser/binding.py b/src/cmislib/browser/binding.py
index 7788d15..65355fe 100644
--- a/src/cmislib/browser/binding.py
+++ b/src/cmislib/browser/binding.py
@@ -28,11 +28,11 @@
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 time
-from urllib import urlencode, quote
CMIS_FORM_TYPE = 'application/x-www-form-urlencoded;charset=utf-8'
@@ -117,6 +117,11 @@
"""
def getRepository(self, client, repositoryId):
+
+ """
+ Gets the repository for the specified repository ID.
+ """
+
result = client.binding.get(client.repositoryUrl, client.username, client.password, **client.extArgs)
if repositoryId in result:
@@ -125,6 +130,11 @@
raise ObjectNotFoundException(url=client.repositoryUrl)
def getRepositories(self, client):
+
+ """
+ Gets all of the repositories for this client.
+ """
+
result = client.binding.get(client.repositoryUrl, client.username, client.password, **client.extArgs)
repositories = []
@@ -569,7 +579,7 @@
for i, entry in enumerate(acl.getAddedAces()):
fields['addACEPrincipal[%d]' % i] = entry.principalId
for j, perm in enumerate(entry.permissions):
- fields['addACEPermission[%d][%d]'% (i, j)] = perm
+ fields['addACEPermission[%d][%d]' % (i, j)] = perm
for i, entry in enumerate(acl.getRemovedAces()):
fields['removeACEPrincipal[%d]' % i] = entry.principalId
for j, perm in enumerate(entry.permissions):
@@ -2859,6 +2869,11 @@
entries = property(getEntries)
def getOriginalEntries(self):
+
+ """
+ Returns the original entries.
+ """
+
return self._originalEntries
originalEntries = property(getOriginalEntries)
@@ -3033,7 +3048,7 @@
"""
if not self._properties:
props = self._data.get('properties')
- for prop in self._data.get('properties').itervalues():
+ for prop in props.itervalues():
# property could be multi-valued
if type(prop['value']) is list:
propVal = []
@@ -3102,6 +3117,7 @@
return self._results
+
class BrowserRendition(object):
"""
@@ -3412,6 +3428,7 @@
return json.dumps(aces)
+
class ChangeEntrySerializer(object):
"""
diff --git a/src/cmislib/domain.py b/src/cmislib/domain.py
index 7065f68..7e758ea 100644
--- a/src/cmislib/domain.py
+++ b/src/cmislib/domain.py
@@ -1075,6 +1075,7 @@
Returns the prev page of results as a dictionary of
:class:`CmisObject` objects or its appropriate sub-type. This only
works when the server returns a "prev" link. Not all of them do.
+
>>> resultSet.hasPrev()
True
>>> results = resultSet.getPrev()
@@ -1091,6 +1092,7 @@
"""
Returns the next page of results as a dictionary of
:class:`CmisObject` objects or its appropriate sub-type.
+
>>> resultSet.hasNext()
True
>>> results = resultSet.getNext()
@@ -2028,9 +2030,8 @@
if (
isinstance(other, self.__class__) and
self.principalId == other.principalId and
- self.direct == other.direct and
- not(set(self.permissions) ^ set(other.permissions))
- ):
+ self.direct == other.direct and
+ not(set(self.permissions) ^ set(other.permissions))):
return 0
return -1
diff --git a/src/cmislib/exceptions.py b/src/cmislib/exceptions.py
index 9bbe630..78cdb09 100644
--- a/src/cmislib/exceptions.py
+++ b/src/cmislib/exceptions.py
@@ -21,6 +21,8 @@
"""
This module contains exceptions used throughout the API.
"""
+
+
class CmisException(Exception):
"""