- Timestamp:
- 13 Nov 2014, 14:40:27 (10 years ago)
- Location:
- main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba
- Files:
-
- 20 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/api.txt
r7811 r11949 1 :mod:`waeup. kofa.utils` -- misc. helpers1 :mod:`waeup.ikoba.utils` -- misc. helpers 2 2 **************************************** 3 3 4 .. module:: waeup. kofa.utils4 .. module:: waeup.ikoba.utils 5 5 6 6 Components and other stuff of general interest. … … 9 9 ========== 10 10 11 The :mod:`waeup. kofa.utils` module provides the following submodules:11 The :mod:`waeup.ikoba.utils` module provides the following submodules: 12 12 13 13 .. toctree:: -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/batching.py
r11947 r11949 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """ Kofa components for batch processing.18 """Ikoba components for batch processing. 19 19 20 20 Batch processors eat CSV files to add, update or remove large numbers … … 37 37 from zope.schema.interfaces import ConstraintNotSatisfied 38 38 from zope.event import notify 39 from waeup. kofa.async import AsyncJob40 from waeup. kofa.interfaces import (39 from waeup.ikoba.async import AsyncJob 40 from waeup.ikoba.interfaces import ( 41 41 IBatchProcessor, FatalCSVError, IObjectConverter, IJobManager, 42 42 ICSVExporter, IGNORE_MARKER, DuplicationError, JOB_STATUS_MAP, … … 563 563 564 564 The real work is done when an instance of this class is put into a 565 queue. See :mod:`waeup. kofa.async` to learn more about565 queue. See :mod:`waeup.ikoba.async` to learn more about 566 566 asynchronous jobs. 567 567 -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/batching.txt
r9739 r11949 1 :mod:`waeup. kofa.utils.batching` -- Batch processing1 :mod:`waeup.ikoba.utils.batching` -- Batch processing 2 2 **************************************************** 3 3 … … 188 188 All we need, is a batch processor now. 189 189 190 >>> from waeup. kofa.utils.batching import BatchProcessor191 >>> from waeup. kofa.interfaces import IGNORE_MARKER190 >>> from waeup.ikoba.utils.batching import BatchProcessor 191 >>> from waeup.ikoba.interfaces import IGNORE_MARKER 192 192 >>> class CaveProcessor(BatchProcessor): 193 193 ... util_name = 'caveprocessor' -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/browser.py
r11947 r11949 22 22 from zope.catalog.interfaces import ICatalog 23 23 from zope.component import queryUtility, getUtility, createObject 24 from waeup. kofa.browser.layout import UtilityView25 from waeup. kofa.interfaces import IObjectHistory24 from waeup.ikoba.browser.layout import UtilityView 25 from waeup.ikoba.interfaces import IObjectHistory 26 26 27 from waeup. kofa.interfaces import IUniversity27 from waeup.ikoba.interfaces import IUniversity 28 28 29 29 class ReindexPage(UtilityView, grok.View): -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/converters.py
r9932 r11949 28 28 from zope.publisher.browser import TestRequest 29 29 from zope.schema.interfaces import IList 30 from waeup. kofa.interfaces import (30 from waeup.ikoba.interfaces import ( 31 31 IObjectConverter, IResultEntryField, IFieldConverter, SubjectSource, 32 32 GradeSource, DELETION_MARKER, IGNORE_MARKER) 33 from waeup. kofa.schema.interfaces import IPhoneNumber34 from waeup. kofa.schoolgrades import ResultEntry33 from waeup.ikoba.schema.interfaces import IPhoneNumber 34 from waeup.ikoba.schoolgrades import ResultEntry 35 35 36 36 class ExtendedCheckBoxWidget(CheckBoxWidget): -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/converters.txt
r7819 r11949 1 :mod:`waeup. kofa.utils.converters` -- Converters1 :mod:`waeup.ikoba.utils.converters` -- Converters 2 2 ************************************************ 3 3 4 .. module:: waeup. kofa.utils.converters4 .. module:: waeup.ikoba.utils.converters 5 5 6 6 Converters for :mod:`zope.schema` based data. … … 10 10 11 11 .. :NOdoctest: 12 .. :NOlayer: waeup. kofa.testing.KofaUnitTestLayer12 .. :NOlayer: waeup.ikoba.testing.IkobaUnitTestLayer 13 13 14 14 … … 21 21 'non-values'. Current setting is: 22 22 23 >>> from waeup. kofa.utils.converters import NONE_STRING_VALUE23 >>> from waeup.ikoba.utils.converters import NONE_STRING_VALUE 24 24 >>> NONE_STRING_VALUE 25 25 '' … … 32 32 ======== 33 33 34 The :mod:`waeup. kofa.utils.converters` module is basically a collection of34 The :mod:`waeup.ikoba.utils.converters` module is basically a collection of 35 35 adapters for field types of :mod:`zope.schema`. 36 36 … … 48 48 `zope.schema.Choice` or similar. 49 49 50 .. method:: provides(waeup. kofa.interfaces.ISchemaTypeConverter)50 .. method:: provides(waeup.ikoba.interfaces.ISchemaTypeConverter) 51 51 52 52 .. method:: _convertValueFromString(string) … … 111 111 .. method:: adapts(zope.schema.IText) 112 112 113 .. method:: provides(waeup. kofa.interfaces.ISchemaTypeConverter)113 .. method:: provides(waeup.ikoba.interfaces.ISchemaTypeConverter) 114 114 115 115 .. method:: fromString(string[, strict=True]) … … 150 150 .. method:: adapts(zope.schema.IBool) 151 151 152 .. method:: provides(waeup. kofa.interfaces.ISchemaTypeConverter)152 .. method:: provides(waeup.ikoba.interfaces.ISchemaTypeConverter) 153 153 154 154 .. method:: fromString(string[, strict=True]) … … 191 191 .. method:: adapts(zope.schema.IInt) 192 192 193 .. method:: provides(waeup. kofa.interfaces.ISchemaTypeConverter)193 .. method:: provides(waeup.ikoba.interfaces.ISchemaTypeConverter) 194 194 195 195 .. method:: fromString(string[, strict=True]) … … 232 232 .. method:: adapts(zope.schema.IChoice) 233 233 234 .. method:: provides(waeup. kofa.interfaces.ISchemaTypeConverter)234 .. method:: provides(waeup.ikoba.interfaces.ISchemaTypeConverter) 235 235 236 236 .. method:: fromString(string[, strict=False]) … … 272 272 ---------------------- 273 273 274 .. autoclass:: waeup. kofa.utils.converters.DateConverter274 .. autoclass:: waeup.ikoba.utils.converters.DateConverter 275 275 :members: 276 276 :inherited-members: … … 294 294 :class:`TextConverter` instance: 295 295 296 >>> from waeup. kofa.utils.converters import TextConverter296 >>> from waeup.ikoba.utils.converters import TextConverter 297 297 >>> converter = TextConverter(field) 298 298 299 299 Or we can just grab a registered adapter: 300 300 301 >>> from waeup. kofa.interfaces import ISchemaTypeConverter301 >>> from waeup.ikoba.interfaces import ISchemaTypeConverter 302 302 >>> converter = ISchemaTypeConverter(field) 303 303 … … 305 305 306 306 >>> converter 307 <waeup. kofa.utils.converters.TextConverter object at 0x...>307 <waeup.ikoba.utils.converters.TextConverter object at 0x...> 308 308 309 309 Now we can convert strings to this type: … … 382 382 :class:`BoolConverter` instance: 383 383 384 >>> from waeup. kofa.utils.converters import BoolConverter384 >>> from waeup.ikoba.utils.converters import BoolConverter 385 385 >>> converter = BoolConverter(field) 386 386 387 387 Or we can just grab a registered adapter: 388 388 389 >>> from waeup. kofa.interfaces import ISchemaTypeConverter389 >>> from waeup.ikoba.interfaces import ISchemaTypeConverter 390 390 >>> converter = ISchemaTypeConverter(field) 391 391 … … 393 393 394 394 >>> converter 395 <waeup. kofa.utils.converters.BoolConverter object at 0x...>395 <waeup.ikoba.utils.converters.BoolConverter object at 0x...> 396 396 397 397 Now we can convert strings to this type: … … 494 494 :class:`IntConverter` instance: 495 495 496 >>> from waeup. kofa.utils.converters import IntConverter496 >>> from waeup.ikoba.utils.converters import IntConverter 497 497 >>> converter = IntConverter(field) 498 498 499 499 Or we can just grab a registered adapter: 500 500 501 >>> from waeup. kofa.interfaces import ISchemaTypeConverter501 >>> from waeup.ikoba.interfaces import ISchemaTypeConverter 502 502 >>> converter = ISchemaTypeConverter(field) 503 503 … … 505 505 506 506 >>> converter 507 <waeup. kofa.utils.converters.IntConverter object at 0x...>507 <waeup.ikoba.utils.converters.IntConverter object at 0x...> 508 508 509 509 Now we can convert strings to this type: … … 597 597 :class:`ChoiceConverter` instance: 598 598 599 >>> from waeup. kofa.utils.converters import ChoiceConverter599 >>> from waeup.ikoba.utils.converters import ChoiceConverter 600 600 >>> converter = ChoiceConverter(field) 601 601 602 602 Or we can just grab a registered adapter: 603 603 604 >>> from waeup. kofa.interfaces import ISchemaTypeConverter604 >>> from waeup.ikoba.interfaces import ISchemaTypeConverter 605 605 >>> converter = ISchemaTypeConverter(field) 606 606 … … 608 608 609 609 >>> converter 610 <waeup. kofa.utils.converters.ChoiceConverter object at 0x...>610 <waeup.ikoba.utils.converters.ChoiceConverter object at 0x...> 611 611 612 612 Now we can convert strings to this type: … … 672 672 '1' 673 673 674 >>> from waeup. kofa.interfaces import SimpleKofaVocabulary674 >>> from waeup.ikoba.interfaces import SimpleIkobaVocabulary 675 675 >>> field = Choice( 676 676 ... title = u'Favourite Dish', 677 677 ... default = 0, 678 ... vocabulary = Simple KofaVocabulary(678 ... vocabulary = SimpleIkobaVocabulary( 679 679 ... ('N/A', 0), ('Pizza', 1), 680 680 ... ('Cake', 2), ('Muffins', 3)), … … 730 730 731 731 We get a converter for this field in the usual way. The 732 :meth:`waeup. kofa.utils.converters.fromString()` method will return one of732 :meth:`waeup.ikoba.utils.converters.fromString()` method will return one of 733 733 the objects if we feed it with ``'Wilma'`` or ``'Fred'``: 734 734 … … 763 763 :class:`IntConverter` instance: 764 764 765 >>> from waeup. kofa.utils.converters import DateConverter765 >>> from waeup.ikoba.utils.converters import DateConverter 766 766 >>> converter = DateConverter(field) 767 767 768 768 Or we can just grab a registered adapter: 769 769 770 >>> from waeup. kofa.interfaces import ISchemaTypeConverter770 >>> from waeup.ikoba.interfaces import ISchemaTypeConverter 771 771 >>> converter = ISchemaTypeConverter(field) 772 772 … … 774 774 775 775 >>> converter 776 <waeup. kofa.utils.converters.DateConverter object at 0x...>776 <waeup.ikoba.utils.converters.DateConverter object at 0x...> 777 777 778 778 Now we can convert strings to this type: -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/countries.py
r8057 r11949 3 3 # This file was automatically generated. Please do not edit 4 4 # 5 from waeup. kofa.interfaces import MessageFactory as _5 from waeup.ikoba.interfaces import MessageFactory as _ 6 6 7 7 COUNTRIES = ( -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/country_helpers.py
r8057 r11949 10 10 them like this:: 11 11 12 $ ./bin/ kofactl debug13 >>> from waeup. kofa.utils.country_helpers import update_list14 >>> from waeup. kofa.utils.country_helpers import update_module12 $ ./bin/ikobactl debug 13 >>> from waeup.ikoba.utils.country_helpers import update_list 14 >>> from waeup.ikoba.utils.country_helpers import update_module 15 15 >>> update_list() 16 16 >>> update_module() … … 34 34 # This file was automatically generated. Please do not edit 35 35 # 36 from waeup. kofa.interfaces import MessageFactory as _36 from waeup.ikoba.interfaces import MessageFactory as _ 37 37 38 38 COUNTRIES = ${COUNTRY_LIST} -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/helpers.py
r11947 r11949 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """General helper functions for Kofa.18 """General helper functions for Ikoba. 19 19 """ 20 20 import unicodecsv as csv # XXX: csv ops should move to dedicated module. … … 160 160 instances of certain classes when called. 161 161 162 In :mod:`waeup. kofa` we use factories extensively for162 In :mod:`waeup.ikoba` we use factories extensively for 163 163 batching. While processing a batch some processors looks up a 164 164 factory to create real-world instances that then get filled with … … 172 172 173 173 >>> import grok 174 >>> from waeup. kofa.utils.helpers import FactoryBase174 >>> from waeup.ikoba.utils.helpers import FactoryBase 175 175 >>> class MyObject(object): 176 176 ... # Some class we want to get instances of. … … 178 178 >>> class MyObjectFactory(FactoryBase): 179 179 ... # This is the factory for MyObject instances 180 ... grok.name(u'waeup. kofa.factory.MyObject')180 ... grok.name(u'waeup.ikoba.factory.MyObject') 181 181 ... factory = MyObject 182 182 … … 185 185 called. The given name must even be unique amongst all utilities 186 186 registered during runtime. While you can pick any name you like 187 you might want to prepend ``waeup. kofa.factory.`` to the name187 you might want to prepend ``waeup.ikoba.factory.`` to the name 188 188 string to make sure it does not clash with names of other 189 189 utilities one day. … … 192 192 freshly defined factory. This executes all the component 193 193 registration stuff we don't want to do ourselves. In daily use 194 this is done automatically on startup of a :mod:`waeup. kofa`194 this is done automatically on startup of a :mod:`waeup.ikoba` 195 195 system. 196 196 197 >>> grok.testing.grok('waeup. kofa.utils.helpers')197 >>> grok.testing.grok('waeup.ikoba.utils.helpers') 198 198 >>> grok.testing.grok_component( 199 199 ... 'MyObjectFactory', MyObjectFactory … … 206 206 207 207 >>> from zope.component import createObject 208 >>> obj = createObject('waeup. kofa.factory.MyObject')208 >>> obj = createObject('waeup.ikoba.factory.MyObject') 209 209 >>> isinstance(obj, MyObject) 210 210 True … … 216 216 >>> from zope.component.interfaces import IFactory 217 217 >>> factory = getUtility( 218 ... IFactory, name='waeup. kofa.factory.MyObject'218 ... IFactory, name='waeup.ikoba.factory.MyObject' 219 219 ... ) 220 220 >>> isinstance(factory, MyObjectFactory) … … 261 261 HTML code: 262 262 263 >>> from waeup. kofa.utils.helpers import ReST2HTML263 >>> from waeup.ikoba.utils.helpers import ReST2HTML 264 264 >>> source = ''' 265 265 ... Headline … … 649 649 `pdf`. 650 650 651 More filetypes (though untested in waeup. kofa) are automatically651 More filetypes (though untested in waeup.ikoba) are automatically 652 652 recognized because we deploy the stdlib `imghdr` library. See this 653 653 module's docs for a complete list of filetypes recognized. -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/helpers.txt
r7819 r11949 1 :mod:`waeup. kofa.utils.helpers` -- Helpers for Kofa1 :mod:`waeup.ikoba.utils.helpers` -- Helpers for Ikoba 2 2 *************************************************** 3 3 4 .. module:: waeup. kofa.utils.helpers5 6 Helper functions for Kofa.4 .. module:: waeup.ikoba.utils.helpers 5 6 Helper functions for Ikoba. 7 7 8 8 .. :doctest: … … 21 21 >>> os.chdir(new_location) 22 22 23 >>> from waeup. kofa.utils.helpers import remove_file_or_directory23 >>> from waeup.ikoba.utils.helpers import remove_file_or_directory 24 24 >>> open('blah', 'wb').write('nonsense') 25 25 >>> 'blah' in os.listdir('.') … … 72 72 >>> open(os.path.join('src', 'blah'), 'wb').write('nonsense') 73 73 74 >>> from waeup. kofa.utils.helpers import copy_filesystem_tree74 >>> from waeup.ikoba.utils.helpers import copy_filesystem_tree 75 75 >>> result = copy_filesystem_tree('src', 'dst') 76 76 … … 179 179 returned with all preceeding/following stuff stripped: 180 180 181 >>> from waeup. kofa.utils.helpers import get_inner_HTML_part181 >>> from waeup.ikoba.utils.helpers import get_inner_HTML_part 182 182 >>> print get_inner_HTML_part("""<html> 183 183 ... <head> -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/importexport.py
r10028 r11949 22 22 from cStringIO import StringIO 23 23 from zope.interface import Interface 24 from waeup. kofa.interfaces import (IKofaObject, IKofaExporter,25 I KofaXMLExporter, IKofaXMLImporter)24 from waeup.ikoba.interfaces import (IIkobaObject, IIkobaExporter, 25 IIkobaXMLExporter, IIkobaXMLImporter) 26 26 27 27 def readFile(f): … … 40 40 41 41 class Exporter(grok.Adapter): 42 """Export a Kofa object as pickle.42 """Export a Ikoba 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(I KofaObject)48 grok.provides(I KofaExporter)47 grok.context(IIkobaObject) 48 grok.provides(IIkobaExporter) 49 49 50 50 def __init__(self, context): … … 61 61 62 62 class XMLExporter(grok.Adapter): 63 """Export a Kofa object as XML.63 """Export a Ikoba 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(I KofaXMLExporter)69 grok.provides(IIkobaXMLExporter) 70 70 71 71 def __init__(self, context): … … 84 84 85 85 class XMLImporter(grok.Adapter): 86 """Import a Kofa object from XML.86 """Import a Ikoba object from XML. 87 87 """ 88 88 grok.context(Interface) 89 grok.provides(I KofaXMLImporter)89 grok.provides(IIkobaXMLImporter) 90 90 91 91 def __init__(self, context): -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/importexport.txt
r7819 r11949 6 6 7 7 .. :doctest: 8 .. :layer: waeup. kofa.testing.KofaUnitTestLayer8 .. :layer: waeup.ikoba.testing.IkobaUnitTestLayer 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 IKofaXMLExporter63 >>> exporter = I KofaXMLExporter(mycave)62 >>> from waeup.ikoba.interfaces import IIkobaXMLExporter 63 >>> exporter = IIkobaXMLExporter(mycave) 64 64 >>> exporter 65 <waeup. kofa.utils.importexport.XMLExporter object at 0x...>65 <waeup.ikoba.utils.importexport.XMLExporter object at 0x...> 66 66 67 67 All exporters provide an ``export(<obj>)`` method:: … … 101 101 Now we create an importer for that object: 102 102 103 >>> from waeup. kofa.interfaces import IKofaXMLImporter104 >>> importer = I KofaXMLImporter(mycave)103 >>> from waeup.ikoba.interfaces import IIkobaXMLImporter 104 >>> importer = IIkobaXMLImporter(mycave) 105 105 106 106 Importing from filenames -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/logger.py
r9988 r11949 19 19 Convenience stuff for logging. 20 20 21 Main component of :mod:`waeup. kofa.utils.logging` is a mix-in class22 :class:`waeup. kofa.utils.logging.Logger`. Classes derived (also) from21 Main component of :mod:`waeup.ikoba.utils.logging` is a mix-in class 22 :class:`waeup.ikoba.utils.logging.Logger`. Classes derived (also) from 23 23 that mix-in provide a `logger` attribute that returns a regular Python 24 24 logger logging to a rotating log file stored in the datacenter storage … … 30 30 The `logger_name` tells under which name the logger should be 31 31 registered Python-wise. This is usually a dotted name string like 32 ``waeup. kofa.${sitename}.mycomponent`` which should be unique. If you32 ``waeup.ikoba.${sitename}.mycomponent`` which should be unique. If you 33 33 pick a name already used by another component, trouble is ahead. The 34 34 ``${sitename}`` chunk of the name can be set literally like this. The … … 46 46 your `logger_name` and `logger_filename` attribute and off you go:: 47 47 48 from waeup. kofa.utils.logger import Logger48 from waeup.ikoba.utils.logger import Logger 49 49 50 50 class MyComponent(object, Logger): 51 51 # Yes that's a complete working class 52 logger_name = 'waeup. kofa.${sitename}.mycomponent52 logger_name = 'waeup.ikoba.${sitename}.mycomponent 53 53 logger_filename = 'mycomponent.log' 54 54 … … 67 67 68 68 The datacenter and its storage are created automatically when you 69 create a :class:`waeup. kofa.app.University`. This also means that69 create a :class:`waeup.ikoba.app.University`. This also means that 70 70 logging with the `Logger` mix-in will work only inside so-called sites 71 71 (`University` instances put into ZODB are such `sites`). … … 82 82 from zope.component import queryUtility 83 83 from zope.interface import Interface, Attribute, implements 84 from waeup. kofa.interfaces import (84 from waeup.ikoba.interfaces import ( 85 85 IDataCenter, IDataCenterStorageMovedEvent, ILoggerCollector) 86 from waeup. kofa.utils.helpers import get_current_principal86 from waeup.ikoba.utils.helpers import get_current_principal 87 87 88 88 #: Default logfile size (5 KB, not relevant for DatedRotatingFileHandlers) … … 154 154 155 155 #: The Python logger name used when 156 #: logging. ``'waeup. kofa.${sitename}'`` by default. You can use the156 #: logging. ``'waeup.ikoba.${sitename}'`` by default. You can use the 157 157 #: ``${sitename}`` placeholder in that string, which will be 158 158 #: replaced by the actual used site name. 159 logger_name = 'waeup. kofa.${sitename}'159 logger_name = 'waeup.ikoba.${sitename}' 160 160 161 161 #: The format to use when logging. … … 386 386 return 387 387 388 from waeup. kofa.interfaces import IUniversity388 from waeup.ikoba.interfaces import IUniversity 389 389 @grok.subscribe(IUniversity, grok.IObjectRemovedEvent) 390 390 def handle_site_removed(obj, event): -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/tests/test_batching.py
r11737 r11949 30 30 from zope.component.interfaces import IFactory 31 31 from zope.interface import Interface, implements, verify 32 from waeup. kofa.app import University33 from waeup. kofa.interfaces import (32 from waeup.ikoba.app import University 33 from waeup.ikoba.interfaces import ( 34 34 ICSVExporter, IBatchProcessor, IExportJobContainer, IJobManager, 35 35 IExportJob, IExportContainerFinder) 36 from waeup. kofa.testing import (36 from waeup.ikoba.testing import ( 37 37 FunctionalLayer, FunctionalTestCase, FakeJob, FakeJobManager) 38 from waeup. kofa.utils.batching import (38 from waeup.ikoba.utils.batching import ( 39 39 ExporterBase, BatchProcessor, export_job, AsyncExportJob, 40 40 ExportJobContainer, VirtualExportJobContainer, ExportContainerFinder) -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/tests/test_converters.py
r11947 r11949 32 32 Interface, implements, invariant, Invalid, implementedBy, verify) 33 33 34 from waeup. kofa.app import University35 from waeup. kofa.testing import FunctionalLayer, FunctionalTestCase36 from waeup. kofa.interfaces import (37 Simple KofaVocabulary, SubjectSource, GradeSource, IFieldConverter,34 from waeup.ikoba.app import University 35 from waeup.ikoba.testing import FunctionalLayer, FunctionalTestCase 36 from waeup.ikoba.interfaces import ( 37 SimpleIkobaVocabulary, SubjectSource, GradeSource, IFieldConverter, 38 38 DELETION_MARKER, IGNORE_MARKER) 39 from waeup. kofa.schoolgrades import ResultEntryField40 from waeup. kofa.utils.converters import (39 from waeup.ikoba.schoolgrades import ResultEntryField 40 from waeup.ikoba.utils.converters import ( 41 41 IObjectConverter, IFieldConverter, DefaultFieldConverter, 42 42 ListFieldConverter, PhoneNumberFieldConverter, ResultEntryConverter, 43 43 DefaultObjectConverter) 44 from waeup. kofa.utils.helpers import attrs_to_fields45 46 colors = Simple KofaVocabulary(44 from waeup.ikoba.utils.helpers import attrs_to_fields 45 46 colors = SimpleIkobaVocabulary( 47 47 ('Red', u'red'), 48 48 ('Green', u'green'), 49 49 ('Blue', u'blue'), 50 50 ) 51 car_nums = Simple KofaVocabulary(51 car_nums = SimpleIkobaVocabulary( 52 52 ('None', 0), 53 53 ('One', 1), -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/tests/test_doctests.py
r7811 r11949 18 18 """Register doctests from utils subpackage. 19 19 """ 20 from waeup. kofa.testing import get_doctest_suite20 from waeup.ikoba.testing import get_doctest_suite 21 21 22 22 def test_suite(): -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/tests/test_helpers.py
r11824 r11949 31 31 from zope.security.testing import Principal, Participation 32 32 from zope.security.management import newInteraction, endInteraction 33 from waeup. kofa.utils import helpers33 from waeup.ikoba.utils import helpers 34 34 35 35 class IFakeObject(Interface): -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/tests/test_logger.py
r9988 r11949 17 17 ## 18 18 19 # Tests for waeup. kofa.utils.logger19 # Tests for waeup.ikoba.utils.logger 20 20 import logging 21 21 import os … … 25 25 from zope.component.hooks import setSite, clearSite 26 26 from zope.interface.verify import verifyClass, verifyObject 27 from waeup. kofa.app import University28 from waeup. kofa.testing import FunctionalLayer, FunctionalTestCase29 30 from waeup. kofa.utils.logger import (27 from waeup.ikoba.app import University 28 from waeup.ikoba.testing import FunctionalLayer, FunctionalTestCase 29 30 from waeup.ikoba.utils.logger import ( 31 31 Logger, MAX_BYTES, BACKUP_COUNT, ILoggerCollector, LoggerCollector, 32 32 ILogger) -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/tests/test_utils.py
r11821 r11949 21 21 import sys 22 22 import unittest 23 from waeup. kofa.interfaces import IKofaUtils24 from waeup. kofa.utils.utils import KofaUtils23 from waeup.ikoba.interfaces import IIkobaUtils 24 from waeup.ikoba.utils.utils import IkobaUtils 25 25 from zope.interface import verify 26 26 27 27 28 class KofaUtilsTestCase(unittest.TestCase):28 class IkobaUtilsTestCase(unittest.TestCase): 29 29 30 30 def setUp(self): … … 36 36 # Helper: get a `KofUtil` instance with all values of 37 37 # SYSTEM_MAX_LOAD dict set to ``None`` 38 util = KofaUtils()38 util = IkobaUtils() 39 39 for key, val in util.SYSTEM_MAX_LOAD.items(): 40 40 util.SYSTEM_MAX_LOAD[key] = None … … 42 42 43 43 def test_iface(self): 44 # KofaUtils fullfill IKofaUtils expectations45 utils = KofaUtils()46 verify.verifyClass(I KofaUtils, KofaUtils)47 verify.verifyObject(I KofaUtils, utils)44 # IkobaUtils fullfill IIkobaUtils expectations 45 utils = IkobaUtils() 46 verify.verifyClass(IIkobaUtils, IkobaUtils) 47 verify.verifyObject(IIkobaUtils, utils) 48 48 49 49 def test_expensive_actions_allowed_swap_none(self): -
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/utils.py
r11947 r11949 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """General helper utilities for Kofa.18 """General helper utilities for Ikoba. 19 19 """ 20 20 import grok … … 25 25 from random import SystemRandom as r 26 26 from zope.i18n import translate 27 from waeup. kofa.interfaces import IKofaUtils28 from waeup. kofa.interfaces import MessageFactory as _29 from waeup. kofa.smtp import send_mail as send_mail_internally30 from waeup. kofa.utils.helpers import get_sorted_preferred27 from waeup.ikoba.interfaces import IIkobaUtils 28 from waeup.ikoba.interfaces import MessageFactory as _ 29 from waeup.ikoba.smtp import send_mail as send_mail_internally 30 from waeup.ikoba.utils.helpers import get_sorted_preferred 31 31 32 32 … … 34 34 rcpt_name, rcpt_addr, 35 35 subject, body, config): 36 """Wrapper for the real SMTP functionality in :mod:`waeup. kofa.smtp`.36 """Wrapper for the real SMTP functionality in :mod:`waeup.ikoba.smtp`. 37 37 38 38 Merely here to stay compatible with lots of calls to this place. … … 78 78 79 79 80 class KofaUtils(grok.GlobalUtility):80 class IkobaUtils(grok.GlobalUtility): 81 81 """A collection of parameters and methods subject to customization. 82 82 83 83 """ 84 grok.implements(I KofaUtils)84 grok.implements(IIkobaUtils) 85 85 # This the only place where we define the portal language 86 86 # which is used for the translation of system messages … … 225 225 'd': portal, 226 226 'e': body}) 227 body = translate(text, 'waeup. kofa',227 body = translate(text, 'waeup.ikoba', 228 228 target_language=self.PORTAL_LANGUAGE) 229 229 if not (from_addr and rcpt_addr): … … 263 263 Returns True or False to indicate successful operation. 264 264 """ 265 subject = 'Your Kofa credentials'265 subject = 'Your Ikoba credentials' 266 266 text = _(u"""Dear ${a}, 267 267 … … 294 294 'f': url_info}) 295 295 296 body = translate(text, 'waeup. kofa',296 body = translate(text, 'waeup.ikoba', 297 297 target_language=self.PORTAL_LANGUAGE) 298 298 return send_mail(
Note: See TracChangeset for help on using the changeset viewer.