[Checkins] SVN: zc.sourcefactory/trunk/src/zc/sourcefactory/ remove
improper use of '::' in reST
Benji York
benji at zope.com
Wed Apr 9 11:33:31 EDT 2008
Log message for revision 85193:
remove improper use of '::' in reST
Changed:
U zc.sourcefactory/trunk/src/zc/sourcefactory/README.txt
U zc.sourcefactory/trunk/src/zc/sourcefactory/browser/README.txt
U zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt
U zc.sourcefactory/trunk/src/zc/sourcefactory/mapping.txt
-=-
Modified: zc.sourcefactory/trunk/src/zc/sourcefactory/README.txt
===================================================================
--- zc.sourcefactory/trunk/src/zc/sourcefactory/README.txt 2008-04-09 15:24:03 UTC (rev 85192)
+++ zc.sourcefactory/trunk/src/zc/sourcefactory/README.txt 2008-04-09 15:33:31 UTC (rev 85193)
@@ -19,21 +19,21 @@
-----------
In the most simple case, you only have to provide a method that returns a list
-of values and derive from `BasicSourceFactory`::
+of values and derive from `BasicSourceFactory`:
>>> import zc.sourcefactory.basic
>>> class MyStaticSource(zc.sourcefactory.basic.BasicSourceFactory):
... def getValues(self):
... return ['a', 'b', 'c']
-When calling the source factory, we get a source::
+When calling the source factory, we get a source:
>>> source = MyStaticSource()
>>> import zope.schema.interfaces
>>> zope.schema.interfaces.ISource.providedBy(source)
True
-The values match our `getValues`-method of the factory::
+The values match our `getValues`-method of the factory:
>>> list(source)
['a', 'b', 'c']
@@ -49,7 +49,7 @@
Sometimes we need context to determine the values. In this case, the
`getValues`-method gets a parameter `context`.
-Let's assume we have a small object containing data to be used by the source::
+Let's assume we have a small object containing data to be used by the source:
>>> class Context(object):
... values = []
@@ -60,13 +60,13 @@
... def getValues(self, context):
... return context.values
-When instanciating, we get a ContextSourceBinder::
+When instanciating, we get a ContextSourceBinder:
>>> binder = MyDynamicSource()
>>> zope.schema.interfaces.IContextSourceBinder.providedBy(binder)
True
-Binding it to a context, we get a source::
+Binding it to a context, we get a source:
>>> context = Context()
>>> source = binder(context)
@@ -76,7 +76,7 @@
>>> list(source)
[]
-Modifying the context also modifies the data in the source::
+Modifying the context also modifies the data in the source:
>>> context.values = [1,2,3,4]
>>> list(source)
@@ -96,7 +96,7 @@
This is useful if you want to have more specific sources (by subclassing) that
share the same basic origin of the data but have different filters applied to
-it::
+it:
>>> class FilteringSource(zc.sourcefactory.basic.BasicSourceFactory):
... def getValues(self):
@@ -107,7 +107,7 @@
>>> list(source)
[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]
-Subclassing modifies the filter, not the original data::
+Subclassing modifies the filter, not the original data:
>>> class OtherFilteringSource(FilteringSource):
... def filterValue(self, value):
@@ -116,14 +116,14 @@
>>> list(source)
[2, 4, 6, 8, 10, 12, 14, 16, 18]
-The "in" operator gets applied also to filtered values::
+The "in" operator gets applied also to filtered values:
>>> 2 in source
True
>>> 3 in source
False
-The "len" also gets applied to filtered values::
+The "len" also gets applied to filtered values:
>>> len(source)
9
@@ -154,21 +154,21 @@
-----------
In the most simple case, you only have to provide a method that returns a list
-of values and derive from `BasicSourceFactory`::
+of values and derive from `BasicSourceFactory`:
>>> import zc.sourcefactory.basic
>>> class MyStaticSource(zc.sourcefactory.basic.BasicSourceFactory):
... def getValues(self):
... return ['a', 'b', 'c']
-When calling the source factory, we get a source::
+When calling the source factory, we get a source:
>>> source = MyStaticSource()
>>> import zope.schema.interfaces
>>> zope.schema.interfaces.ISource.providedBy(source)
True
-The values match our `getValues`-method of the factory::
+The values match our `getValues`-method of the factory:
>>> list(source)
['a', 'b', 'c']
Modified: zc.sourcefactory/trunk/src/zc/sourcefactory/browser/README.txt
===================================================================
--- zc.sourcefactory/trunk/src/zc/sourcefactory/browser/README.txt 2008-04-09 15:24:03 UTC (rev 85192)
+++ zc.sourcefactory/trunk/src/zc/sourcefactory/browser/README.txt 2008-04-09 15:33:31 UTC (rev 85193)
@@ -9,7 +9,7 @@
Simple use
==========
-Let's start with a simple source factory::
+Let's start with a simple source factory:
>>> import zc.sourcefactory.basic
>>> class DemoSource(zc.sourcefactory.basic.BasicSourceFactory):
@@ -19,7 +19,7 @@
>>> list(source)
['a', 'b', 'c', 'd']
-We need a request first, then we can adapt the source to ITerms::
+We need a request first, then we can adapt the source to ITerms:
>>> from zope.publisher.browser import TestRequest
>>> import zope.app.form.browser.interfaces
@@ -30,7 +30,7 @@
>>> terms
<zc.sourcefactory.browser.source.FactoredTerms object at 0x...>
-For each value we get a factored term::
+For each value we get a factored term:
>>> terms.getTerm('a')
<zc.sourcefactory.browser.source.FactoredTerm object at 0x...>
@@ -46,7 +46,7 @@
>>> terms.getTerm(u'\xd3')
<zc.sourcefactory.browser.source.FactoredTerm object at 0x...>
-Our terms are ITitledTokenizedTerm-compatible::
+Our terms are ITitledTokenizedTerm-compatible:
>>> import zope.schema.interfaces
>>> zope.schema.interfaces.ITitledTokenizedTerm.providedBy(
@@ -54,13 +54,13 @@
True
In the most simple case, the title of a term is the string representation of
-the object::
+the object:
>>> terms.getTerm('a').title
u'a'
If an adapter from the value to IDCDescriptiveProperties exists, the title
-will be retrieved from this adapter::
+will be retrieved from this adapter:
>>> import persistent
>>> class MyObject(persistent.Persistent):
@@ -82,7 +82,7 @@
Instead of relying on string representation or IDCDescriptiveProperties
adapters you can specify the `getTitle` method on the source factory to
-determine the title for a value::
+determine the title for a value:
>>> class DemoSourceWithTitles(DemoSource):
... def getTitle(self, value):
@@ -105,7 +105,7 @@
Instead of relying on default adapters to generate tokens for your values, you
can override the `getToken` method on the source factory to determine the
-token for a value::
+token for a value:
>>> class DemoObjectWithToken(object):
... token = None
@@ -130,7 +130,7 @@
>>> terms3.getTerm(o2).token
'two'
-Looking up by the custom tokens works as well::
+Looking up by the custom tokens works as well:
>>> terms3.getValue("one") is o1
True
@@ -150,7 +150,7 @@
Contextual sources
==================
-Let's start with an object that we can use as the context::
+Let's start with an object that we can use as the context:
>>> zip_to_city = {'06112': 'Halle',
... '06844': 'Dessau'}
@@ -167,14 +167,14 @@
>>> sorted(list(source))
['06112', '06844']
-Let's look at the terms::
+Let's look at the terms:
>>> terms = zope.component.getMultiAdapter(
... (source, request), zope.app.form.browser.interfaces.ITerms)
>>> terms
<zc.sourcefactory.browser.source.FactoredContextualTerms object at 0x...>
-For each value we get a factored term with the right title from the context::
+For each value we get a factored term with the right title from the context:
>>> terms.getTerm('06112')
<zc.sourcefactory.browser.source.FactoredTerm object at 0x...>
@@ -187,7 +187,7 @@
>>> terms.getTerm('06844').token
'token-06844'
-And in reverse we can get the value for a given token as well::
+And in reverse we can get the value for a given token as well:
>>> terms.getValue('token-06844')
'06844'
Modified: zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt
===================================================================
--- zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt 2008-04-09 15:24:03 UTC (rev 85192)
+++ zc.sourcefactory/trunk/src/zc/sourcefactory/browser/token.txt 2008-04-09 15:33:31 UTC (rev 85193)
@@ -5,11 +5,11 @@
Tokens are an identifying representation of an object, suitable for
transmission amongs URL-encoded data.
-The sourcefactory package provides a few standard generators for tokens::
+The sourcefactory package provides a few standard generators for tokens:
>>> import zc.sourcefactory.browser.token
-We have generators for strings::
+We have generators for strings:
>>> zc.sourcefactory.browser.token.fromString('somestring')
'1f129c42de5e4f043cbd88ff6360486f'
@@ -39,7 +39,7 @@
'1234'
If an object is persistent but has not been added to a database yet, it will
-be added to the database of it's __parent__::
+be added to the database of it's __parent__:
>>> root = getRootFolder()
>>> p1 = PersistentDummy()
@@ -55,7 +55,7 @@
ValueError: Can not determine OID for <PersistentDummy object at 0x...>
Security proxied objects are unwrapped to get to their oid or connection
-attribute::
+attribute:
>>> from zope.security.proxy import ProxyFactory
>>> p3 = PersistentDummy()
Modified: zc.sourcefactory/trunk/src/zc/sourcefactory/mapping.txt
===================================================================
--- zc.sourcefactory/trunk/src/zc/sourcefactory/mapping.txt 2008-04-09 15:24:03 UTC (rev 85192)
+++ zc.sourcefactory/trunk/src/zc/sourcefactory/mapping.txt 2008-04-09 15:33:31 UTC (rev 85193)
@@ -5,17 +5,17 @@
we want to talk about are properties or computed views on those objects. The
`mapping proxy source` helps us to map a source to a different value space.
-We start out with a source::
+We start out with a source:
>>> source = [1,2,3,4,5]
and we provide a method that maps the values of the original source to the
values we want to see (we map the numbers to the characters in the english
-alphabet)::
+alphabet):
>>> map = lambda x: chr(x+96)
-Now we can create a mapped source::
+Now we can create a mapped source:
>>> from zc.sourcefactory.mapping import ValueMappingSource
>>> mapped_source = ValueMappingSource(source, map)
@@ -28,7 +28,7 @@
>>> 1 in mapped_source
False
-You can also use context-dependent sources::
+You can also use context-dependent sources:
>>> def bindSource(context):
... return [1,2,3,4,5]
More information about the Checkins
mailing list