- Timestamp:
- 3 Jan 2015, 07:38:07 (10 years ago)
- Location:
- main/ikobacustom.pcn/trunk
- Files:
-
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.pcn/trunk
-
Property
svn:global-ignores
set to
bin
develop-eggs
parts
sources
var
-
Property
svn:global-ignores
set to
-
main/ikobacustom.pcn/trunk/src
-
Property
svn:global-ignores
set to
ikobacustom.pcn.egg-info
-
Property
svn:global-ignores
set to
-
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/__init__.py
r12269 r12371 2 2 """ 3 3 # Make this a package. 4 from ikobacustom. skeleton.documents.document import SkeletonDocument4 from ikobacustom.pcn.documents.document import PCNDocument 5 5 6 6 __all__ = [ 7 ' SkeletonDocument',7 'PCNDocument', 8 8 ] -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/batching.py
r12274 r12371 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Batch processing for skeleton documents.18 """Batch processing for pcn documents. 19 19 """ 20 20 import grok 21 21 from waeup.ikoba.documents.batching import DocumentProcessorBase 22 from ikobacustom. skeleton.documents.interfaces import ISkeletonDocument23 from ikobacustom. skeleton.interfaces import MessageFactory as _22 from ikobacustom.pcn.documents.interfaces import IPCNDocument 23 from ikobacustom.pcn.interfaces import MessageFactory as _ 24 24 25 25 26 class SkeletonDocumentProcessor(DocumentProcessorBase):27 """A batch processor for I SkeletonDocument objects.26 class PCNDocumentProcessor(DocumentProcessorBase): 27 """A batch processor for IPCNDocument objects. 28 28 """ 29 util_name = ' skeletondocumentprocessor'29 util_name = 'pcndocumentprocessor' 30 30 grok.name(util_name) 31 31 32 name = _(' SkeletonDocument Processor')33 iface = I SkeletonDocument32 name = _('PCN Document Processor') 33 iface = IPCNDocument 34 34 35 factory_name = 'waeup. SkeletonDocument'35 factory_name = 'waeup.PCNDocument' -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/document.py
r12270 r12371 24 24 from waeup.ikoba.utils.helpers import attrs_to_fields 25 25 from waeup.ikoba.documents.document import PublicDocumentBase 26 from ikobacustom. skeleton.documents.interfaces import ISkeletonDocument27 from ikobacustom. skeleton.interfaces import MessageFactory as _26 from ikobacustom.pcn.documents.interfaces import IPCNDocument 27 from ikobacustom.pcn.interfaces import MessageFactory as _ 28 28 29 29 30 class SkeletonDocument(PublicDocumentBase):30 class PCNDocument(PublicDocumentBase): 31 31 """This is a document. 32 32 """ 33 grok.implements(I SkeletonDocument)34 grok.provides(I SkeletonDocument)33 grok.implements(IPCNDocument) 34 grok.provides(IPCNDocument) 35 35 36 SkeletonDocument = attrs_to_fields(SkeletonDocument)36 PCNDocument = attrs_to_fields(PCNDocument) 37 37 38 38 39 class SkeletonDocumentFactory(grok.GlobalUtility):39 class PCNDocumentFactory(grok.GlobalUtility): 40 40 """A factory for documents. 41 41 """ 42 42 grok.implements(IFactory) 43 grok.name(u'waeup. SkeletonDocument')43 grok.name(u'waeup.PCNDocument') 44 44 title = u"Create a new document.", 45 description = u"This factory instantiates new skeleton documents."45 description = u"This factory instantiates new pcn documents." 46 46 47 47 def __call__(self, *args, **kw): 48 return SkeletonDocument(*args, **kw)48 return PCNDocument(*args, **kw) 49 49 50 50 def getInterfaces(self): 51 return implementedBy( SkeletonDocument)51 return implementedBy(PCNDocument) -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/export.py
r12292 r12371 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Exporters for skeleton documents.18 """Exporters for pcn documents. 19 19 """ 20 20 import grok 21 21 from waeup.ikoba.documents.export import DocumentExporterBase 22 from ikobacustom. skeleton.documents.interfaces import ISkeletonDocument23 from ikobacustom. skeleton.interfaces import MessageFactory as _22 from ikobacustom.pcn.documents.interfaces import IPCNDocument 23 from ikobacustom.pcn.interfaces import MessageFactory as _ 24 24 25 25 26 class SkeletonDocumentExporter(DocumentExporterBase):26 class PCNDocumentExporter(DocumentExporterBase): 27 27 """Exporter for documents. 28 28 """ 29 grok.name(' skeletondocuments')30 iface = I SkeletonDocument31 class_name = ' SkeletonDocument'32 title = _(u' SkeletonDocuments')29 grok.name('pcndocuments') 30 iface = IPCNDocument 31 class_name = 'PCNDocument' 32 title = _(u'PCN Documents') -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/interfaces.py
r12292 r12371 17 17 ## 18 18 from waeup.ikoba.documents.interfaces import IPublicDocument 19 from ikobacustom. skeleton.interfaces import MessageFactory as _19 from ikobacustom.pcn.interfaces import MessageFactory as _ 20 20 21 21 22 class I SkeletonDocument(IPublicDocument):23 """A representation of a skeleton document.22 class IPCNDocument(IPublicDocument): 23 """A representation of a pcn document. 24 24 25 25 """ -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/tests/test_browser.py
r12290 r12371 27 27 from zope.interface.verify import verifyObject, verifyClass 28 28 from waeup.ikoba.documents.tests.test_batching import DocumentImportExportSetup 29 from ikobacustom. skeleton.documents.document import SkeletonDocument30 from ikobacustom. skeleton.documents.export import SkeletonDocumentExporter31 from ikobacustom. skeleton.documents.batching import SkeletonDocumentProcessor32 from ikobacustom. skeleton.testing import FunctionalLayer29 from ikobacustom.pcn.documents.document import PCNDocument 30 from ikobacustom.pcn.documents.export import PCNDocumentExporter 31 from ikobacustom.pcn.documents.batching import PCNDocumentProcessor 32 from ikobacustom.pcn.testing import FunctionalLayer 33 33 34 34 … … 38 38 39 39 def setup_for_export(self): 40 document = SkeletonDocument()40 document = PCNDocument() 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 = PCNDocumentExporter() 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 'PCNDocument,,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 = PCNDocumentProcessor() 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 = PCNDocumentProcessor() 82 82 result = processor.doImport( 83 83 self.outfile, -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/tests/test_document.py
r12292 r12371 17 17 ## 18 18 """ 19 Tests for skeleton documents.19 Tests for pcn documents. 20 20 """ 21 21 from zope.interface.verify import verifyClass, verifyObject … … 23 23 from waeup.ikoba.documents.container import DocumentsContainer 24 24 25 from ikobacustom. skeleton.testing import (FunctionalLayer, FunctionalTestCase)26 from ikobacustom. skeleton.documents.document import SkeletonDocument27 from ikobacustom. skeleton.documents.interfaces import ISkeletonDocument25 from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase) 26 from ikobacustom.pcn.documents.document import PCNDocument 27 from ikobacustom.pcn.documents.interfaces import IPCNDocument 28 28 29 class SkeletonDocumentTestCase(FunctionalTestCase):29 class PCNDocumentTestCase(FunctionalTestCase): 30 30 31 31 layer = FunctionalLayer … … 35 35 self.assertTrue( 36 36 verifyClass( 37 I SkeletonDocument, SkeletonDocument)37 IPCNDocument, PCNDocument) 38 38 ) 39 39 self.assertTrue( 40 40 verifyObject( 41 I SkeletonDocument, SkeletonDocument())41 IPCNDocument, PCNDocument()) 42 42 ) 43 43 return 44 44 45 def test_add SkeletonDocument(self):45 def test_addPCNDocument(self): 46 46 container = DocumentsContainer() 47 document = createObject(u'waeup. SkeletonDocument')47 document = createObject(u'waeup.PCNDocument') 48 48 document.document_id = u'DOC1' 49 49 container.addDocument(document) -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/utils.py
r12292 r12371 19 19 """ 20 20 from waeup.ikoba.documents.utils import DocumentsUtils 21 from ikobacustom. skeleton.interfaces import MessageFactory as _21 from ikobacustom.pcn.interfaces import MessageFactory as _ 22 22 23 23 24 class SkeletonDocumentsUtils(DocumentsUtils):24 class PCNDocumentsUtils(DocumentsUtils): 25 25 """A collection of methods subject to customization. 26 26 """ … … 29 29 'PDFDocument': _('PDF Document'), 30 30 'HTMLDocument': _('HTML Document'), 31 ' SkeletonDocument': _('SkeletonDocument'),31 'PCNDocument': _('PCN Document'), 32 32 } 33 33
Note: See TracChangeset for help on using the changeset viewer.