Commits

Thomas Lotze committed 244e412 Draft

Applied most of the conventions of ``tl.pkg`` to the package source.

Comments (0)

Files changed (23)

 
 bin
 build
-buildout.cfg
 develop-eggs
 dist
-doc/ophelia.*
 eggs
 .installed.cfg
+local.cfg
 parts
     https://bitbucket.org/tlotze/ophelia/raw/tip/CHANGES.txt
 
 :Support the project:
-   .. image:: flattr-badge-large.png
+   .. image:: http://api.flattr.com/button/flattr-badge-large.png
        :alt: Flattr this
        :target:
           http://flattr.com/thing/515106/Ophelia-build-web-sites-from-templates-with-zero-code-repetition
-=======
-Changes
-=======
+======================
+Change log for Ophelia
+======================
 
 0.4 (unreleased)
 ================
 - Use Python's own ``doctest`` module for tests, got rid of using
   zope.testing's deprecated fork of it and thus the zope.testing dependency.
 
+- Applied most of the conventions of ``tl.pkg`` to the package source.
+
 - Made sure that HTTP response headers are of type ``str``.
 
 - Fixed the locale setting for date formatting introduced in 0.3.5.
-Copyright (c) 2005-2008 Thomas Lotze
+Copyright (c) 2005-2012 Thomas Lotze
 All Rights Reserved.
 
 This software is subject to the provisions of the Zope Public License,
-===================
-Overview of Ophelia
-===================
+===================================================================
+Ophelia – build a web site from templates with zero code repetition
+===================================================================
 
 Ophelia creates XHTML pages from templates written in TAL, the Zope Template
 Attribute Language. It is designed to reduce code repetition to zero.

base.cfg

-[buildout]
-extends = versions/versions.cfg
-develop = .
-parts =
-    ophelia
-    test
-    sphinx
-    example-wsgiref-cfg
-    example-paster-server
-    example-paster-ini
-unzip = true
-
-[ophelia]
-recipe = zc.recipe.egg
-eggs = ophelia
-       tl.eggdeps
-interpreter = py
-
-[test]
-recipe = zc.recipe.testrunner
-eggs = ophelia [test]
-defaults = ["-v", "-c", "-s", "ophelia"]
-
-[sphinx]
-recipe = zc.recipe.egg
-eggs = sphinx
-       repoze.sphinx.autointerface
-       pkginfo
-       ophelia
-scripts = sphinx-build
-arguments = argv=sys.argv+("-E -c doc/ -d build/sphinx/doctrees"
-                           " . build/sphinx/html/").split()
-
-[example-config]
-example_dir = ${buildout:directory}/example
-host = localhost
-port = 2080
-
-[example-wsgiref-cfg]
-recipe = collective.recipe.template
-input = ${:example_dir}/wsgiref.cfg.in
-output = ${buildout:parts-directory}/example/wsgiref.cfg
-<= example-config
-
-[example-paster-server]
-recipe = zc.recipe.egg
-eggs = ophelia
-       PasteDeploy
-       PasteScript
-scripts = paster
-
-[example-paster-ini]
-recipe = collective.recipe.template
-input = ${:example_dir}/paste.ini.in
-output = ${buildout:parts-directory}/example/paste.ini
-<= example-config
+[buildout]
+extends = versions/versions.cfg
+develop = .
+parts =
+    ophelia
+    test
+    doc
+    example-wsgiref-cfg
+    example-paster-server
+    example-paster-ini
+unzip = true
+
+[ophelia]
+recipe = zc.recipe.egg
+eggs = ophelia
+       tl.eggdeps
+interpreter = py
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = ophelia [test]
+
+[doc]
+recipe = zc.recipe.egg
+eggs =
+    tl.pkg [doc]
+    ophelia
+    repoze.sphinx.autointerface
+scripts = doc
+
+[example-config]
+example_dir = ${buildout:directory}/example
+host = localhost
+port = 2080
+
+[example-wsgiref-cfg]
+recipe = collective.recipe.template
+input = ${:example_dir}/wsgiref.cfg.in
+output = ${buildout:parts-directory}/example/wsgiref.cfg
+<= example-config
+
+[example-paster-server]
+recipe = zc.recipe.egg
+eggs = ophelia
+       PasteDeploy
+       PasteScript
+scripts = paster
+
+[example-paster-ini]
+recipe = collective.recipe.template
+input = ${:example_dir}/paste.ini.in
+output = ${buildout:parts-directory}/example/paste.ini
+<= example-config

buildout.cfg.example

-[buildout]
-extends = base.cfg
-
-[ophelia]
-host = 127.0.0.1
-port = 2080
-site = http://localhost:2080/
 .. include:: ../ABOUT.txt
-
-
-====
-
-
-.. toctree::
-
-    ../ROADMAP.txt
-    ../CHANGES.txt
-
-
-====
-
-
 .. literalinclude:: ../COPYRIGHT.txt
 .. literalinclude:: ../LICENSE.txt
 
+=============
+API reference
+=============
+
+.. autosummary::
+    :toctree: ./_api/
+
+    ophelia.request
+    ophelia.input
+    ophelia.pagetemplate
+    ophelia.util
+    ophelia.wsgi
+
+
+.. Local Variables:
+.. mode: rst
+.. End:
+.. include:: ../CHANGES.txt
-# -*- coding: utf-8 -*-
-#
-# documentation build configuration file
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# The contents of this file are pickled, so don't put values in the namespace
-# that aren't pickleable (module imports are okay, they're removed automatically).
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
+# coding: utf-8
+# Copyright (c) 2012 Thomas Lotze
+# See also LICENSE.txt
 
-import sys, os
-import datetime
-import pkginfo
+import os
+import os.path
+import tl.pkg.sphinxconf
 
-dist = pkginfo.Develop('..')
 
-# If your extensions are in another directory, add it 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('.'))
+_year_started = 2006
+_bitbucket_name = 'ophelia'
 
-# General configuration
-# ---------------------
+# XXX We need to hack around the assumption of a namespaced package made by
+# tl.pkg 0.1.
 
-# 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.autosummary', 'repoze.sphinx.autointerface']
+tl.pkg.sphinxconf.link_text_files_from_source = lambda project: None
 
-autosummary_generate = ['doc/modules.txt']
+tl.pkg.sphinxconf.set_defaults()
 
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['templates']
+for name in os.listdir(os.path.join('..', project)):
+    if not name.endswith('txt'):
+        continue
+    os.symlink(os.path.join('..', project, name),
+               '%s-%s' % (project, name))
 
-# The suffix of source filenames.
-source_suffix = '.txt'
+# XXX hack ends here
 
-# The encoding of source files.
-#source_encoding = 'utf-8'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = dist.name
-copyright = u'2006-%s %s' % (datetime.date.today().year, dist.author)
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = []
-for x in dist.version:
-    try:
-        version.append(str(int(x)))
-    except ValueError:
-        break
-version = '.'.join(version)
-# The full version, including alpha/beta/rc tags.
-release = dist.version
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# 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 = ['ABOUT', 'COPYRIGHT', 'LICENSE']
-
-# List of directories, relative to source directory, that shouldn't be searched
-# for source files.
-exclude_trees = ['build', 'parts', dist.name+'.egg-info', 'example', '.hg']
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# Options for HTML output
-# -----------------------
-
-# The style sheet to use for HTML and HTML Help pages. A file of that name
-# must exist either in Sphinx' static/ path, or in one of the custom paths
-# given in html_static_path.
-html_style = 'default.css'
-
-# The name for this set of Sphinx documents.  If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar.  Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-#html_static_path = ['static']
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-html_sidebars = {
-    '**': ['project-links.html', 'localtoc.html', 'relations.html',
-           'sourcelink.html', 'searchbox.html'],
-}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_use_modindex = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, the reST sources are included in the HTML build as _sources/<name>.
-#html_copy_source = 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 = ''
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = dist.name + '-doc'
-
-
-# Options for LaTeX output
-# ------------------------
-
-# The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
-
-# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, document class [howto/manual]).
-latex_documents = [
-  ('README', dist.name+'.tex', dist.name+ur' Documentation',
-   dist.author, 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_use_modindex = True
+extensions.append('repoze.sphinx.autointerface')
+==============================
+Ophelia documentation contents
+==============================
+
+.. toctree::
+    :maxdepth: 2
+
+    overview
+    ophelia-CONFIGURATION
+    ophelia-API
+
+    narrative
+    interfaces
+    api
+
+    about
+    roadmap
+    changes
+
+
+.. Local Variables:
+.. mode: rst
+.. End:

doc/interfaces.txt

 Interface definitions
 =====================
 
-:mod:`ophelia.interfaces` -- Public interfaces used in Ophelia
-==============================================================
+Public interfaces used in Ophelia
+=================================
 
 .. automodule:: ophelia.interfaces
     :synopsis: Public interfaces used in Ophelia.

doc/modules.txt

-=======
-Modules
-=======
-
-.. autosummary::
-    :toctree: ./
-
-    ophelia.request
-    ophelia.input
-    ophelia.pagetemplate
-    ophelia.util
-    ophelia.wsgi
-
-
-.. Local Variables:
-.. mode: rst
-.. End:

doc/narrative.txt

+=======================
+Narrative documentation
+=======================
+
+.. toctree::
+    :maxdepth: 2
+
+    ophelia-request
+    ophelia-input
+    ophelia-pagetemplate
+    ophelia-util
+
+
+.. Local Variables:
+.. mode: rst
+.. End:
+.. include:: ../README.txt

doc/requirements.pip

+pkginfo
+sphinxcontrib-cheeseshop
+sphinxcontrib-issuetracker
+tl.pkg
+.. include:: ../ROADMAP.txt

doc/unittests.txt

-==========
-Unit tests
-==========
-
-.. toctree::
-    :maxdepth: 2
-    :glob:
-
-    ../ophelia/request
-    ../ophelia/input
-    ../ophelia/pagetemplate
-    ../ophelia/util
-
-
-.. Local Variables:
-.. mode: rst
-.. End:

index.txt

-Ophelia documentation contents
-==============================
-
-.. toctree::
-    :maxdepth: 2
-
-    README
-    ophelia/CONFIGURATION
-    ophelia/API
-
-    doc/interfaces
-    doc/modules
-    doc/unittests
-
-    doc/about
-
-
-Indices and tables
-==================
-
-- :ref:`genindex`
-- :ref:`modindex`
-- :ref:`search`
-
-
-.. Local Variables:
-.. mode: rst
-.. End:
 # Copyright (c) 2006-2012 Thomas Lotze
 # See also LICENSE.txt
 
+# This should be only one line. If it must be multi-line, indent the second
+# line onwards to keep the PKG-INFO file format intact.
 """Ophelia builds a web site from TAL templates with zero code repetition.
 """
 
 import sys
 
 
-project_path = lambda *names: os.path.join(os.path.dirname(__file__), *names)
+def project_path(*names):
+    return os.path.join(os.path.dirname(__file__), *names)
+
 
 longdesc = "\n\n".join((open(project_path("README.txt")).read(),
                         open(project_path("ABOUT.txt")).read()))
 
-root_files = glob.glob(project_path("*.txt"))
-data_files = [("", [name for name in root_files
-                    if os.path.split(name)[1] != "index.txt"])]
+entry_points = """\
+    [console_scripts]
+    ophelia-wsgiref = ophelia.wsgi:wsgiref_server
 
-entry_points = {
-    "console_scripts": [
-    "ophelia-wsgiref = ophelia.wsgi:wsgiref_server",
-    ],
-    'paste.app_factory': [
-        'main=ophelia.wsgi:paste_app_factory',
-        ],
-    }
+    [paste.app_factory]
+    main = ophelia.wsgi:paste_app_factory
+"""
 
 install_requires = [
     "xsendfile",
 """[:-1].split('\n')
 
 setup(name="ophelia",
-      version="0.4dev",
+      version="0.4.dev0",
       description=__doc__.strip(),
       long_description=longdesc,
       keywords="web template xhtml tal",
       install_requires=install_requires,
       extras_require=extras_require,
       include_package_data=True,
-      data_files=data_files,
+      data_files=[('', glob.glob(project_path('*.txt')))],
       zip_safe=False,
       )

versions/versions.cfg

 distribute = 0.6.32
 pkginfo = 0.9.1
 repoze.sphinx.autointerface = 0.7.1
+requests = 1.0.4
 sphinx = 1.1.3
+sphinxcontrib-cheeseshop = 0.2
+sphinxcontrib-issuetracker = 0.10.1
 tl.eggdeps = 0.4
+tl.pkg = 0.1
 webtest = 1.4.3
 xsendfile = 1.0a2
 zc.buildout = 1.6.3