Whitespace and documentation cleanup in preparation for the 0.5 release

git-svn-id: https://svn.apache.org/repos/asf/chemistry/cmislib/trunk@1211514 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/setup.cfg b/setup.cfg
index 70387d2..fb44fef 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -18,4 +18,4 @@
 #
 
 [egg_info]
-tag_build = dev
+tag_build = 
diff --git a/src/cmislib.egg-info/PKG-INFO b/src/cmislib.egg-info/PKG-INFO
index 516e308..0eadd35 100644
--- a/src/cmislib.egg-info/PKG-INFO
+++ b/src/cmislib.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: cmislib
-Version: 0.5dev
+Version: 0.5
 Summary: Apache Chemistry CMIS client library for Python
 Home-page: http://chemistry.apache.org/
 Author: Apache Chemistry Project
diff --git a/src/cmislib/model.py b/src/cmislib/model.py
index 99a39f9..dce3e8e 100644
--- a/src/cmislib/model.py
+++ b/src/cmislib/model.py
@@ -384,9 +384,10 @@
         """
         Returns the value of the cmis:supportedPermissions element. Valid
         values are:
-          basic: indicates that the CMIS Basic permissions are supported
-          repository: indicates that repository specific permissions are supported
-          both: indicates that both CMIS basic permissions and repository specific permissions are supported
+
+         - basic: indicates that the CMIS Basic permissions are supported
+         - repository: indicates that repository specific permissions are supported
+         - both: indicates that both CMIS basic permissions and repository specific permissions are supported
 
         >>> repo.supportedPermissions
         u'both'
@@ -507,9 +508,9 @@
 
         """
         Returns the value of the cmis:propagation element. Valid values are:
-          objectonly: indicates that the repository is able to apply ACEs
+          - objectonly: indicates that the repository is able to apply ACEs
             without changing the ACLs of other objects
-          propagate: indicates that the repository is able to apply ACEs to a
+          - propagate: indicates that the repository is able to apply ACEs to a
             given object and propagate this change to all inheriting objects
 
         >>> repo.propagation
@@ -1130,7 +1131,7 @@
 
         return parentFolder.createDocument(name, properties, StringIO.StringIO(contentString),
             contentType, contentEncoding)
-        
+
     def createDocument(self,
                        name,
                        properties={},
@@ -1193,7 +1194,7 @@
         # build the Atom entry
         xmlDoc = getEntryXmlDoc(self, None, properties, contentFile,
                                 contentType, contentEncoding)
-        
+
         # post the Atom entry
         result = self._cmisClient.post(postUrl.encode('utf-8'), xmlDoc.toxml(encoding='utf-8'), ATOM_XML_ENTRY_TYPE)
         if type(result) == HTTPError:
@@ -1513,6 +1514,12 @@
         return self._results
 
     def hasObject(self, objectId):
+
+        '''
+        Returns True if the specified objectId is found in the list of results,
+        otherwise returns False.
+        '''
+
         for obj in self.getResults():
             if obj.id == objectId:
                 return True
@@ -1759,7 +1766,7 @@
 
         if self._objectId == None:
             if self.xmlDoc == None:
-                logger.debug('Both objectId and xmlDoc were None, reloading')
+                self.logger.debug('Both objectId and xmlDoc were None, reloading')
                 self.reload()
             props = self.getProperties()
             self._objectId = CmisId(props['cmis:objectId'])
@@ -1948,7 +1955,7 @@
         selfUrl = self._getSelfLink()
 
         # if we have a change token, we must pass it back, per the spec
-        args = {}        
+        args = {}
         if (self.properties.has_key('cmis:changeToken') and
             self.properties['cmis:changeToken'] != None):
             self.logger.debug('Change token present, adding it to args')
@@ -1986,7 +1993,7 @@
         Moves an object from the source folder to the target folder.
 
         See CMIS specification document 2.2.4.13 move
-        
+
         >>> sub1 = repo.getObjectByPath('/cmislib/sub1')
         >>> sub2 = repo.getObjectByPath('/cmislib/sub2')
         >>> doc = repo.getObjectByPath('/cmislib/sub1/testdoc1')
@@ -1994,9 +2001,9 @@
         """
 
         postUrl = targetFolder.getChildrenLink()
-        
+
         args = {"sourceFolderId": sourceFolder.id}
-        
+
         # post the Atom entry
         result = self._cmisClient.post(postUrl.encode('utf-8'), self.xmlDoc.toxml(encoding='utf-8'), ATOM_XML_ENTRY_TYPE, **args)
         if type(result) == HTTPError:
@@ -2236,8 +2243,6 @@
                     if relAttr == rel:
                         return linkElement.attributes['href'].value
 
-    
-
     allowableActions = property(getAllowableActions)
     name = property(getName)
     id = property(getObjectId)
@@ -2560,7 +2565,7 @@
             mimetype = 'application/binary'
 
         # if we have a change token, we must pass it back, per the spec
-        args = {}        
+        args = {}
         if (self.properties.has_key('cmis:changeToken') and
             self.properties['cmis:changeToken'] != None):
             self.logger.debug('Change token present, adding it to args')
@@ -2601,7 +2606,7 @@
         assert(srcUrl), 'Unable to determine content stream URL.'
 
         # if we have a change token, we must pass it back, per the spec
-        args = {}        
+        args = {}
         if (self.properties.has_key('cmis:changeToken') and
             self.properties['cmis:changeToken'] != None):
             self.logger.debug('Change token present, adding it to args')
@@ -2658,7 +2663,7 @@
         for res in rs:
             path = res.properties['cmis:path']
             relativePathSegment = res.properties['cmisra:relativePathSegment']
-            
+
             # concat with a slash
             # add it to the list
             paths.append(path + '/' + relativePathSegment)
@@ -2888,6 +2893,7 @@
 
         The following optional arguments *may* also work but haven't been
         tested:
+
          - filter
          - includeRelationships
          - renditionFilter
@@ -3031,9 +3037,9 @@
 
         if not self._repository.getCapabilities()['Multifiling']:
             raise NotSupportedException('This repository does not support multifiling')
-        
+
         postUrl = self.getChildrenLink()
-        
+
         # post the Atom entry
         result = self._cmisClient.post(postUrl.encode('utf-8'), cmisObject.xmlDoc.toxml(encoding='utf-8'), ATOM_XML_ENTRY_TYPE, **kwargs)
         if type(result) == HTTPError:
@@ -3726,11 +3732,12 @@
         """
         Returns the type of change that occurred. The resulting value must be
         one of:
+
          - created
          - updated
          - deleted
          - security
-         """
+        """
 
         if self._changeType == None:
             self._changeType = self._xmlDoc.getElementsByTagNameNS(CMIS_NS, 'changeType')[0].firstChild.data
@@ -4106,7 +4113,7 @@
                 # grab the prop type from the typeDef
                 if (typeDef == None):
                     moduleLogger.debug('Looking up type def for:' + objectTypeId)
-                    typeDef = repo.getTypeDefinition(objectTypeId)                    
+                    typeDef = repo.getTypeDefinition(objectTypeId)
                     #TODO what to do if type not found
                 propType = typeDef.properties[propName].propertyType
             elif type(propValue) == list:
@@ -4129,8 +4136,14 @@
 
     return entryXmlDoc
 
+
 def getElementNameAndValues(propType, propName, propValue, isList=False):
 
+    """
+    For a given property type, property name, and property value, this function
+    returns the appropriate CMIS Atom entry element name and value list.
+    """
+
     moduleLogger.debug('Inside getElementNameAndValues')
     moduleLogger.debug('propType:%s propName:%s isList:%s' % (propType, propName, isList))
     if (propType == 'id' or propType == CmisId):
diff --git a/src/doc/src/about.rst b/src/doc/src/about.rst
index 6201780..f8ed9b6 100644
--- a/src/doc/src/about.rst
+++ b/src/doc/src/about.rst
@@ -16,7 +16,7 @@
    specific language governing permissions and limitations
    under the License.
 
-About the CMIS Python Library
+About Apache Chemistry cmislib
 =============================
 The goal of this project is to create a CMIS client for Python that can be used to work with any CMIS-compliant repository.
 
@@ -30,7 +30,7 @@
 Quick Example
 -------------
 This should give you an idea of how easy and natural it is to work with the API:
-  >>> cmisClient = cmislib.CmisClient('http://localhost:8080/alfresco/s/cmis', 'admin', 'admin')
+  >>> cmisClient = cmislib.CmisClient('http://localhost:8080/alfresco/cmisatom', 'admin', 'admin')
   >>> repo = cmisClient.defaultRepository
   >>> rootFolder = repo.rootFolder
   >>> children = rootFolder.getChildren()
@@ -48,9 +48,6 @@
 Renditions
  * getRenditions
 
-Change history
- * change token
-
 Unfiling/multifiling support
  * createDocument without a parent folder (unfiled)
 
diff --git a/src/doc/src/code.rst b/src/doc/src/code.rst
index 9600a7a..c6687ce 100644
--- a/src/doc/src/code.rst
+++ b/src/doc/src/code.rst
@@ -24,6 +24,12 @@
 
 The :mod:`cmislib.model` Module contains all the CMIS domain objects. The ones you will work with are listed as top level package elements. When working with the repository, the first thing you need to do is grab an instance of :class:`cmislib.CmisClient`, passing it the repository endpoint URL, username, and password.
 
+For example, in Alfresco 4 and higher, the repository endpoint is
+'http://localhost:8080/alfresco/cmisatom'. In earlier versions of
+Alfresco, the endpoint is
+'http://localhost:8080/alfresco/s/api/cmis'. In both cases, the
+default username and password are 'admin' and 'admin'.
+
 >>> cmisClient = cmislib.CmisClient('http://localhost:8080/alfresco/s/cmis', 'admin', 'admin')
 
 From there you can get the default repository...
@@ -47,7 +53,7 @@
 .. automodule:: cmislib.net
    :members: RESTService
    
-The :mod:`tests.cmislib` Module
+The :mod:`cmislib` Module
 -------------------------------
 
 The :mod:`tests.cmislibtest` Module contains unit tests for all classes and methods in :mod:`cmislib.model`. See :ref:`tests` for more information on running tests.
diff --git a/src/doc/src/conf.py b/src/doc/src/conf.py
index 7b861bb..bfdd806 100644
--- a/src/doc/src/conf.py
+++ b/src/doc/src/conf.py
@@ -35,6 +35,7 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #sys.path.append(os.path.abspath('.'))
 sys.path.append(os.path.abspath('../..'))
+#sys.path.append(os.path.abspath('../../tests'))
 
 # -- General configuration -----------------------------------------------------
 
@@ -55,8 +56,8 @@
 master_doc = 'index'
 
 # General information about the project.
-project = u'CMIS Library'
-copyright = u'2010, Apache Software Foundation'
+project = u'Apache Chemistry cmislib'
+copyright = u'2011, Apache Software Foundation'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -176,7 +177,7 @@
 #html_file_suffix = ''
 
 # Output file base name for HTML help builder.
-htmlhelp_basename = 'CMISLibrarydoc'
+htmlhelp_basename = 'cmislibdoc'
 
 
 # -- Options for LaTeX output --------------------------------------------------
@@ -190,8 +191,8 @@
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, documentclass [howto/manual]).
 latex_documents = [
-  ('index', 'CMISLibrary.tex', u'CMIS Library Documentation',
-   u'Jeff Potts, Optaros', 'manual'),
+  ('index', 'cmislib.tex', u'Apache Chemistry cmislib Documentation',
+   u'Jeff Potts', 'manual'),
 ]
 
 # The name of an image file (relative to this directory) to place at the top of
diff --git a/src/doc/src/devguide.rst b/src/doc/src/devguide.rst
index 483731e..0f75992 100644
--- a/src/doc/src/devguide.rst
+++ b/src/doc/src/devguide.rst
@@ -37,27 +37,45 @@
  #. All tests pass cleanly (or have good reasons for not passing)
  #. Change setup.cfg to have the appropriate tag ('dev', for example, or '' for a stable release)
  #. Change setup.py to have the appropriate version number
- #. All changes checked in
- #. pep8 runs without much complaint
-     * pep8 --ignore=E501,W601 --repeat model.py
-
- #. pylint runs without much complaint
-     * pylint --disable-msg=C0103,R0904,R0913,C0301,W0511 cmislibtest.py
-
  #. Inline comments updated with changes
  #. Sphinx doc updated with changes
- #. Docs built cleanly
-     * cd src/doc/src/
-     * make html
+ #. Docs build cleanly
+     .. code-block:: bash
 
- #. Setuptools build
-     * python setup.py bdist sdist
-     * Use release script to sign files
+        cd src/doc/src/
+        make html
 
- #. Copy files to Apache, start vote
- #. If vote passes, copy files to Apache dist
+ #. pep8 runs without much complaint
+     .. code-block:: bash
+
+        pep8 --ignore=E501,W601 --repeat model.py
+
+ #. pylint runs without much complaint
+     .. code-block:: bash
+
+        pylint --disable-msg=C0103,R0904,R0913,C0301,W0511 cmislibtest.py
+
+ #. All changes checked in
+ #. Tag the release using 'cmislib-[release num]-RC[x]'
+ #. Use the release script to build the release artifacts
+     .. code-block:: bash
+
+        cd dist
+        ./release.sh -u jpotts@apache.org
+
+    This will do a 'setup.py bdist sdist' and will then sign all artifacts.
+
+    Note that the artifacts will be named without 'RC[x]'. These are the same artifacts that will be distributed if the vote passes.
+
+ #. Copy files to the Apache server under ~/public_html/chemistry/cmislib/[release num]
+ #. Start vote. Send an email to dev@chemistry.apache.org announcing the vote, highlighting the changes, pointing to the tagged source, and referencing the artifacts that have been copied to the Apache server.
+ #. After 72 hours, if the vote passes, continue, otherwise address issues and start over
+ #. Copy the files to the appropriate Apache dist directory, which is /www/www.apache.org/dist/chemistry/cmislib/[release num]
+ #. Rename the RC tag in source code control
+ #. Update the cmislib home page with download links to the new release
  #. Upload files to Pypi
- #. Tag the release in Subversion
  #. Check the `cheesecake <http://pycheesecake.org/>`_ score
-     * python cheesecake_index --name=cmislib
+     .. code-block:: bash
+
+        python cheesecake_index --name=cmislib
 
diff --git a/src/doc/src/examples.rst b/src/doc/src/examples.rst
index 0bed68b..b477504 100644
--- a/src/doc/src/examples.rst
+++ b/src/doc/src/examples.rst
@@ -36,7 +36,7 @@
 
  #. Point the CmisClient at the repository's service URL 
 
-    >>> client = CmisClient('http://cmis.alfresco.com/s/cmis', 'admin', 'admin')
+    >>> client = CmisClient('http://cmis.alfresco.com/cmisatom', 'admin', 'admin')
 
  #. Get the default repository for the service
 
diff --git a/src/doc/src/index.rst b/src/doc/src/index.rst
index 7be7e56..4656ebc 100644
--- a/src/doc/src/index.rst
+++ b/src/doc/src/index.rst
@@ -16,13 +16,13 @@
    specific language governing permissions and limitations
    under the License.
 
-.. CMIS Library documentation master file, created by
+.. cmislib documentation master file, created by
    sphinx-quickstart on Thu Dec 10 10:12:43 2009.
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
-Welcome to CMIS Library's documentation!
-========================================
+Welcome to the Apache Chemistry cmislib documentation!
+==================================================================
 
 Contents:
 
diff --git a/src/tests/cmislibtest.py b/src/tests/cmislibtest.py
index f123176..74b9441 100644
--- a/src/tests/cmislibtest.py
+++ b/src/tests/cmislibtest.py
@@ -39,7 +39,7 @@
 try:
     os.stat(settings.TEST_BINARY_1)
 except:
-    settings.TEST_BINARY_1 = os.path.join(my_dir, TEST_BINARY_1)
+    settings.TEST_BINARY_1 = os.path.join(my_dir, settings.TEST_BINARY_1)
 try:
     os.stat(settings.TEST_BINARY_2)
 except:
@@ -395,7 +395,7 @@
 #        '''Create a new unfiled document'''
 #        if self._repo.getCapabilities()['Unfiling'] != True:
 #            print 'Repo does not support unfiling, skipping'
-#            return        
+#            return
 #        documentName = 'testDocument'
 #        newDoc = self._repo.createDocument(documentName)
 #        self.assertEquals(documentName, newDoc.getName())
@@ -1468,7 +1468,7 @@
 #    tts.addTests(TestLoader().loadTestsFromName('testFolderTrailingDot', FolderTest))
 #    tts.addTests(TestLoader().loadTestsFromName('testGetObjectParents', DocumentTest))
 #    tts.addTests(TestLoader().loadTestsFromName('testGetObjectParentsMultiple', DocumentTest))
-            
+
     # WARNING: Potentially long-running tests
 
     # Query tests
diff --git a/src/tests/settings.py b/src/tests/settings.py
index 12dad14..1321987 100644
--- a/src/tests/settings.py
+++ b/src/tests/settings.py
@@ -23,24 +23,24 @@
 # CMIS repository's service URL
 #REPOSITORY_URL = 'http://cmis.alfresco.com/s/cmis' # Alfresco demo
 #REPOSITORY_URL = 'http://localhost:8081/chemistry/atom' # Apache Chemistry
-#REPOSITORY_URL = 'http://localhost:8080/alfresco/cmisatom'  # Alfresco 4.0
+REPOSITORY_URL = 'http://localhost:8080/alfresco/cmisatom'  # Alfresco 4.0
 #REPOSITORY_URL = 'http://localhost:8080/alfresco/s/api/cmis'  # Alfresco
-REPOSITORY_URL = 'http://cmis.demo.nuxeo.org/nuxeo/atom/cmis' # Nuxeo demo
+#REPOSITORY_URL = 'http://cmis.demo.nuxeo.org/nuxeo/atom/cmis' # Nuxeo demo
 #REPOSITORY_URL = 'http://localhost:8080/nuxeo/atom/cmis' # Nuxeo local
 
 # CMIS repository credentials
-#USERNAME = 'admin' # Alfresco
-#PASSWORD = 'admin' # Alfresco
+USERNAME = 'admin' # Alfresco
+PASSWORD = 'admin' # Alfresco
 #USERNAME = ''
 #PASSWORD = ''
-USERNAME = 'Administrator'  # Nuxeo
-PASSWORD = 'Administrator'  # Nuxeo
+#USERNAME = 'Administrator'  # Nuxeo
+#PASSWORD = 'Administrator'  # Nuxeo
 EXT_ARGS = {}
 #EXT_ARGS = {'alf_ticket': 'TICKET_cef29079d8d5341338bf372b08278bc30ec89380'}
 # Absolute path to a directory where test folders can be created, including
 # the trailing slash.
-TEST_ROOT_PATH = '/default-domain/workspaces/cmislib'  # No trailing slash
-#TEST_ROOT_PATH = '/cmislib'  # No trailing slash
+#TEST_ROOT_PATH = '/default-domain/workspaces/cmislib'  # No trailing slash
+TEST_ROOT_PATH = '/cmislib'  # No trailing slash
 #TEST_ROOT_PATH = '/'
 # Binary test files. Assumed to exist in the same dir as this python script
 TEST_BINARY_1 = '250px-Cmis_logo.png'