Anonymous avatar Anonymous committed 4fa270f Merge

After incorporating Yarko's changes ... I think

Comments (0)

Files changed (14)

Add a comment to this file

Python3PatternsIdioms.pdf

Binary file added.

src/Contributors.rst

 
   * And of course, Guido and the team for their incessant improvement of Python,
     especially for taking the risk in breaking backward compatibility in Python
-    3.0 to refactor the language.
+    3.0 to refactor the language.
+ 
+
+===============================================================================
+
+.. todo:: Yarko (example label of ToDo):
+
+    - update CSS styles for todo's & todo lists;
+    - look at http://sphinx.pocoo.org/ext/coverage.html for example.
+    - Autogenerated ToDoLists do not appear in LaTeX output - debug, fix;
+    - DONE:
+      - ToDo does not appear to be created by make dependencies (it's autogenerated);
+      - update Makefile to always re-generate todo lists;
+     
+
+

src/DeveloperGuide.rst

 
 to see the options.
 
+.. todo:: The remainder of this document needs rewriting. Rewrite this section for BitBucket & Mercurial; make some project specific diagrams;
 Working with BitBucket and Mercurial
+
 ===============================================================================
 
-.. note::   The remainder of this document needs rewriting.
+.. note:: Adapted from a posting by Yarko Tymciurak
 
-(Adapted from a posting by Yarko T)
 
 This assumes that you have created a local branch on your private machine where
 you do work, and keep it merged with the trunk.
 
 That is, you've done:
 
+   - Forked a branch of http://www.bitbucket.org/BruceEckel/python-3-patterns-idioms/ (the main trunk; this fork will provide a place for review and comment)
+   - cloned the trunk to your local machine:
+     - hg clone https://my_login@bitbucket.org/BruceEckel/python-3-patterns-idioms/
+   - cloned your local copy of trunk to create a working directory:
+     - hg clone python-3-patterns-idioms devel
+
+.. ToDo:: This section still work in progress:
+
    - ``hg branch lp:python3patterns``
    - ``hg commit -m 'initial checkout'``
    - (hack, hack, hack....)
 
 When you are ready to share your work have others review, register a branch.
 
-.. note:: Once you create a branch, there is no easy way to remove it.
 
 .. note:: You can re-use one branch for multiple bug fixes.
 
 	#mkdir -p _build/html _build/doctrees
 	#$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html
 	mkdir -p ../html _build/doctrees
+	# force rebuild; since it's autogenerated, it's never "out of date":
+	rm ../html/ToDo.html
 	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) ../html
 	@echo
 	@echo "Build finished. The HTML pages are in ../html."
+
+ToDo List
+---------
+
+Currently, this doesn't seem to link into the index, as I'd hoped.
+
+
+   - Refine "Printed Book" and "Translations"
+   - Code extractor for rst files (maybe part of intro chapter?)
+   - Code updater to put code in/refresh code into book.
+
+   - Move frontmatter into its own directory
+
+   - <!> Seems to be a warning sign (but initial tests didn't work)
+
+   - Idea: decorator on a dictionary object, to turn it into an ordered dictionary.
+
+   - "Other resources" at the end of each chapter
+
+   - For print version, convert hyperlinks into footnotes.
+
+       - build tool for this, or check int rst handling of this - see if it works with Sphinx;
+
+
+
+The remainder are from context, from the book.
+--------------------------------------------------------------------------------
+
+.. todolist::
+
Add a comment to this file

src/_static/LaunchpadBrand.pdf

Binary file added.

Add a comment to this file

src/_static/LaunchpadLogo.pdf

Binary file added.

Binary file added.

 # All configuration values have a default value; values that are commented out
 # serve to show the default value.
 
-import sys, os
+import sys, os, re
 
 # If your extensions are in another directory, add it here. If the directory
 # is relative to the book root, use os.path.abspath to make it
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = []
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, document class [howto/manual]).
 latex_documents = [
-  ('index', 'Python3PatternsIdioms.tex', u'Python 3 Patterns & Idioms book',
+  ('index', 'Python3PatternsIdioms.tex', u'Python 3 Patterns \& Idioms book',
    u'Bruce Eckel', 'manual'),
 ]
 
 # The name of an image file (relative to this directory) to place at the top of
 # the title page.
-#latex_logo = None
+latex_logo = '_static/Logo.png'
 
 # For "manual" documents, if this is true, then toplevel headings are parts,
 # not chapters.
 
 # Additional stuff for the LaTeX preamble.
 #latex_preamble = ''
+latex_elements = {
+    'fontpkg': '\\usepackage{palatino}'
+}
 
 # Documents to append as an appendix to all manuals.
 #latex_appendices = []
 
 # If false, no module index is generated.
 #latex_use_modindex = True
+
+
+# Extension options
+# -----------------
+
+todo_include_todos = True
+todo_all_todos = True
+
+# Extension interface
+# -------------------
+
+from sphinx import addnodes
+
+dir_sig_re = re.compile(r'\.\. ([^:]+)::(.*)$')
+
+def parse_directive(env, sig, signode):
+    if not sig.startswith('.'):
+        dec_sig = '.. %s::' % sig
+        signode += addnodes.desc_name(dec_sig, dec_sig)
+        return sig
+    m = dir_sig_re.match(sig)
+    if not m:
+        signode += addnodes.desc_name(sig, sig)
+        return sig
+    name, args = m.groups()
+    dec_name = '.. %s::' % name
+    signode += addnodes.desc_name(dec_name, dec_name)
+    signode += addnodes.desc_addname(args, args)
+    return name
+
+
+def parse_role(env, sig, signode):
+    signode += addnodes.desc_name(':%s:' % sig, ':%s:' % sig)
+    return sig
+
+
+event_sig_re = re.compile(r'([a-zA-Z-]+)\s*\((.*)\)')
+
+def parse_event(env, sig, signode):
+    m = event_sig_re.match(sig)
+    if not m:
+        signode += addnodes.desc_name(sig, sig)
+        return sig
+    name, args = m.groups()
+    signode += addnodes.desc_name(name, name)
+    plist = addnodes.desc_parameterlist()
+    for arg in args.split(','):
+        arg = arg.strip()
+        plist += addnodes.desc_parameter(arg, arg)
+    signode += plist
+    return name
+
+
+def setup(app):
+    from sphinx.ext.autodoc import cut_lines
+    app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))
+    app.add_description_unit('directive', 'dir', 'pair: %s; directive', parse_directive)
+    app.add_description_unit('role', 'role', 'pair: %s; role', parse_role)
+    app.add_description_unit('confval', 'confval', 'pair: %s; configuration value')
+    app.add_description_unit('event', 'event', 'pair: %s; event', parse_event)
 
 .. toctree::
 
-   Contributors.rst
-   NoteToReaders.rst
-   Introduction.rst
-   TeachingSupport.rst
-   Rules.rst
-   DeveloperGuide.rst
-   Part1.rst
-   quickPython.rst
-   unitTesting.rst
-   LanguageChanges.rst
-   PythonDecorators.rst
-   GeneratorsIterators.rst
-   Comprehensions.rst
-   CoroutinesAndConcurrency.rst
-   jython.rst
-   Part2.rst
-   MachineDiscovery.rst
-   CanonicalScript.rst
-   Part3.rst
-   patternConcept.rst
-   singleton.rst
-   appFrameworks.rst
-   fronting.rst
-   stateMachine.rst
-   decorator.rst
-   iterators.rst
-   factory.rst
-   functionObjects.rst
-   changeInterface.rst
-   tableDriven.rst
-   observer.rst
-   multipleDispatching.rst
-   visitor.rst
-   patternRefactoring.rst
-   projects.rst
+   Contributors
+   ToDo
+   NoteToReaders
+   Introduction
+   TeachingSupport
+   Rules
+   DeveloperGuide
+   Part1
+   quickPython
+   unitTesting
+   LanguageChanges
+   PythonDecorators
+   GeneratorsIterators
+   Comprehensions
+   CoroutinesAndConcurrency
+   jython
+   Part2
+   MachineDiscovery
+   CanonicalScript
+   Part3
+   patternConcept
+   singleton
+   appFrameworks
+   fronting
+   stateMachine
+   decorator
+   iterators
+   factory
+   functionObjects
+   changeInterface
+   tableDriven
+   observer
+   multipleDispatching
+   visitor
+   patternRefactoring
+   projects
 
 Indices and tables
 ==================
Add a comment to this file

winhelp/Python3PatternsIdiomsdoc.chm

Binary file modified.

winhelp/Python3PatternsIdiomsdoc.hhc

 </OBJECT>
 </UL>
 <LI> <OBJECT type="text/sitemap">
+    <param name="Name" value="ToDo List">
+    <param name="Local" value="ToDo.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
+    <param name="Name" value="The remainder are from context, from the book.">
+    <param name="Local" value="ToDo.html#the-remainder-are-from-context-from-the-book">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
     <param name="Name" value="A Note To Readers">
     <param name="Local" value="NoteToReaders.html">
 </OBJECT>
     <param name="Name" value="Building the Book">
     <param name="Local" value="DeveloperGuide.html#building-the-book">
 </OBJECT>
-<LI> <OBJECT type="text/sitemap">
-    <param name="Name" value="Working with BitBucket and Mercurial">
-    <param name="Local" value="DeveloperGuide.html#working-with-bitbucket-and-mercurial">
-</OBJECT>
 </UL>
 <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="Part I: Foundations">
     <param name="Name" value="Coroutines &amp; Concurrency">
     <param name="Local" value="CoroutinesAndConcurrency.html">
 </OBJECT>
+<UL>
+<LI> <OBJECT type="text/sitemap">
+    <param name="Name" value="Further Reading">
+    <param name="Local" value="CoroutinesAndConcurrency.html#further-reading">
+</OBJECT>
+</UL>
 <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="Jython">
     <param name="Local" value="jython.html">

winhelp/Python3PatternsIdiomsdoc.hhk

 <UL>
 <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="@: Python decorators">
-    <param name="Local" value="PythonDecorators.html#index-5">
+    <param name="Local" value="PythonDecorators.html#index-8">
 </OBJECT>
 <UL> <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="script command-line">
 </OBJECT>
 </UL><LI> <OBJECT type="text/sitemap">
     <param name="Name" value="concurrency">
-    <param name="Local" value="CoroutinesAndConcurrency.html#index-2">
+    <param name="Local" value="CoroutinesAndConcurrency.html#index-3">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="coroutines">
-    <param name="Local" value="CoroutinesAndConcurrency.html#index-2">
+    <param name="Local" value="CoroutinesAndConcurrency.html#index-3">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="decorator: Python decorators">
-    <param name="Local" value="PythonDecorators.html#index-5">
+    <param name="Local" value="PythonDecorators.html#index-8">
 </OBJECT>
 <UL> <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="comprehension">
 </OBJECT>
 </UL><LI> <OBJECT type="text/sitemap">
     <param name="Name" value="generators">
-    <param name="Local" value="GeneratorsIterators.html#index-3">
+    <param name="Local" value="GeneratorsIterators.html#index-6">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="GIL: Global Interpreter Lock">
-    <param name="Local" value="CoroutinesAndConcurrency.html#index-2">
+    <param name="Local" value="CoroutinesAndConcurrency.html#index-3">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="iterators">
-    <param name="Local" value="GeneratorsIterators.html#index-3">
+    <param name="Local" value="GeneratorsIterators.html#index-6">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="itertools">
-    <param name="Local" value="GeneratorsIterators.html#index-3">
+    <param name="Local" value="GeneratorsIterators.html#index-6">
 </OBJECT>
 <UL> <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="Python 3">
-    <param name="Local" value="LanguageChanges.html#index-4">
+    <param name="Local" value="LanguageChanges.html#index-7">
 </OBJECT>
 </UL><UL> <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="comprehension">
 </OBJECT>
 </UL><LI> <OBJECT type="text/sitemap">
     <param name="Name" value="multiprocessing">
-    <param name="Local" value="CoroutinesAndConcurrency.html#index-2">
+    <param name="Local" value="CoroutinesAndConcurrency.html#index-3">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="parallelism">
-    <param name="Local" value="CoroutinesAndConcurrency.html#index-2">
+    <param name="Local" value="CoroutinesAndConcurrency.html#index-3">
 </OBJECT>
 <UL> <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="Language differences">
-    <param name="Local" value="LanguageChanges.html#index-4">
+    <param name="Local" value="LanguageChanges.html#index-7">
 </OBJECT>
 </UL><UL> <LI> <OBJECT type="text/sitemap">
     <param name="Name" value="command-line canonical form">
 </OBJECT>
 </UL><LI> <OBJECT type="text/sitemap">
     <param name="Name" value="threads">
-    <param name="Local" value="CoroutinesAndConcurrency.html#index-2">
+    <param name="Local" value="CoroutinesAndConcurrency.html#index-3">
 </OBJECT>
 </UL>

winhelp/Python3PatternsIdiomsdoc.hhp

 stateMachine.html
 tableDriven.html
 TeachingSupport.html
+ToDo.html
 unitTesting.html
 visitor.html
 _static\contents.png
 _static\default.css
 _static\favicon.ico
 _static\file.png
+_static\LaunchpadBrand.pdf
 _static\LaunchpadBrand.png
 _static\LaunchpadIcon.png
+_static\LaunchpadLogo.pdf
 _static\LaunchpadLogo.png
+_static\Logo.pdf
 _static\Logo.png
 _static\minus.png
 _static\navigation.png
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.