Changeset 7819 for main/waeup.kofa/trunk/src/waeup/kofa/utils
- Timestamp:
- 8 Mar 2012, 22:28:46 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/utils
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py
r7811 r7819 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """K OFAcomponents for batch processing.18 """Kofa components for batch processing. 19 19 20 20 Batch processors eat CSV files to add, update or remove large numbers -
main/waeup.kofa/trunk/src/waeup/kofa/utils/converters.txt
r7811 r7819 10 10 11 11 .. :NOdoctest: 12 .. :NOlayer: waeup.kofa.testing.K OFAUnitTestLayer12 .. :NOlayer: waeup.kofa.testing.KofaUnitTestLayer 13 13 14 14 … … 672 672 '1' 673 673 674 >>> from waeup.kofa.interfaces import SimpleK OFAVocabulary674 >>> from waeup.kofa.interfaces import SimpleKofaVocabulary 675 675 >>> field = Choice( 676 676 ... title = u'Favourite Dish', 677 677 ... default = 0, 678 ... vocabulary = SimpleK OFAVocabulary(678 ... vocabulary = SimpleKofaVocabulary( 679 679 ... ('N/A', 0), ('Pizza', 1), 680 680 ... ('Cake', 2), ('Muffins', 3)), -
main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py
r7811 r7819 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """General helper functions for K OFA.18 """General helper functions for Kofa. 19 19 """ 20 20 import os -
main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.txt
r7811 r7819 1 :mod:`waeup.kofa.utils.helpers` -- Helpers for K OFA1 :mod:`waeup.kofa.utils.helpers` -- Helpers for Kofa 2 2 *************************************************** 3 3 4 4 .. module:: waeup.kofa.utils.helpers 5 5 6 Helper functions for K OFA.6 Helper functions for Kofa. 7 7 8 8 .. :doctest: -
main/waeup.kofa/trunk/src/waeup/kofa/utils/importexport.py
r7811 r7819 22 22 from cStringIO import StringIO 23 23 from zope.interface import Interface 24 from waeup.kofa.interfaces import (IK OFAObject, IKOFAExporter,25 IK OFAXMLExporter, IKOFAXMLImporter)24 from waeup.kofa.interfaces import (IKofaObject, IKofaExporter, 25 IKofaXMLExporter, IKofaXMLImporter) 26 26 27 27 def readFile(f): … … 40 40 41 41 class Exporter(grok.Adapter): 42 """Export a K OFAobject as pickle.42 """Export a Kofa object as pickle. 43 43 44 44 This all-purpose exporter exports attributes defined in schemata 45 45 and contained objects (if the exported thing is a container). 46 46 """ 47 grok.context(IK OFAObject)48 grok.provides(IK OFAExporter)47 grok.context(IKofaObject) 48 grok.provides(IKofaExporter) 49 49 50 50 def __init__(self, context): … … 61 61 62 62 class XMLExporter(grok.Adapter): 63 """Export a K OFAobject as XML.63 """Export a Kofa object as XML. 64 64 65 65 This all-purpose exporter exports XML representations of pickable … … 67 67 """ 68 68 grok.context(Interface) 69 grok.provides(IK OFAXMLExporter)69 grok.provides(IKofaXMLExporter) 70 70 71 71 def __init__(self, context): … … 84 84 85 85 class XMLImporter(grok.Adapter): 86 """Import a K OFAobject from XML.86 """Import a Kofa object from XML. 87 87 """ 88 88 grok.context(Interface) 89 grok.provides(IK OFAXMLImporter)89 grok.provides(IKofaXMLImporter) 90 90 91 91 def __init__(self, context): -
main/waeup.kofa/trunk/src/waeup/kofa/utils/importexport.txt
r7811 r7819 6 6 7 7 .. :doctest: 8 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer8 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 9 9 10 10 As imports and exports of data are a cruical point when doing updates … … 60 60 an exporter:: 61 61 62 >>> from waeup.kofa.interfaces import IK OFAXMLExporter63 >>> exporter = IK OFAXMLExporter(mycave)62 >>> from waeup.kofa.interfaces import IKofaXMLExporter 63 >>> exporter = IKofaXMLExporter(mycave) 64 64 >>> exporter 65 65 <waeup.kofa.utils.importexport.XMLExporter object at 0x...> … … 101 101 Now we create an importer for that object: 102 102 103 >>> from waeup.kofa.interfaces import IK OFAXMLImporter104 >>> importer = IK OFAXMLImporter(mycave)103 >>> from waeup.kofa.interfaces import IKofaXMLImporter 104 >>> importer = IKofaXMLImporter(mycave) 105 105 106 106 Importing from filenames -
main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_converters.py
r7811 r7819 36 36 from waeup.kofa.utils.converters import IObjectConverter 37 37 from waeup.kofa.utils.helpers import attrs_to_fields 38 from waeup.kofa.interfaces import SimpleK OFAVocabulary39 40 colors = SimpleK OFAVocabulary(38 from waeup.kofa.interfaces import SimpleKofaVocabulary 39 40 colors = SimpleKofaVocabulary( 41 41 ('Red', u'red'), 42 42 ('Green', u'green'), 43 43 ('Blue', u'blue'), 44 44 ) 45 car_nums = SimpleK OFAVocabulary(45 car_nums = SimpleKofaVocabulary( 46 46 ('None', 0), 47 47 ('One', 1), -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r7811 r7819 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """General helper utilities for K OFA.18 """General helper utilities for Kofa. 19 19 """ 20 20 import os … … 23 23 from zope.i18n import translate 24 24 from random import SystemRandom as r 25 from waeup.kofa.interfaces import IK OFAUtils25 from waeup.kofa.interfaces import IKofaUtils 26 26 from waeup.kofa.interfaces import MessageFactory as _ 27 27 from waeup.kofa.smtp import send_mail as send_mail_internally … … 37 37 return True 38 38 39 class K OFAUtils(grok.GlobalUtility):39 class KofaUtils(grok.GlobalUtility): 40 40 """A collection of parameters and methods subject to customization. 41 41 """ 42 grok.implements(IK OFAUtils)42 grok.implements(IKofaUtils) 43 43 # This the only place where we define the portal language 44 44 # which is used for the translation of system messages … … 161 161 Returns True or False to indicate successful operation. 162 162 """ 163 subject = 'Your K OFAcredentials'163 subject = 'Your Kofa credentials' 164 164 text = _(u"""Dear ${a}, 165 165
Note: See TracChangeset for help on using the changeset viewer.