Cleaned up minor code formatting issues, upgraded sphinx for doc generation which required merging of Makefile and src/doc/src/conf.py, removed 'dev' tag from setup.cfg and doc conf.py to prepare for release.
git-svn-id: https://svn.apache.org/repos/asf/chemistry/cmislib/trunk@1422152 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/net.py b/src/cmislib/net.py
index 93c9420..11a757a 100644
--- a/src/cmislib/net.py
+++ b/src/cmislib/net.py
@@ -130,10 +130,10 @@
# add a user-agent
request.add_header('User-Agent', self.user_agent)
if headers:
- for k,v in headers.items():
- self.logger.debug('Adding header:%s:%s' % (k,v))
+ for k, v in headers.items():
+ self.logger.debug('Adding header:%s:%s' % (k, v))
request.add_header(k, v)
-
+
# create a password manager
passwordManager = HTTPPasswordMgrWithDefaultRealm()
passwordManager.add_password(None, url, username, password)
@@ -166,8 +166,8 @@
# add a user-agent
request.add_header('User-Agent', self.user_agent)
if headers:
- for k,v in headers.items():
- self.logger.debug('Adding header:%s:%s' % (k,v))
+ for k, v in headers.items():
+ self.logger.debug('Adding header:%s:%s' % (k, v))
request.add_header(k, v)
# create a password manager
@@ -221,8 +221,8 @@
# add a user-agent
request.add_header('User-Agent', self.user_agent)
if headers:
- for k,v in headers.items():
- self.logger.debug('Adding header:%s:%s' % (k,v))
+ for k, v in headers.items():
+ self.logger.debug('Adding header:%s:%s' % (k, v))
request.add_header(k, v)
# create a password manager
@@ -270,8 +270,8 @@
# add a user-agent
request.add_header('User-Agent', self.user_agent)
if headers:
- for k,v in headers.items():
- self.logger.debug('Adding header:%s:%s' % (k,v))
+ for k, v in headers.items():
+ self.logger.debug('Adding header:%s:%s' % (k, v))
request.add_header(k, v)
# create a password manager
diff --git a/src/doc/src/Makefile b/src/doc/src/Makefile
index 2f1b8cf..0139530 100644
--- a/src/doc/src/Makefile
+++ b/src/doc/src/Makefile
@@ -23,7 +23,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
-SPHINXBUILD = sphinx-build-2.6
+SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = ../build
SOURCEDIR = .
@@ -31,36 +31,52 @@
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/.doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
-.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)."
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@@ -82,16 +98,64 @@
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/CMISLibrary.qhcp"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/MyTestProject.qhcp"
@echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/CMISLibrary.qhc"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/MyTestProject.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/MyTestProject"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/MyTestProject"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
- "run these through (pdf)latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
diff --git a/src/doc/src/about.rst b/src/doc/src/about.rst
index f8ed9b6..00697ad 100644
--- a/src/doc/src/about.rst
+++ b/src/doc/src/about.rst
@@ -17,7 +17,7 @@
under the License.
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.
The library is being developed with the following guidelines:
@@ -45,9 +45,6 @@
* getProperties filter
* getContentStream stream id
-Renditions
- * getRenditions
-
Unfiling/multifiling support
* createDocument without a parent folder (unfiled)
diff --git a/src/doc/src/code.rst b/src/doc/src/code.rst
index c6687ce..04db5b6 100644
--- a/src/doc/src/code.rst
+++ b/src/doc/src/code.rst
@@ -53,10 +53,10 @@
.. automodule:: cmislib.net
:members: RESTService
-The :mod:`cmislib` Module
+The :mod:`tests` 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.
+The :mod:`tests` Module contains unit tests for all classes and methods in :mod:`cmislib.model`. See :ref:`tests` for more information on running tests.
-.. automodule:: tests.cmislibtest
+.. automodule:: tests
:members:
diff --git a/src/doc/src/conf.py b/src/doc/src/conf.py
index bfdd806..ea6d54e 100644
--- a/src/doc/src/conf.py
+++ b/src/doc/src/conf.py
@@ -18,7 +18,7 @@
# under the License.
#
# CMIS Library documentation build configuration file, created by
-# sphinx-quickstart on Thu Dec 10 10:12:43 2009.
+# sphinx-quickstart on Fri Dec 14 16:13:15 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
@@ -33,15 +33,17 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.append(os.path.abspath('.'))
+#sys.path.insert(0, os.path.abspath('.'))
sys.path.append(os.path.abspath('../..'))
-#sys.path.append(os.path.abspath('../../tests'))
# -- General configuration -----------------------------------------------------
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage']
+extensions = ['sphinx.ext.autodoc']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -50,14 +52,14 @@
source_suffix = '.rst'
# The encoding of source files.
-#source_encoding = 'utf-8'
+#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Apache Chemistry cmislib'
-copyright = u'2011, Apache Software Foundation'
+copyright = u'2013, 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
@@ -66,7 +68,7 @@
# The short X.Y version.
version = '0.5'
# The full version, including alpha/beta/rc tags.
-release = '0.5'
+release = '0.5.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -78,12 +80,9 @@
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
-# List of documents that shouldn't be included in the build.
-#unused_docs = []
-
-# List of directories, relative to source directory, that shouldn't be searched
-# for source files.
-exclude_trees = ['_build']
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
@@ -108,8 +107,8 @@
# -- Options for HTML output ---------------------------------------------------
-# The theme to use for HTML and HTML Help pages. Major themes that come with
-# Sphinx are currently 'default' and 'sphinxdoc'.
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
@@ -157,7 +156,7 @@
#html_additional_pages = {}
# If false, no module index is generated.
-#html_use_modindex = True
+#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
@@ -168,13 +167,19 @@
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
-# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = ''
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'cmislibdoc'
@@ -182,11 +187,16 @@
# -- Options for LaTeX output --------------------------------------------------
-# The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
@@ -203,11 +213,91 @@
# not chapters.
#latex_use_parts = False
-# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
-#latex_use_modindex = True
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'cmislib', u'Apache Chemistry cmislib Documentation',
+ [u'Jeff Potts'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ ('index', 'cmislib', u'Apache Chemistry cmislib Documentation',
+ u'Jeff Potts', 'cmislib', 'Python client library for CMIS',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+
+# -- Options for Epub output ---------------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title = u'Apache Chemistry cmislib Documentation'
+epub_author = u'Jeff Potts'
+epub_publisher = u'Jeff Potts'
+epub_copyright = u'2013, Apache Software Foundation'
+
+# The language of the text. It defaults to the language option
+# or en if the language is not set.
+#epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+#epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#epub_identifier = ''
+
+# A unique identification for the text.
+#epub_uid = ''
+
+# A tuple containing the cover image and cover page html template filenames.
+#epub_cover = ()
+
+# HTML files that should be inserted before the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_pre_files = []
+
+# HTML files shat should be inserted after the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_post_files = []
+
+# A list of files that should not be packed into the epub file.
+#epub_exclude_files = []
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#epub_tocdup = True
diff --git a/src/doc/src/devguide.rst b/src/doc/src/devguide.rst
index 0f75992..b959e7f 100644
--- a/src/doc/src/devguide.rst
+++ b/src/doc/src/devguide.rst
@@ -53,7 +53,7 @@
#. pylint runs without much complaint
.. code-block:: bash
- pylint --disable-msg=C0103,R0904,R0913,C0301,W0511 cmislibtest.py
+ pylint --disable=C0103,R0904,R0913,C0301,W0511 cmislibtest.py
#. All changes checked in
#. Tag the release using 'cmislib-[release num]-RC[x]'
diff --git a/src/tests/__init__.py b/src/tests/__init__.py
index c8c8a64..a716331 100644
--- a/src/tests/__init__.py
+++ b/src/tests/__init__.py
@@ -16,4 +16,4 @@
# specific language governing permissions and limitations
# under the License.
#
-
+from cmislibtests import *
diff --git a/src/tests/cmislibtest.py b/src/tests/cmislibtest.py
index 225eaae..a45e5fb 100644
--- a/src/tests/cmislibtest.py
+++ b/src/tests/cmislibtest.py
@@ -26,7 +26,6 @@
from cmislib.model import CmisClient, ACE
from cmislib.exceptions import \
ObjectNotFoundException, \
- PermissionDeniedException, \
CmisException, \
NotSupportedException
from cmislib import messages
@@ -330,7 +329,6 @@
'''Create test objects (one folder, one document) then try to get
them by path'''
# names of folders and test docs
- testFolderName = self._testFolder.getName()
parentFolderName = 'testGetObjectByPath folder'
subFolderName = 'subfolder'
docName = 'testdoc'
@@ -1448,13 +1446,13 @@
#unittest.TextTestRunner().run(tts)
#import sys; sys.exit(0)
- # tts.addTests(TestLoader().loadTestsFromTestCase(CmisClientTest))
- # tts.addTests(TestLoader().loadTestsFromTestCase(RepositoryTest))
- # tts.addTests(TestLoader().loadTestsFromTestCase(FolderTest))
- # tts.addTests(TestLoader().loadTestsFromTestCase(DocumentTest))
- # tts.addTests(TestLoader().loadTestsFromTestCase(TypeTest))
- # tts.addTests(TestLoader().loadTestsFromTestCase(ACLTest))
- # tts.addTests(TestLoader().loadTestsFromTestCase(ChangeEntryTest))
+ tts.addTests(TestLoader().loadTestsFromTestCase(CmisClientTest))
+ tts.addTests(TestLoader().loadTestsFromTestCase(RepositoryTest))
+ tts.addTests(TestLoader().loadTestsFromTestCase(FolderTest))
+ tts.addTests(TestLoader().loadTestsFromTestCase(DocumentTest))
+ tts.addTests(TestLoader().loadTestsFromTestCase(TypeTest))
+ tts.addTests(TestLoader().loadTestsFromTestCase(ACLTest))
+ tts.addTests(TestLoader().loadTestsFromTestCase(ChangeEntryTest))
# tts.addTests(TestLoader().loadTestsFromName('testCreateDocumentFromString', RepositoryTest))
# tts.addTests(TestLoader().loadTestsFromName('testCreateDocumentFromString', DocumentTest))
@@ -1466,7 +1464,7 @@
# tts.addTests(TestLoader().loadTestsFromName('testFolderLeadingDot', FolderTest))
# tts.addTests(TestLoader().loadTestsFromName('testGetObjectParents', DocumentTest))
# tts.addTests(TestLoader().loadTestsFromName('testGetObjectParentsMultiple', DocumentTest))
- tts.addTests(TestLoader().loadTestsFromName('testRenditions', DocumentTest))
+# tts.addTests(TestLoader().loadTestsFromName('testRenditions', DocumentTest))
# WARNING: Potentially long-running tests
diff --git a/src/tests/settings.py b/src/tests/settings.py
index 1321987..7e87525 100644
--- a/src/tests/settings.py
+++ b/src/tests/settings.py
@@ -22,15 +22,15 @@
#
# 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/chemistry/atom' # Apache Chemistry
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://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