chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpo...@apache.org
Subject svn commit: r1211514 - in /chemistry/cmislib/trunk: ./ src/cmislib.egg-info/ src/cmislib/ src/doc/src/ src/tests/
Date Wed, 07 Dec 2011 16:28:31 GMT
Author: jpotts
Date: Wed Dec  7 16:28:30 2011
New Revision: 1211514

URL: http://svn.apache.org/viewvc?rev=1211514&view=rev
Log:
Whitespace and documentation cleanup in preparation for the 0.5 release

Modified:
    chemistry/cmislib/trunk/setup.cfg
    chemistry/cmislib/trunk/src/cmislib.egg-info/PKG-INFO
    chemistry/cmislib/trunk/src/cmislib/model.py
    chemistry/cmislib/trunk/src/doc/src/about.rst
    chemistry/cmislib/trunk/src/doc/src/code.rst
    chemistry/cmislib/trunk/src/doc/src/conf.py
    chemistry/cmislib/trunk/src/doc/src/devguide.rst
    chemistry/cmislib/trunk/src/doc/src/examples.rst
    chemistry/cmislib/trunk/src/doc/src/index.rst
    chemistry/cmislib/trunk/src/tests/cmislibtest.py
    chemistry/cmislib/trunk/src/tests/settings.py

Modified: chemistry/cmislib/trunk/setup.cfg
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/setup.cfg?rev=1211514&r1=1211513&r2=1211514&view=diff
==============================================================================
--- chemistry/cmislib/trunk/setup.cfg (original)
+++ chemistry/cmislib/trunk/setup.cfg Wed Dec  7 16:28:30 2011
@@ -18,4 +18,4 @@
 #
 
 [egg_info]
-tag_build = dev
+tag_build = 

Modified: chemistry/cmislib/trunk/src/cmislib.egg-info/PKG-INFO
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/cmislib.egg-info/PKG-INFO?rev=1211514&r1=1211513&r2=1211514&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/cmislib.egg-info/PKG-INFO (original)
+++ chemistry/cmislib/trunk/src/cmislib.egg-info/PKG-INFO Wed Dec  7 16:28:30 2011
@@ -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

Modified: chemistry/cmislib/trunk/src/cmislib/model.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/cmislib/model.py?rev=1211514&r1=1211513&r2=1211514&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/cmislib/model.py (original)
+++ chemistry/cmislib/trunk/src/cmislib/model.py Wed Dec  7 16:28:30 2011
@@ -384,9 +384,10 @@ class Repository(object):
         """
         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 @@ class Repository(object):
 
         """
         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 @@ class Repository(object):
 
         return parentFolder.createDocument(name, properties, StringIO.StringIO(contentString),
             contentType, contentEncoding)
-        
+
     def createDocument(self,
                        name,
                        properties={},
@@ -1193,7 +1194,7 @@ class Repository(object):
         # 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 @@ class ResultSet(object):
         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 @@ class CmisObject(object):
 
         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 @@ class CmisObject(object):
         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 @@ class CmisObject(object):
         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 @@ class CmisObject(object):
         """
 
         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 @@ class CmisObject(object):
                     if relAttr == rel:
                         return linkElement.attributes['href'].value
 
-    
-
     allowableActions = property(getAllowableActions)
     name = property(getName)
     id = property(getObjectId)
@@ -2560,7 +2565,7 @@ class Document(CmisObject):
             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 @@ class Document(CmisObject):
         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 @@ class Document(CmisObject):
         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 @@ class Folder(CmisObject):
 
         The following optional arguments *may* also work but haven't been
         tested:
+
          - filter
          - includeRelationships
          - renditionFilter
@@ -3031,9 +3037,9 @@ class Folder(CmisObject):
 
         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 @@ class ChangeEntry(object):
         """
         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 @@ def getEntryXmlDoc(repo=None, objectType
                 # 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 @@ def getEntryXmlDoc(repo=None, objectType
 
     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):

Modified: chemistry/cmislib/trunk/src/doc/src/about.rst
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/doc/src/about.rst?rev=1211514&r1=1211513&r2=1211514&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/doc/src/about.rst (original)
+++ chemistry/cmislib/trunk/src/doc/src/about.rst Wed Dec  7 16:28:30 2011
@@ -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 @@ The library is being developed with the 
 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 @@ Miscellaneous
 Renditions
  * getRenditions
 
-Change history
- * change token
-
 Unfiling/multifiling support
  * createDocument without a parent folder (unfiled)
 

Modified: chemistry/cmislib/trunk/src/doc/src/code.rst
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/doc/src/code.rst?rev=1211514&r1=1211513&r2=1211514&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/doc/src/code.rst (original)
+++ chemistry/cmislib/trunk/src/doc/src/code.rst Wed Dec  7 16:28:30 2011
@@ -24,6 +24,12 @@ The :mod:`cmislib.model` Module
 
 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 @@ The :mod:`cmislib.net` Module contains t
 .. 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.

Modified: chemistry/cmislib/trunk/src/doc/src/conf.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/doc/src/conf.py?rev=1211514&r1=1211513&r2=1211514&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/doc/src/conf.py (original)
+++ chemistry/cmislib/trunk/src/doc/src/conf.py Wed Dec  7 16:28:30 2011
@@ -35,6 +35,7 @@ import sys, os
 # 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 @@ source_suffix = '.rst'
 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_static_path = ['_static']
 #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 @@ htmlhelp_basename = 'CMISLibrarydoc'
 # 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

Modified: chemistry/cmislib/trunk/src/doc/src/devguide.rst
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/doc/src/devguide.rst?rev=1211514&r1=1211513&r2=1211514&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/doc/src/devguide.rst (original)
+++ chemistry/cmislib/trunk/src/doc/src/devguide.rst Wed Dec  7 16:28:30 2011
@@ -37,27 +37,45 @@ Checklist:
  #. 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
+ #. Inline comments updated with changes
+ #. Sphinx doc updated with changes
+ #. Docs build cleanly
+     .. code-block:: bash
+
+        cd src/doc/src/
+        make html
+
  #. pep8 runs without much complaint
-     * pep8 --ignore=E501,W601 --repeat model.py
+     .. code-block:: bash
+
+        pep8 --ignore=E501,W601 --repeat model.py
 
  #. pylint runs without much complaint
-     * pylint --disable-msg=C0103,R0904,R0913,C0301,W0511 cmislibtest.py
+     .. code-block:: bash
 
- #. Inline comments updated with changes
- #. Sphinx doc updated with changes
- #. Docs built cleanly
-     * cd src/doc/src/
-     * make html
-
- #. Setuptools build
-     * python setup.py bdist sdist
-     * Use release script to sign files
+        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
 
- #. Copy files to Apache, start vote
- #. If vote passes, copy files to Apache dist
+    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
 

Modified: chemistry/cmislib/trunk/src/doc/src/examples.rst
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/doc/src/examples.rst?rev=1211514&r1=1211513&r2=1211514&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/doc/src/examples.rst (original)
+++ chemistry/cmislib/trunk/src/doc/src/examples.rst Wed Dec  7 16:28:30 2011
@@ -36,7 +36,7 @@ Get a Repository object
 
  #. 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
 

Modified: chemistry/cmislib/trunk/src/doc/src/index.rst
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/doc/src/index.rst?rev=1211514&r1=1211513&r2=1211514&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/doc/src/index.rst (original)
+++ chemistry/cmislib/trunk/src/doc/src/index.rst Wed Dec  7 16:28:30 2011
@@ -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:
 

Modified: chemistry/cmislib/trunk/src/tests/cmislibtest.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/tests/cmislibtest.py?rev=1211514&r1=1211513&r2=1211514&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/tests/cmislibtest.py (original)
+++ chemistry/cmislib/trunk/src/tests/cmislibtest.py Wed Dec  7 16:28:30 2011
@@ -39,7 +39,7 @@ my_dir = os.path.dirname(os.path.abspath
 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 @@ class RepositoryTest(CmisTestBase):
 #        '''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 @@ if __name__ == "__main__":
 #    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

Modified: chemistry/cmislib/trunk/src/tests/settings.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/trunk/src/tests/settings.py?rev=1211514&r1=1211513&r2=1211514&view=diff
==============================================================================
--- chemistry/cmislib/trunk/src/tests/settings.py (original)
+++ chemistry/cmislib/trunk/src/tests/settings.py Wed Dec  7 16:28:30 2011
@@ -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'



Mime
View raw message