- Timestamp:
- 23 Sep 2016, 05:54:20 (8 years ago)
- Location:
- main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/documents
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/documents/__init__.py
r14178 r14181 2 2 """ 3 3 # Make this a package. 4 from ikobacustom.uniben.documents.document import SkeletonDocument4 from ikobacustom.uniben.documents.document import UnibenDocument 5 5 6 6 __all__ = [ 7 ' SkeletonDocument',7 'UnibenDocument', 8 8 ] -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/documents/batching.py
r14178 r14181 20 20 import grok 21 21 from waeup.ikoba.documents.batching import DocumentProcessorBase 22 from ikobacustom.uniben.documents.interfaces import I SkeletonDocument22 from ikobacustom.uniben.documents.interfaces import IUnibenDocument 23 23 from ikobacustom.uniben.interfaces import MessageFactory as _ 24 24 25 25 26 class SkeletonDocumentProcessor(DocumentProcessorBase):27 """A batch processor for I SkeletonDocument objects.26 class UnibenDocumentProcessor(DocumentProcessorBase): 27 """A batch processor for IUnibenDocument objects. 28 28 """ 29 29 util_name = 'unibendocumentprocessor' 30 30 grok.name(util_name) 31 31 32 name = _(' Skeleton Document Processor')33 iface = I SkeletonDocument32 name = _('Uniben Document Processor') 33 iface = IUnibenDocument 34 34 35 factory_name = 'waeup. SkeletonDocument'35 factory_name = 'waeup.UnibenDocument' -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/documents/document.py
r14178 r14181 24 24 from waeup.ikoba.utils.helpers import attrs_to_fields 25 25 from waeup.ikoba.documents.document import PublicDocumentBase 26 from ikobacustom.uniben.documents.interfaces import I SkeletonDocument26 from ikobacustom.uniben.documents.interfaces import IUnibenDocument 27 27 from ikobacustom.uniben.interfaces import MessageFactory as _ 28 28 29 29 30 class SkeletonDocument(PublicDocumentBase):30 class UnibenDocument(PublicDocumentBase): 31 31 """This is a document. 32 32 """ 33 grok.implements(I SkeletonDocument)34 grok.provides(I SkeletonDocument)33 grok.implements(IUnibenDocument) 34 grok.provides(IUnibenDocument) 35 35 36 form_fields_interface = I SkeletonDocument36 form_fields_interface = IUnibenDocument 37 37 38 SkeletonDocument = attrs_to_fields(SkeletonDocument)38 UnibenDocument = attrs_to_fields(UnibenDocument) 39 39 40 40 41 class SkeletonDocumentFactory(grok.GlobalUtility):41 class UnibenDocumentFactory(grok.GlobalUtility): 42 42 """A factory for documents. 43 43 """ 44 44 grok.implements(IFactory) 45 grok.name(u'waeup. SkeletonDocument')45 grok.name(u'waeup.UnibenDocument') 46 46 title = u"Create a new document.", 47 47 description = u"This factory instantiates new uniben documents." 48 48 49 49 def __call__(self, *args, **kw): 50 return SkeletonDocument(*args, **kw)50 return UnibenDocument(*args, **kw) 51 51 52 52 def getInterfaces(self): 53 return implementedBy( SkeletonDocument)53 return implementedBy(UnibenDocument) -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/documents/export.py
r14178 r14181 20 20 import grok 21 21 from waeup.ikoba.documents.export import DocumentExporterBase 22 from ikobacustom.uniben.documents.interfaces import I SkeletonDocument22 from ikobacustom.uniben.documents.interfaces import IUnibenDocument 23 23 from ikobacustom.uniben.interfaces import MessageFactory as _ 24 24 25 25 26 class SkeletonDocumentExporter(DocumentExporterBase):26 class UnibenDocumentExporter(DocumentExporterBase): 27 27 """Exporter for documents. 28 28 """ 29 29 grok.name('unibendocuments') 30 iface = I SkeletonDocument31 class_name = ' SkeletonDocument'32 title = _(u' Skeleton Documents')30 iface = IUnibenDocument 31 class_name = 'UnibenDocument' 32 title = _(u'Uniben Documents') -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/documents/interfaces.py
r14178 r14181 20 20 21 21 22 class I SkeletonDocument(IPublicDocument):22 class IUnibenDocument(IPublicDocument): 23 23 """A representation of a uniben document. 24 24 -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/documents/tests/test_browser.py
r14178 r14181 27 27 from zope.interface.verify import verifyObject, verifyClass 28 28 from waeup.ikoba.documents.tests.test_batching import DocumentImportExportSetup 29 from ikobacustom.uniben.documents.document import SkeletonDocument30 from ikobacustom.uniben.documents.export import SkeletonDocumentExporter31 from ikobacustom.uniben.documents.batching import SkeletonDocumentProcessor29 from ikobacustom.uniben.documents.document import UnibenDocument 30 from ikobacustom.uniben.documents.export import UnibenDocumentExporter 31 from ikobacustom.uniben.documents.batching import UnibenDocumentProcessor 32 32 from ikobacustom.uniben.testing import FunctionalLayer 33 33 … … 38 38 39 39 def setup_for_export(self): 40 document = SkeletonDocument()40 document = UnibenDocument() 41 41 document.document_id = u'DOC1' 42 42 document.title = u'My first document' … … 49 49 # set values we can expect in export file 50 50 self.setup_for_export() 51 exporter = SkeletonDocumentExporter()51 exporter = UnibenDocumentExporter() 52 52 exporter.export_all(self.app, self.outfile) 53 53 result = open(self.outfile, 'rb').read() … … 55 55 'class_name,description,document_id,history,state,title,' 56 56 'users_with_local_roles\r\n' 57 ' SkeletonDocument,,DOC1,'57 'UnibenDocument,,DOC1,' 58 58 '[u\'2014-12-21 23:27:15 WAT - Document created by system\'],' 59 59 'created,My first document,[]\r\n') 60 60 # We can import the same file. 61 processor = SkeletonDocumentProcessor()61 processor = UnibenDocumentProcessor() 62 62 result = processor.doImport( 63 63 self.outfile, … … 79 79 self.assertEqual(num_fail,0) 80 80 # We can import the same file in update mode. 81 processor = SkeletonDocumentProcessor()81 processor = UnibenDocumentProcessor() 82 82 result = processor.doImport( 83 83 self.outfile, -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/documents/tests/test_document.py
r14178 r14181 24 24 25 25 from ikobacustom.uniben.testing import (FunctionalLayer, FunctionalTestCase) 26 from ikobacustom.uniben.documents.document import SkeletonDocument27 from ikobacustom.uniben.documents.interfaces import I SkeletonDocument26 from ikobacustom.uniben.documents.document import UnibenDocument 27 from ikobacustom.uniben.documents.interfaces import IUnibenDocument 28 28 29 class SkeletonDocumentTestCase(FunctionalTestCase):29 class UnibenDocumentTestCase(FunctionalTestCase): 30 30 31 31 layer = FunctionalLayer … … 35 35 self.assertTrue( 36 36 verifyClass( 37 I SkeletonDocument, SkeletonDocument)37 IUnibenDocument, UnibenDocument) 38 38 ) 39 39 self.assertTrue( 40 40 verifyObject( 41 I SkeletonDocument, SkeletonDocument())41 IUnibenDocument, UnibenDocument()) 42 42 ) 43 43 return 44 44 45 def test_add SkeletonDocument(self):45 def test_addUnibenDocument(self): 46 46 container = DocumentsContainer() 47 document = createObject(u'waeup. SkeletonDocument')47 document = createObject(u'waeup.UnibenDocument') 48 48 document.document_id = u'DOC1' 49 49 container.addDocument(document) -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/documents/utils.py
r14178 r14181 22 22 23 23 24 class SkeletonDocumentsUtils(DocumentsUtils):24 class UnibenDocumentsUtils(DocumentsUtils): 25 25 """A collection of methods subject to customization. 26 26 """ … … 30 30 'HTMLDocument': _('HTML Document'), 31 31 'RESTDocument': _('REST Document'), 32 ' SkeletonDocument': _('Skeleton Document'),32 'UnibenDocument': _('Uniben Document'), 33 33 } 34 34
Note: See TracChangeset for help on using the changeset viewer.