[Checkins] SVN: z3c.widget/trunk/ - Added doctests to ``long_description`` to be visible on PyPI.

Michael Howitz mh at gocept.com
Tue Nov 16 02:37:14 EST 2010


Log message for revision 118419:
  - Added doctests to ``long_description`` to be visible on PyPI.
  - Fixed REST to be consistent.
  
  

Changed:
  U   z3c.widget/trunk/CHANGES.txt
  U   z3c.widget/trunk/setup.py
  U   z3c.widget/trunk/src/z3c/widget/dateselect/README.txt
  U   z3c.widget/trunk/src/z3c/widget/image/README.txt
  U   z3c.widget/trunk/src/z3c/widget/optdropdown/README.txt
  U   z3c.widget/trunk/src/z3c/widget/sequence/README.txt
  U   z3c.widget/trunk/src/z3c/widget/ssn/README.txt
  U   z3c.widget/trunk/src/z3c/widget/usphone/README.txt

-=-
Modified: z3c.widget/trunk/CHANGES.txt
===================================================================
--- z3c.widget/trunk/CHANGES.txt	2010-11-15 19:22:22 UTC (rev 118418)
+++ z3c.widget/trunk/CHANGES.txt	2010-11-16 07:37:13 UTC (rev 118419)
@@ -12,6 +12,7 @@
  - Using Python's ``doctest`` module instead of depreacted
    ``zope.testing.doctest[unit]``.
 
+ - Added doctests to ``long_description`` to be visible on PyPI.
 
 2008/01/29 0.2.1
 ================

Modified: z3c.widget/trunk/setup.py
===================================================================
--- z3c.widget/trunk/setup.py	2010-11-15 19:22:22 UTC (rev 118418)
+++ z3c.widget/trunk/setup.py	2010-11-16 07:37:13 UTC (rev 118419)
@@ -1,6 +1,11 @@
 #!python
 from setuptools import setup, find_packages
+import os.path
 
+def read(*path_elements):
+    return "\n\n" + file(os.path.join(*path_elements)).read()
+
+
 setup(name='z3c.widget',
       version='0.3.0dev',
       author = "Zope Community",
@@ -9,6 +14,23 @@
       license = "ZPL 2.1",
       keywords = "zope zope3 form formlib",
       url='http://svn.zope.org/z3c.widget',
+      long_description=(
+          '.. contents::\n\n' +
+          read('CHANGES.txt') +
+          read('src', 'z3c', 'widget', 'autocomplete', 'README.txt') +
+          read('src', 'z3c', 'widget', 'autocomplete', 'demo', 'README.txt') +
+          read('src', 'z3c', 'widget', 'country', 'README.txt') +
+          read('src', 'z3c', 'widget', 'dateselect', 'README.txt') +
+          read('src', 'z3c', 'widget', 'dropdowndatewidget', 'README.txt') +
+          read('src', 'z3c', 'widget', 'flashupload', 'README.txt') +
+          read('src', 'z3c', 'widget', 'image', 'README.txt') +
+          read('src', 'z3c', 'widget', 'namespace', 'README.txt') +
+          read('src', 'z3c', 'widget', 'optdropdown', 'README.txt') +
+          read('src', 'z3c', 'widget', 'sequence', 'README.txt') +
+          read('src', 'z3c', 'widget', 'ssn', 'README.txt') +
+          read('src', 'z3c', 'widget', 'tiny', 'README.txt') +
+          read('src', 'z3c', 'widget', 'usphone', 'README.txt')
+          ),
       zip_safe=False,
       packages=find_packages('src'),
       include_package_data=True,

Modified: z3c.widget/trunk/src/z3c/widget/dateselect/README.txt
===================================================================
--- z3c.widget/trunk/src/z3c/widget/dateselect/README.txt	2010-11-15 19:22:22 UTC (rev 118418)
+++ z3c.widget/trunk/src/z3c/widget/dateselect/README.txt	2010-11-16 07:37:13 UTC (rev 118419)
@@ -82,7 +82,7 @@
 
 
 ``setRenderedValue(value)`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+==================================
 
 The first method is ``setRenderedValue()``. The widget has two use cases,
 based on the type of value. If the value is a custom score system, it will
@@ -104,7 +104,7 @@
 
 
 ``setPrefix(prefix)`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+============================
 
 The prefix determines the name of the widget and all its sub-widgets.
 
@@ -143,7 +143,7 @@
 
 
 ``getInputValue()`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+==========================
 
 This method returns a date object:
 
@@ -181,7 +181,7 @@
 
 
 ``applyChanges(content)`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+================================
 
 This method applies the new date to the passed content. However, it
 must be smart enough to detect whether the values really changed.
@@ -206,7 +206,7 @@
 
 
 ``hasInput()`` Method
-~~~~~~~~~~~~~~~~~~~~~
+=====================
 
 This method checks for any input, but does not validate it.
 
@@ -243,7 +243,7 @@
 
 
 ``hasValidInput()`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+==========================
 
 Additionally to checking for any input, this method also checks whether the
 input is valid:
@@ -281,7 +281,7 @@
 
 
 ``hidden()`` Method
-~~~~~~~~~~~~~~~~~~~
+===================
 
 This method is renders the output as hidden fields:
 
@@ -300,7 +300,7 @@
 
 
 ``error()`` Method
-~~~~~~~~~~~~~~~~~~
+==================
 
 Let's test some bad data and check the error handling.
 
@@ -375,7 +375,7 @@
 
 
 ``__call__()`` Method
-~~~~~~~~~~~~~~~~~~~~~
+=====================
 
 This method renders the widget using the sub-widgets. Let's see the output:
 

Modified: z3c.widget/trunk/src/z3c/widget/image/README.txt
===================================================================
--- z3c.widget/trunk/src/z3c/widget/image/README.txt	2010-11-15 19:22:22 UTC (rev 118418)
+++ z3c.widget/trunk/src/z3c/widget/image/README.txt	2010-11-16 07:37:13 UTC (rev 118419)
@@ -8,7 +8,7 @@
 
 
 Adding an Image
----------------
+===============
 
   >>> import zope.schema
   >>> from zope.publisher.browser import TestRequest
@@ -36,6 +36,7 @@
 
 Send the request without any image information. the empty field
 should not be changed...
+
   >>> request = TestRequest(form={'field.image' : u''})
   >>> widget = ImageWidget(field, request)
   >>> widget._getFormInput() is None
@@ -43,6 +44,7 @@
 
 Send some Image information to the field. the image information
 should be stored in the field as a Image Object
+
   >>> request = TestRequest(form={'field.image' : u'PNG123Test'})
   >>> widget = ImageWidget(field, request)
   >>> widget._getFormInput()
@@ -51,6 +53,7 @@
 
 Now we save the field again, but without any new image data.
 the old image information should not be lost
+
   >>> obj.image = Image(u'PNG123Test')
   >>> request = TestRequest(form={'field.image' : u''})
   >>> widget = ImageWidget(field, request)
@@ -58,13 +61,13 @@
   True
 
 Now we want to delete the image. the forminput should be None now.
+
   >>> request = TestRequest(form={'field.image' : u'',
   ...     'field.image.delete': u'true'})
   >>> widget = ImageWidget(field, request)
   >>> widget._getFormInput() is None
   True
 
-
   >>> print widget()
   <div class="z3cImageWidget">
     <input type="file" name="field.image" id="field.image" /><br/>
@@ -72,5 +75,5 @@
   </div>
 
 
-  
 
+

Modified: z3c.widget/trunk/src/z3c/widget/optdropdown/README.txt
===================================================================
--- z3c.widget/trunk/src/z3c/widget/optdropdown/README.txt	2010-11-15 19:22:22 UTC (rev 118418)
+++ z3c.widget/trunk/src/z3c/widget/optdropdown/README.txt	2010-11-16 07:37:13 UTC (rev 118419)
@@ -68,7 +68,7 @@
 
 
 ``setRenderedValue(value)`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+==================================
 
 The first method is ``setRenderedValue()``. The widget has two use cases,
 based on the type of value. If the value is a custom value, it will
@@ -102,7 +102,7 @@
 
 
 ``setPrefix(prefix)`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+============================
 
 The prefix determines the name of the widget and the sub-widgets.
 
@@ -124,7 +124,7 @@
 
 
 ``getInputValue()`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+==========================
 
 This method returns a value based on the input; the data is assumed to
 be valid. In our case that means, if we entered a custom value, it is
@@ -151,7 +151,7 @@
 
 
 ``applyChanges(content)`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+================================
 
 This method applies the new value to the passed content. However, it
 must be smart enough to detect whether the values really changed.
@@ -183,7 +183,7 @@
 
 
 ``hasInput()`` Method
-~~~~~~~~~~~~~~~~~~~~~
+=====================
 
 This mehtod checks for any input, but does not validate it. In our case this
 means that either a choice has been selected or the the custom value has been
@@ -208,7 +208,7 @@
 
 
 ``hasValidInput()`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+==========================
 
 Additionally to checking for any input, this method also checks whether the
 input is valid:
@@ -244,7 +244,7 @@
 
 
 hidden() Method
-~~~~~~~~~~~~~~~
+===============
 
 This method is implemented by simply concatenating the two widget's hidden
 output:
@@ -267,7 +267,7 @@
 
 
 error() Method
-~~~~~~~~~~~~~~
+==============
 
 Again, we have our two cases. If an error occured in the dropdown, it is
 reported:
@@ -322,10 +322,10 @@
 
 
 __call__() Method
-~~~~~~~~~~~~~~~~~
+=================
 
 This method renders the widget using the sub-widgets. It simply adds the two
-widgets' output placing the ``connector between them:
+widgets' output placing the ``connector`` between them:
 
   >>> request = TestRequest(form={
   ...     'field.occupation.custom': u'Teacher'})

Modified: z3c.widget/trunk/src/z3c/widget/sequence/README.txt
===================================================================
--- z3c.widget/trunk/src/z3c/widget/sequence/README.txt	2010-11-15 19:22:22 UTC (rev 118418)
+++ z3c.widget/trunk/src/z3c/widget/sequence/README.txt	2010-11-16 07:37:13 UTC (rev 118419)
@@ -17,11 +17,11 @@
  * Submitting the form and using the Back button of the browser does not work.
 
 WARNING!
-~~~~~~~~
+========
 The subobject MUST have subwidgets. That is usually the case if the subobject
 is based on zope.schema.Object.
 
 TODO
-~~~~
+====
 Tests.
 Some are there, some are copied from z.a.form.browser and need fix.
\ No newline at end of file

Modified: z3c.widget/trunk/src/z3c/widget/ssn/README.txt
===================================================================
--- z3c.widget/trunk/src/z3c/widget/ssn/README.txt	2010-11-15 19:22:22 UTC (rev 118418)
+++ z3c.widget/trunk/src/z3c/widget/ssn/README.txt	2010-11-16 07:37:13 UTC (rev 118419)
@@ -52,7 +52,7 @@
 
 
 ``setRenderedValue(value)`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+==================================
 
 The first method is ``setRenderedValue()``. The widget has two use cases,
 based on the type of value:
@@ -69,7 +69,7 @@
 
 
 ``setPrefix(prefix)`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+============================
 
 The prefix determines the name of the widget and all its sub-widgets.
 
@@ -108,7 +108,7 @@
 
 
 ``getInputValue()`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+==========================
 
 This method returns the full SSN string:
 
@@ -142,7 +142,7 @@
 
 
 ``applyChanges(content)`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+================================
 
 This method applies the new SSN to the passed content. However, it
 must be smart enough to detect whether the values really changed.
@@ -167,7 +167,7 @@
 
 
 ``hasInput()`` Method
-~~~~~~~~~~~~~~~~~~~~~
+=====================
 
 This method checks for any input, but does not validate it.
 
@@ -204,7 +204,7 @@
 
 
 ``hasValidInput()`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+==========================
 
 Additionally to checking for any input, this method also checks whether the
 input is valid:
@@ -242,7 +242,7 @@
 
 
 ``hidden()`` Method
-~~~~~~~~~~~~~~~~~~~
+===================
 
 This method is renders the output as hidden fields:
 
@@ -261,7 +261,7 @@
 
 
 ``error()`` Method
-~~~~~~~~~~~~~~~~~~
+==================
 
 Let's test some bad data and check the error handling.
 
@@ -321,7 +321,7 @@
 
 
 ``__call__()`` Method
-~~~~~~~~~~~~~~~~~~~~~
+=====================
 
 This method renders the widget using the sub-widgets. Let's see the output:
 

Modified: z3c.widget/trunk/src/z3c/widget/usphone/README.txt
===================================================================
--- z3c.widget/trunk/src/z3c/widget/usphone/README.txt	2010-11-15 19:22:22 UTC (rev 118418)
+++ z3c.widget/trunk/src/z3c/widget/usphone/README.txt	2010-11-16 07:37:13 UTC (rev 118419)
@@ -52,7 +52,7 @@
 
 
 ``setRenderedValue(value)`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+==================================
 
 The first method is ``setRenderedValue()``. The widget has two use cases,
 based on the type of value:
@@ -69,7 +69,7 @@
 
 
 ``setPrefix(prefix)`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+============================
 
 The prefix determines the name of the widget and all its sub-widgets.
 
@@ -108,7 +108,7 @@
 
 
 ``getInputValue()`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+==========================
 
 This method returns the full phone string:
 
@@ -142,7 +142,7 @@
 
 
 ``applyChanges(content)`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+================================
 
 This method applies the new phone number to the passed content. However, it
 must be smart enough to detect whether the values really changed.
@@ -167,7 +167,7 @@
 
 
 ``hasInput()`` Method
-~~~~~~~~~~~~~~~~~~~~~
+=====================
 
 This method checks for any input, but does not validate it.
 
@@ -204,7 +204,7 @@
 
 
 ``hasValidInput()`` Method
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+==========================
 
 Additionally to checking for any input, this method also checks whether the
 input is valid:
@@ -242,7 +242,7 @@
 
 
 ``hidden()`` Method
-~~~~~~~~~~~~~~~~~~~
+===================
 
 This method is renders the output as hidden fields:
 
@@ -261,7 +261,7 @@
 
 
 ``error()`` Method
-~~~~~~~~~~~~~~~~~~
+==================
 
 Let's test some bad data and check the error handling.
 
@@ -324,7 +324,7 @@
 
 
 ``__call__()`` Method
-~~~~~~~~~~~~~~~~~~~~~
+=====================
 
 This method renders the widget using the sub-widgets. Let's see the output:
 



More information about the checkins mailing list