docstring modifications to adhere to restructuredtext
authordamian
Thu, 11 Dec 2008 17:15:26 +0000
changeset 3028 082f5208644e
parent 3027 702100ee1f8c
child 3029 eded59f94021
docstring modifications to adhere to restructuredtext
setup.py
src/reportlab/graphics/barcode/usps.py
src/reportlab/graphics/renderPDF.py
src/reportlab/graphics/renderPM.py
src/reportlab/graphics/renderSVG.py
src/reportlab/lib/PyFontify.py
src/reportlab/lib/normalDate.py
src/reportlab/lib/rparsexml.py
src/reportlab/lib/sequencer.py
src/reportlab/lib/styles.py
src/reportlab/lib/utils.py
--- a/setup.py	Thu Dec 11 12:08:24 2008 +0000
+++ b/setup.py	Thu Dec 11 17:15:26 2008 +0000
@@ -174,7 +174,6 @@
     INFOLINES.append(t)
 
 reportlab_files= [
-        'extensions/README',
         'fonts/00readme.txt',
         'fonts/bitstream-vera-license.txt',
         'fonts/DarkGarden-copying-gpl.txt',
@@ -367,7 +366,6 @@
             url="http://www.reportlab.com/",
             packages=[
                     'reportlab',
-                    'reportlab.extensions',
                     'reportlab.graphics.charts',
                     'reportlab.graphics.samples',
                     'reportlab.graphics.widgets',
--- a/src/reportlab/graphics/barcode/usps.py	Thu Dec 11 12:08:24 2008 +0000
+++ b/src/reportlab/graphics/barcode/usps.py	Thu Dec 11 17:15:26 2008 +0000
@@ -51,7 +51,7 @@
 }
 
 class FIM(Barcode):
-    """"
+    """
     FIM (Facing ID Marks) encode only one letter.
     There are currently four defined:
 
@@ -144,7 +144,7 @@
         return self.value
 
 class POSTNET(Barcode):
-    """"
+    """
     POSTNET is used in the US to encode "zip codes" (postal codes) on
     mail. It can encode 5, 9, or 11 digit codes. I've read that it's
     pointless to do 5 digits, since USPS will just have to re-print
--- a/src/reportlab/graphics/renderPDF.py	Thu Dec 11 12:08:24 2008 +0000
+++ b/src/reportlab/graphics/renderPDF.py	Thu Dec 11 17:15:26 2008 +0000
@@ -2,9 +2,10 @@
 #see license.txt for license details
 #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/renderPDF.py
 # renderPDF - draws Drawings onto a canvas
-"""Usage:
-    import renderpdf
-    renderpdf.draw(drawing, canvas, x, y)
+"""
+Usage:
+- import renderpdf
+- renderpdf.draw(drawing, canvas, x, y)
 Execute the script to see some test drawings.
 changed
 """
--- a/src/reportlab/graphics/renderPM.py	Thu Dec 11 12:08:24 2008 +0000
+++ b/src/reportlab/graphics/renderPM.py	Thu Dec 11 17:15:26 2008 +0000
@@ -2,9 +2,10 @@
 #see license.txt for license details
 #history www.reportlab.co.uk/rl-cgi/viewcvs.cgi/rlextra/graphics/Csrc/renderPM/renderP.py
 __version__=''' $Id$ '''
-"""Usage:
-    from reportlab.graphics import renderPM
-    renderPM.drawToFile(drawing,filename,fmt='GIF',configPIL={....})
+"""
+Usage:
+- from reportlab.graphics import renderPM
+- renderPM.drawToFile(drawing,filename,fmt='GIF',configPIL={....})
 Other functions let you create a PM drawing as string or into a PM buffer.
 Execute the script to see some test drawings."""
 
@@ -405,7 +406,7 @@
 
     def bezierArcCCW(self, cx,cy, rx,ry, theta0, theta1):
         """return a set of control points for Bezier approximation to an arc
-        with angle increasing counter clockwise. No requirement on |theta1-theta0| <= 90
+        with angle increasing counter clockwise. No requirement on (theta1-theta0) <= 90
         However, it must be true that theta1-theta0 > 0."""
 
         # I believe this is also clockwise
--- a/src/reportlab/graphics/renderSVG.py	Thu Dec 11 12:08:24 2008 +0000
+++ b/src/reportlab/graphics/renderSVG.py	Thu Dec 11 17:15:26 2008 +0000
@@ -214,7 +214,7 @@
         return a copy of string s with special characters in postscript strings
         escaped with backslashes.
         Have not handled characters that are converted normally in python strings
-        i.e. \n -> newline
+        i.e. \\n -> newline
         """
 
         str = string.replace(s, chr(0x5C), r'\\' )
--- a/src/reportlab/lib/PyFontify.py	Thu Dec 11 12:08:24 2008 +0000
+++ b/src/reportlab/lib/PyFontify.py	Thu Dec 11 17:15:26 2008 +0000
@@ -1,16 +1,19 @@
-"""Module to analyze Python source code; for syntax coloring tools.
+"""
+Module to analyze Python source code; for syntax coloring tools.
 
-Interface:
+Interface::
     tags = fontify(pytext, searchfrom, searchto)
 
-The 'pytext' argument is a string containing Python source code.
-The (optional) arguments 'searchfrom' and 'searchto' may contain a slice in pytext.
-The returned value is a list of tuples, formatted like this:
+ - The 'pytext' argument is a string containing Python source code.
+ - The (optional) arguments 'searchfrom' and 'searchto' may contain a slice in pytext.
+ - The returned value is a list of tuples, formatted like this::
     [('keyword', 0, 6, None), ('keyword', 11, 17, None), ('comment', 23, 53, None), etc. ]
-The tuple contents are always like this:
+
+ - The tuple contents are always like this::
     (tag, startindex, endindex, sublist)
-tag is one of 'keyword', 'string', 'comment' or 'identifier'
-sublist is not used, hence always None.
+
+ - tag is one of 'keyword', 'string', 'comment' or 'identifier'
+ - sublist is not used, hence always None.
 """
 
 # Based on FontText.py by Mitchell S. Chapman,
--- a/src/reportlab/lib/normalDate.py	Thu Dec 11 12:08:24 2008 +0000
+++ b/src/reportlab/lib/normalDate.py	Thu Dec 11 17:15:26 2008 +0000
@@ -81,22 +81,38 @@
     Valid NormalDate ranges include (-9999,1,1) B.C.E. through
     (9999,12,31) C.E./A.D.
 
-    1.0 - No changes, except the version number.  After 3 years of use
-            by various parties I think we can consider it stable.
-    0.8 - added Prof. Stephen Walton's suggestion for a range method
-            - module author resisted the temptation to use lambda <0.5 wink>
-    0.7 - added Dan Winkler's suggestions for __add__, __sub__ methods
-    0.6 - modifications suggested by Kevin Digweed to fix:
-            - dayOfWeek, dayOfWeekAbbrev, clone methods
-            - permit NormalDate to be a better behaved superclass
-    0.5 - minor tweaking
-    0.4 - added methods __cmp__, __hash__
-        - added Epoch variable, scoped to the module
-        - added setDay, setMonth, setYear methods
-    0.3 - minor touch-ups
-    0.2 - fixed bug for certain B.C.E leap years
-        - added Jim Fulton's suggestions for short alias class name =ND
-          and __getstate__, __setstate__ methods
+
+    1.0
+        No changes, except the version number.  After 3 years of use by
+        various parties I think we can consider it stable.
+
+    0.8
+        Added Prof. Stephen Walton's suggestion for a range method
+         - module author resisted the temptation to use lambda <0.5 wink>
+
+    0.7
+        Added Dan Winkler's suggestions for __add__, __sub__ methods
+
+    0.6
+        Modifications suggested by Kevin Digweed to fix:
+         - dayOfWeek, dayOfWeekAbbrev, clone methods
+         - Permit NormalDate to be a better behaved superclass
+
+    0.5
+        Minor tweaking
+
+    0.4
+         - Added methods __cmp__, __hash__
+         - Added Epoch variable, scoped to the module
+         - Added setDay, setMonth, setYear methods
+
+    0.3
+        Minor touch-ups
+
+    0.2
+         - Fixed bug for certain B.C.E leap years
+         - Added Jim Fulton's suggestions for short alias class name =ND
+           and __getstate__, __setstate__ methods
 
     Special thanks:  Roedy Green
     """
--- a/src/reportlab/lib/rparsexml.py	Thu Dec 11 12:08:24 2008 +0000
+++ b/src/reportlab/lib/rparsexml.py	Thu Dec 11 17:15:26 2008 +0000
@@ -1,23 +1,23 @@
 """Radically simple xml parsing
 
-Example parse
+Example parse::
 
-<this type="xml">text <b>in</b> xml</this>
+    <this type="xml">text <b>in</b> xml</this>
 
-( "this",
-  {"type": "xml"},
-  [ "text ",
-    ("b", None, ["in"], None),
-    " xml"
-    ]
-   None )
+    ( "this",
+      {"type": "xml"},
+      [ "text ",
+        ("b", None, ["in"], None),
+        " xml"
+        ]
+       None )
 
-{ 0: "this"
-  "type": "xml"
-  1: ["text ",
-      {0: "b", 1:["in"]},
-      " xml"]
-}
+    { 0: "this"
+      "type": "xml"
+      1: ["text ",
+          {0: "b", 1:["in"]},
+          " xml"]
+    }
 
 Ie, xml tag translates to a tuple:
  (name, dictofattributes, contentlist, miscellaneousinfo)
@@ -26,15 +26,15 @@
 (with the intention of adding, eg, line number information)
 
 special cases: name of "" means "top level, no containing tag".
-Top level parse always looks like this
+Top level parse always looks like this::
 
-   ("", list, None, None)
+    ("", list, None, None)
 
  contained text of None means <simple_tag\>
 
-In order to support stuff like
+In order to support stuff like::
 
-   <this></this><one></one>
+    <this></this><one></one>
 
 AT THE MOMENT &amp; ETCETERA ARE IGNORED. THEY MUST BE PROCESSED
 IN A POST-PROCESSING STEP.
--- a/src/reportlab/lib/sequencer.py	Thu Dec 11 12:08:24 2008 +0000
+++ b/src/reportlab/lib/sequencer.py	Thu Dec 11 17:15:26 2008 +0000
@@ -98,7 +98,8 @@
     some counters are reset when their parents.
     It keeps track of a number of
     'counters', which are created on request:
-    Usage:
+    Usage::
+    
         >>> seq = layout.Sequencer()
         >>> seq.next('Bullets')
         1
--- a/src/reportlab/lib/styles.py	Thu Dec 11 12:08:24 2008 +0000
+++ b/src/reportlab/lib/styles.py	Thu Dec 11 17:15:26 2008 +0000
@@ -102,20 +102,26 @@
         #etc. etc.
 
 class StyleSheet1:
-    """This may or may not be used.  The idea is to
+    """
+    This may or may not be used.  The idea is to:
+    
     1. slightly simplify construction of stylesheets;
+    
     2. enforce rules to validate styles when added
        (e.g. we may choose to disallow having both
        'heading1' and 'Heading1' - actual rules are
        open to discussion);
+       
     3. allow aliases and alternate style lookup
        mechanisms
+       
     4. Have a place to hang style-manipulation
        methods (save, load, maybe support a GUI
        editor)
-       Access is via getitem, so they can be
-       compatible with plain old dictionaries.
-       """
+   
+    Access is via getitem, so they can be
+    compatible with plain old dictionaries.
+    """
     def __init__(self):
         self.byName = {}
         self.byAlias = {}
--- a/src/reportlab/lib/utils.py	Thu Dec 11 12:08:24 2008 +0000
+++ b/src/reportlab/lib/utils.py	Thu Dec 11 17:15:26 2008 +0000
@@ -694,23 +694,27 @@
 class DebugMemo:
     '''Intended as a simple report back encapsulator
 
-    Typical usages
-    1) To record error data
+    Typical usages:
+        
+    1. To record error data::
+        
         dbg = DebugMemo(fn='dbgmemo.dbg',myVar=value)
         dbg.add(anotherPayload='aaaa',andagain='bbb')
         dbg.dump()
 
-    2) To show the recorded info
+    2. To show the recorded info::
+        
         dbg = DebugMemo(fn='dbgmemo.dbg',mode='r')
         dbg.load()
         dbg.show()
 
-    3) To re-use recorded information
+    3. To re-use recorded information::
+        
         dbg = DebugMemo(fn='dbgmemo.dbg',mode='r')
             dbg.load()
         myTestFunc(dbg.payload('myVar'),dbg.payload('andagain'))
 
-    in addition to the payload variables the dump records many useful bits
+    In addition to the payload variables the dump records many useful bits
     of information which are also printed in the show() method.
     '''
     def __init__(self,fn='rl_dbgmemo.dbg',mode='w',getScript=1,modules=(),capture_traceback=1, stdout=None, **kw):