Changeset 14181 for main/ikobacustom.uniben/trunk
- Timestamp:
- 23 Sep 2016, 05:54:20 (8 years ago)
- Location:
- main/ikobacustom.uniben/trunk/src/ikobacustom/uniben
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/browser/pdf.py
r12372 r14181 23 23 from waeup.ikoba.browser.pdf import PDFCreator 24 24 25 class SkeletonPDFCreator(PDFCreator):25 class UnibenPDFCreator(PDFCreator): 26 26 """A utility to help with generating PDF docs. 27 27 """ -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/batching.py
r14178 r14181 23 23 CustomerDocumentProcessorBase, ContractProcessorBase) 24 24 from ikobacustom.uniben.customers.interfaces import ( 25 I SkeletonCustomer,26 I SkeletonCustomerDocument, ISkeletonContract)25 IUnibenCustomer, 26 IUnibenCustomerDocument, IUnibenContract) 27 27 from ikobacustom.uniben.interfaces import MessageFactory as _ 28 28 29 29 30 class SkeletonCustomerProcessor(CustomerProcessor):30 class UnibenCustomerProcessor(CustomerProcessor): 31 31 """A batch processor for ICustomer objects. 32 32 """ 33 33 util_name = 'unibencustomerprocessor' 34 34 grok.name(util_name) 35 name = _(' Skeleton Customer Processor')36 iface = I SkeletonCustomer35 name = _('Uniben Customer Processor') 36 iface = IUnibenCustomer 37 37 38 38 39 class SkeletonCustomerDocumentProcessor(CustomerDocumentProcessorBase):40 """A batch processor for I SkeletonCustomerDocument objects.39 class UnibenCustomerDocumentProcessor(CustomerDocumentProcessorBase): 40 """A batch processor for IUnibenCustomerDocument objects. 41 41 """ 42 42 util_name = 'unibencustomerdocumentprocessor' 43 43 grok.name(util_name) 44 name = _(' Skeleton Customer Document Processor')45 iface = I SkeletonCustomerDocument46 factory_name = 'waeup. SkeletonCustomerDocument'44 name = _('Uniben Customer Document Processor') 45 iface = IUnibenCustomerDocument 46 factory_name = 'waeup.UnibenCustomerDocument' 47 47 48 48 49 class SkeletonContractProcessor(ContractProcessorBase):50 """A batch processor for I SkeletonContract objects.49 class UnibenContractProcessor(ContractProcessorBase): 50 """A batch processor for IUnibenContract objects. 51 51 """ 52 52 util_name = 'unibencontractprocessor' 53 53 grok.name(util_name) 54 name = _(' Skeleton Customer Contract Processor')55 iface = I SkeletonContract56 factory_name = 'waeup. SkeletonContract'54 name = _('Uniben Customer Contract Processor') 55 iface = IUnibenContract 56 factory_name = 'waeup.UnibenContract' -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/contracts.py
r14178 r14181 28 28 from ikobacustom.uniben.interfaces import MessageFactory as _ 29 29 from ikobacustom.uniben.customers.interfaces import ( 30 I SkeletonContract, ISkeletonContractEdit, ISkeletonContractProcess,31 I SkeletonContractOfficialUse)30 IUnibenContract, IUnibenContractEdit, IUnibenContractProcess, 31 IUnibenContractOfficialUse) 32 32 33 33 34 class SkeletonContract(ContractBase):34 class UnibenContract(ContractBase): 35 35 """This is a sample contract. 36 36 """ 37 37 38 38 grok.implements( 39 I SkeletonContractProcess,40 I SkeletonContract,41 I SkeletonContractEdit,39 IUnibenContractProcess, 40 IUnibenContract, 41 IUnibenContractEdit, 42 42 ICustomerNavigation) 43 43 44 44 contract_category = 'sample' 45 45 46 form_fields_interface = I SkeletonContract46 form_fields_interface = IUnibenContract 47 47 48 edit_form_fields_interface = I SkeletonContractEdit48 edit_form_fields_interface = IUnibenContractEdit 49 49 50 ou_form_fields_interface = I SkeletonContractOfficialUse50 ou_form_fields_interface = IUnibenContractOfficialUse 51 51 52 check_docs_interface = I SkeletonContract52 check_docs_interface = IUnibenContract 53 53 54 SkeletonContract = attrs_to_fields(SkeletonContract)54 UnibenContract = attrs_to_fields(UnibenContract) 55 55 56 56 57 57 # Contracts must be importable. So we might need a factory. 58 class SkeletonContractFactory(grok.GlobalUtility):58 class UnibenContractFactory(grok.GlobalUtility): 59 59 """A factory for contracts. 60 60 """ 61 61 grok.implements(IFactory) 62 grok.name(u'waeup. SkeletonContract')62 grok.name(u'waeup.UnibenContract') 63 63 title = u"Create a new contract.", 64 64 description = u"This factory instantiates new sample contract instances." 65 65 66 66 def __call__(self, *args, **kw): 67 return SkeletonContract(*args, **kw)67 return UnibenContract(*args, **kw) 68 68 69 69 def getInterfaces(self): 70 return implementedBy( SkeletonContract)70 return implementedBy(UnibenContract) -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/customer.py
r14178 r14181 25 25 from waeup.ikoba.customers.customer import Customer 26 26 from waeup.ikoba.customers.interfaces import ICustomerNavigation 27 from ikobacustom.uniben.customers.interfaces import I SkeletonCustomer27 from ikobacustom.uniben.customers.interfaces import IUnibenCustomer 28 28 from ikobacustom.uniben.interfaces import MessageFactory as _ 29 29 30 30 31 class SkeletonCustomer(Customer):31 class UnibenCustomer(Customer): 32 32 """This is a customer container for the various objects 33 33 owned by customers. 34 34 """ 35 grok.implements(I SkeletonCustomer, ICustomerNavigation)36 grok.provides(I SkeletonCustomer)35 grok.implements(IUnibenCustomer, ICustomerNavigation) 36 grok.provides(IUnibenCustomer) 37 37 38 form_fields_interface = I SkeletonCustomer38 form_fields_interface = IUnibenCustomer 39 39 40 SkeletonCustomer = attrs_to_fields(SkeletonCustomer)40 UnibenCustomer = attrs_to_fields(UnibenCustomer) 41 41 42 42 43 class SkeletonCustomerFactory(grok.GlobalUtility):43 class UnibenCustomerFactory(grok.GlobalUtility): 44 44 """A factory for customers. 45 45 """ … … 50 50 51 51 def __call__(self, *args, **kw): 52 return SkeletonCustomer()52 return UnibenCustomer() 53 53 54 54 def getInterfaces(self): 55 return implementedBy( SkeletonCustomer)55 return implementedBy(UnibenCustomer) -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/documents.py
r14178 r14181 26 26 from waeup.ikoba.customers.documents import CustomerDocumentBase 27 27 from ikobacustom.uniben.interfaces import MessageFactory as _ 28 from ikobacustom.uniben.customers.interfaces import I SkeletonCustomerDocument28 from ikobacustom.uniben.customers.interfaces import IUnibenCustomerDocument 29 29 30 30 31 class SkeletonCustomerDocument(CustomerDocumentBase):31 class UnibenCustomerDocument(CustomerDocumentBase): 32 32 """This is a sample customer document. 33 33 """ 34 34 35 grok.implements(I SkeletonCustomerDocument, ICustomerNavigation)36 grok.provides(I SkeletonCustomerDocument)35 grok.implements(IUnibenCustomerDocument, ICustomerNavigation) 36 grok.provides(IUnibenCustomerDocument) 37 37 38 38 # Ikoba can store any number of files per Document object. … … 42 42 filenames = ('sample',) 43 43 44 form_fields_interface = I SkeletonCustomerDocument44 form_fields_interface = IUnibenCustomerDocument 45 45 46 SkeletonCustomerDocument = attrs_to_fields(SkeletonCustomerDocument)46 UnibenCustomerDocument = attrs_to_fields(UnibenCustomerDocument) 47 47 48 48 49 49 # Customer documents must be importable. So we need a factory. 50 class SkeletonCustomerDocumentFactory(grok.GlobalUtility):50 class UnibenCustomerDocumentFactory(grok.GlobalUtility): 51 51 """A factory for customer documents. 52 52 """ 53 53 grok.implements(IFactory) 54 grok.name(u'waeup. SkeletonCustomerDocument')54 grok.name(u'waeup.UnibenCustomerDocument') 55 55 title = u"Create a new document.", 56 56 description = u"This factory instantiates new sample document instances." 57 57 58 58 def __call__(self, *args, **kw): 59 return SkeletonCustomerDocument(*args, **kw)59 return UnibenCustomerDocument(*args, **kw) 60 60 61 61 def getInterfaces(self): 62 return implementedBy( SkeletonCustomerDocument)62 return implementedBy(UnibenCustomerDocument) -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/export.py
r14178 r14181 22 22 CustomerExporter, CustomerDocumentExporterBase, ContractExporterBase) 23 23 from ikobacustom.uniben.customers.interfaces import ( 24 I SkeletonCustomer, ISkeletonCustomerDocument, ISkeletonContractProcess)24 IUnibenCustomer, IUnibenCustomerDocument, IUnibenContractProcess) 25 25 from ikobacustom.uniben.interfaces import MessageFactory as _ 26 26 27 class SkeletonCustomerExporter(CustomerExporter):27 class UnibenCustomerExporter(CustomerExporter): 28 28 """Exporter for Customers. 29 29 """ 30 iface = I SkeletonCustomer31 title = _(u' Skeleton Customers')30 iface = IUnibenCustomer 31 title = _(u'Uniben Customers') 32 32 33 33 34 class SkeletonCustomerDocumentExporter(CustomerDocumentExporterBase):34 class UnibenCustomerDocumentExporter(CustomerDocumentExporterBase): 35 35 """Exporter for documents. 36 36 """ 37 37 grok.name('unibencustomerdocuments') 38 iface = I SkeletonCustomerDocument39 title = _(u' Skeleton Customer Documents')40 class_name = ' SkeletonCustomerDocument'38 iface = IUnibenCustomerDocument 39 title = _(u'Uniben Customer Documents') 40 class_name = 'UnibenCustomerDocument' 41 41 42 42 43 class SkeletonContractExporter(ContractExporterBase):43 class UnibenContractExporter(ContractExporterBase): 44 44 """Exporter for Contract instances. 45 45 """ 46 46 grok.name('unibencontracts') 47 iface = I SkeletonContractProcess48 title = _(u' Skeleton Customer Contracts')49 class_name = ' SkeletonContract'47 iface = IUnibenContractProcess 48 title = _(u'Uniben Customer Contracts') 49 class_name = 'UnibenContract' -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/fileviewlets.py
r14178 r14181 23 23 FileDisplay, FileUpload, Image) 24 24 25 from ikobacustom.uniben.customers.documents import SkeletonCustomerDocument25 from ikobacustom.uniben.customers.documents import UnibenCustomerDocument 26 26 27 27 from waeup.ikoba.customers.browser import ( … … 39 39 """ 40 40 grok.order(1) 41 grok.context( SkeletonCustomerDocument)41 grok.context(UnibenCustomerDocument) 42 42 grok.view(DocumentManageFormPage) 43 43 grok.require('waeup.manageCustomer') … … 61 61 """ 62 62 grok.order(1) 63 grok.context( SkeletonCustomerDocument)63 grok.context(UnibenCustomerDocument) 64 64 grok.require('waeup.viewCustomer') 65 65 grok.view(DocumentDisplayFormPage) … … 74 74 """ 75 75 grok.name('sample') 76 grok.context( SkeletonCustomerDocument)76 grok.context(UnibenCustomerDocument) 77 77 grok.require('waeup.viewCustomer') 78 78 download_name = u'sample' -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/interfaces.py
r14178 r14181 27 27 28 28 29 class I SkeletonCustomer(ICustomer):29 class IUnibenCustomer(ICustomer): 30 30 """Representation of a customer. 31 31 … … 35 35 36 36 37 class I SkeletonCustomerDocument(ICustomerDocument):37 class IUnibenCustomerDocument(ICustomerDocument): 38 38 """A customer document. 39 39 … … 42 42 # Customer contract interfaces 43 43 44 class I SkeletonContract(IContract):44 class IUnibenContract(IContract): 45 45 """A customer contract sample with document attached. 46 46 … … 53 53 ) 54 54 55 class I SkeletonContractOfficialUse(IIkobaObject):55 class IUnibenContractOfficialUse(IIkobaObject): 56 56 """Interface for editing official use data. 57 57 … … 63 63 ) 64 64 65 class I SkeletonContractProcess(ISkeletonContract, ISkeletonContractOfficialUse):65 class IUnibenContractProcess(IUnibenContract, IUnibenContractOfficialUse): 66 66 """Interface for processing contract data. 67 67 """ … … 75 75 ) 76 76 77 class I SkeletonContractEdit(ISkeletonContract):77 class IUnibenContractEdit(IUnibenContract): 78 78 """Interface for editing sample contract data by customers. 79 79 -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_browser.py
r14178 r14181 31 31 from waeup.ikoba.customers.tests.test_browser import CustomersFullSetup 32 32 from ikobacustom.uniben.customers.export import ( 33 SkeletonCustomerExporter,34 SkeletonCustomerDocumentExporter,35 SkeletonContractExporter)33 UnibenCustomerExporter, 34 UnibenCustomerDocumentExporter, 35 UnibenContractExporter) 36 36 from ikobacustom.uniben.customers.batching import ( 37 SkeletonCustomerProcessor,38 SkeletonCustomerDocumentProcessor,39 SkeletonContractProcessor)37 UnibenCustomerProcessor, 38 UnibenCustomerDocumentProcessor, 39 UnibenContractProcessor) 40 40 from ikobacustom.uniben.testing import FunctionalLayer, samples_dir 41 41 … … 61 61 IWorkflowState(customer).setState('started') 62 62 self.app['customers'].addCustomer(customer) 63 document = createObject(u'waeup. SkeletonCustomerDocument')63 document = createObject(u'waeup.UnibenCustomerDocument') 64 64 document.title = u'My first document' 65 65 customer['documents'].addDocument(document) 66 contract = createObject(u'waeup. SkeletonContract')66 contract = createObject(u'waeup.UnibenContract') 67 67 contract.tc_dict = {'en':u'Hello World'} 68 68 customer['contracts'].addContract(contract) … … 77 77 # set values we can expect in export file 78 78 self.setup_for_export() 79 exporter = SkeletonCustomerExporter()79 exporter = UnibenCustomerExporter() 80 80 exporter.export_all(self.app, self.outfile) 81 81 result = open(self.outfile, 'rb').read() … … 85 85 'K1000000,aa@aa.aa,Beate,Mueller,,,123,f,0,,,started,[]\r\n') 86 86 # We can reimport the file ... 87 processor = SkeletonCustomerProcessor()87 processor = UnibenCustomerProcessor() 88 88 result = processor.doImport( 89 89 self.outfile, … … 118 118 # set values we can expect in export file 119 119 self.setup_for_export() 120 exporter = SkeletonCustomerDocumentExporter()120 exporter = UnibenCustomerDocumentExporter() 121 121 exporter.export_all(self.app, self.outfile) 122 122 result = open(self.outfile, 'rb').read() 123 123 self.assertMatches(result, 124 124 'class_name,document_id,history,state,title,user_id\r\n' 125 ' SkeletonCustomerDocument,%s,'125 'UnibenCustomerDocument,%s,' 126 126 '[u\'2014-12-21 17:00:36 WAT - Document created by system\'],' 127 127 'created,My first document,K1000000\r\n' 128 128 % self.document.document_id) 129 129 # We can reimport the file if we change the header (user_id -> customer_id) 130 processor = SkeletonCustomerDocumentProcessor()130 processor = UnibenCustomerDocumentProcessor() 131 131 open(self.outfile, 'wb').write( 132 132 'customer_id,class_name,document_id,state,title\r\n' 133 'K1000000, SkeletonCustomerDocument,%s,started,My first title\r\n'133 'K1000000,UnibenCustomerDocument,%s,started,My first title\r\n' 134 134 % self.document.document_id) 135 135 result = processor.doImport( … … 162 162 # set values we can expect in export file 163 163 self.setup_for_export() 164 exporter = SkeletonContractExporter()164 exporter = UnibenContractExporter() 165 165 exporter.export_all(self.app, self.outfile) 166 166 result = open(self.outfile, 'rb').read() … … 169 169 'fee_based,history,last_product_id,product_object,product_options,' 170 170 'state,tc_dict,title,user_id,valid_from,valid_to\r\n' 171 ' SkeletonContract,,sample,%s,,0,'171 'UnibenContract,,sample,%s,,0,' 172 172 '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']' 173 173 ',,,[],created,{\'en\': u\'Hello World\'},,K1000000,,\r\n' 174 174 % self.contract.contract_id) 175 175 # We can reimport the file if we change the header (user_id -> customer_id) 176 processor = SkeletonContractProcessor()176 processor = UnibenContractProcessor() 177 177 open(self.outfile, 'wb').write( 178 178 'class_name,contract_category,contract_id,document_object,' 179 179 'history,last_product_id,product_object,product_options,' 180 180 'state,tc_dict,title,user_id\r\n' 181 ' SkeletonContract,sample,%s,,'181 'UnibenContract,sample,%s,,' 182 182 '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']' 183 183 ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n' … … 221 221 def setup_customizable_params(self): 222 222 self._contract_category = u'sample' 223 self._document_factory = 'waeup. SkeletonCustomerDocument'224 self._contract_factory = 'waeup. SkeletonContract'223 self._document_factory = 'waeup.UnibenCustomerDocument' 224 self._contract_factory = 'waeup.UnibenContract' 225 225 return 226 226 … … 304 304 def setup_customizable_params(self): 305 305 self._contract_category = u'sample' 306 self._document_factory = 'waeup. SkeletonCustomerDocument'307 self._contract_factory = 'waeup. SkeletonContract'306 self._document_factory = 'waeup.UnibenCustomerDocument' 307 self._contract_factory = 'waeup.UnibenContract' 308 308 return 309 309 -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_contract.py
r14178 r14181 29 29 30 30 from ikobacustom.uniben.testing import (FunctionalLayer, FunctionalTestCase) 31 from ikobacustom.uniben.customers.contracts import SkeletonContract32 from ikobacustom.uniben.customers.interfaces import I SkeletonContract31 from ikobacustom.uniben.customers.contracts import UnibenContract 32 from ikobacustom.uniben.customers.interfaces import IUnibenContract 33 33 34 34 … … 38 38 39 39 def test_interfaces(self): 40 verify.verifyClass(I SkeletonContract, SkeletonContract)41 verify.verifyClass(ICustomerNavigation, SkeletonContract)42 verify.verifyObject(I SkeletonContract, SkeletonContract())43 verify.verifyObject(ICustomerNavigation, SkeletonContract())40 verify.verifyClass(IUnibenContract, UnibenContract) 41 verify.verifyClass(ICustomerNavigation, UnibenContract) 42 verify.verifyObject(IUnibenContract, UnibenContract()) 43 verify.verifyObject(ICustomerNavigation, UnibenContract()) 44 44 return 45 45 46 46 def test_addContract(self): 47 47 container = ContractsContainer() 48 contract = createObject(u'waeup. SkeletonContract')48 contract = createObject(u'waeup.UnibenContract') 49 49 id = contract.contract_id 50 50 container.addContract(contract) 51 51 self.assertEqual(container[id], contract) 52 52 self.assertRaises(TypeError, container.addContract, object()) 53 self.assertEqual(contract.class_name, ' SkeletonContract')53 self.assertEqual(contract.class_name, 'UnibenContract') 54 54 return -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_customer.py
r14178 r14181 31 31 32 32 from ikobacustom.uniben.testing import (FunctionalLayer, FunctionalTestCase) 33 from ikobacustom.uniben.customers.customer import SkeletonCustomer34 from ikobacustom.uniben.customers.interfaces import I SkeletonCustomer33 from ikobacustom.uniben.customers.customer import UnibenCustomer 34 from ikobacustom.uniben.customers.interfaces import IUnibenCustomer 35 35 36 class SkeletonCustomerTestCase(FunctionalTestCase):36 class UnibenCustomerTestCase(FunctionalTestCase): 37 37 38 38 layer = FunctionalLayer 39 39 40 40 def setUp(self): 41 super( SkeletonCustomerTestCase, self).setUp()41 super(UnibenCustomerTestCase, self).setUp() 42 42 43 43 # Prepopulate ZODB … … 52 52 53 53 def test_interfaces(self): 54 verify.verifyClass(I SkeletonCustomer, SkeletonCustomer)55 verify.verifyClass(ICustomerNavigation, SkeletonCustomer)56 verify.verifyObject(I SkeletonCustomer, SkeletonCustomer())57 verify.verifyObject(ICustomerNavigation, SkeletonCustomer())54 verify.verifyClass(IUnibenCustomer, UnibenCustomer) 55 verify.verifyClass(ICustomerNavigation, UnibenCustomer) 56 verify.verifyObject(IUnibenCustomer, UnibenCustomer()) 57 verify.verifyObject(ICustomerNavigation, UnibenCustomer()) 58 58 return 59 59 60 def test_add SkeletonCustomer(self):60 def test_addUnibenCustomer(self): 61 61 customer = createObject(u'waeup.Customer') 62 verify.verifyObject(I SkeletonCustomer, customer)62 verify.verifyObject(IUnibenCustomer, customer) 63 63 self.app['customers'].addCustomer(customer) 64 64 self.assertEqual(customer.customer_id, 'K1000000') … … 68 68 def tearDown(self): 69 69 shutil.rmtree(self.dc_root) 70 super( SkeletonCustomerTestCase, self).tearDown()70 super(UnibenCustomerTestCase, self).tearDown() 71 71 return -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_document.py
r14178 r14181 29 29 30 30 from ikobacustom.uniben.testing import (FunctionalLayer, FunctionalTestCase) 31 from ikobacustom.uniben.customers.documents import SkeletonCustomerDocument32 from ikobacustom.uniben.customers.interfaces import I SkeletonCustomerDocument31 from ikobacustom.uniben.customers.documents import UnibenCustomerDocument 32 from ikobacustom.uniben.customers.interfaces import IUnibenCustomerDocument 33 33 34 34 … … 38 38 39 39 def test_interfaces(self): 40 verify.verifyClass(I SkeletonCustomerDocument, SkeletonCustomerDocument)41 verify.verifyClass(ICustomerNavigation, SkeletonCustomerDocument)42 verify.verifyObject(I SkeletonCustomerDocument, SkeletonCustomerDocument())43 verify.verifyObject(ICustomerNavigation, SkeletonCustomerDocument())40 verify.verifyClass(IUnibenCustomerDocument, UnibenCustomerDocument) 41 verify.verifyClass(ICustomerNavigation, UnibenCustomerDocument) 42 verify.verifyObject(IUnibenCustomerDocument, UnibenCustomerDocument()) 43 verify.verifyObject(ICustomerNavigation, UnibenCustomerDocument()) 44 44 return 45 45 46 46 def test_addDocument(self): 47 47 container = CustomerDocumentsContainer() 48 document = createObject(u'waeup. SkeletonCustomerDocument')48 document = createObject(u'waeup.UnibenCustomerDocument') 49 49 id = document.document_id 50 50 container.addDocument(document) 51 51 self.assertEqual(container[id], document) 52 52 self.assertRaises(TypeError, container.addDocument, object()) 53 self.assertEqual(document.class_name, ' SkeletonCustomerDocument')53 self.assertEqual(document.class_name, 'UnibenCustomerDocument') 54 54 return -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/utils.py
r14178 r14181 27 27 from ikobacustom.uniben.interfaces import MessageFactory as _ 28 28 29 class SkeletonCustomersUtils(CustomersUtils):29 class UnibenCustomersUtils(CustomersUtils): 30 30 """A collection of methods subject to customization. 31 31 """ … … 47 47 #'CustomerPDFDocument': _('PDF Document'), 48 48 49 ' SkeletonCustomerDocument': _('Skeleton Document'),49 'UnibenCustomerDocument': _('Uniben Document'), 50 50 } 51 51 … … 53 53 #'SampleContract': _('Sample Contract'), 54 54 55 ' SkeletonContract': _('Skeleton Contract'),55 'UnibenContract': _('Uniben Contract'), 56 56 } 57 57 -
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 -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/products/__init__.py
r14178 r14181 2 2 """ 3 3 # Make this a package. 4 from ikobacustom.uniben.products.product import SkeletonProduct4 from ikobacustom.uniben.products.product import UnibenProduct 5 5 6 6 __all__ = [ 7 ' SkeletonProduct',7 'UnibenProduct', 8 8 ] -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/products/batching.py
r14178 r14181 20 20 import grok 21 21 from waeup.ikoba.products.batching import ProductProcessor 22 from ikobacustom.uniben.products.interfaces import I SkeletonProduct22 from ikobacustom.uniben.products.interfaces import IUnibenProduct 23 23 from ikobacustom.uniben.interfaces import MessageFactory as _ 24 24 25 class SkeletonProductProcessor(ProductProcessor):25 class UnibenProductProcessor(ProductProcessor): 26 26 27 iface = I SkeletonProduct28 name = _(' Skeleton Product Processor')27 iface = IUnibenProduct 28 name = _('Uniben Product Processor') 29 29 util_name = 'unibenproductprocessor' 30 30 grok.name(util_name) -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/products/export.py
r14178 r14181 21 21 from waeup.ikoba.utils.helpers import iface_names 22 22 from waeup.ikoba.products.export import ProductExporter 23 from ikobacustom.uniben.products.interfaces import I SkeletonProduct23 from ikobacustom.uniben.products.interfaces import IUnibenProduct 24 24 from ikobacustom.uniben.interfaces import MessageFactory as _ 25 25 26 26 27 class SkeletonProductExporter(ProductExporter):27 class UnibenProductExporter(ProductExporter): 28 28 """Exporter for products. 29 29 """ 30 30 31 fields = tuple(sorted(iface_names(I SkeletonProduct))) + (31 fields = tuple(sorted(iface_names(IUnibenProduct))) + ( 32 32 'users_with_local_roles',) 33 33 34 34 #: The title under which this exporter will be displayed 35 #title = _(u' Skeleton Products')35 #title = _(u'Uniben Products') -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/products/interfaces.py
r14178 r14181 20 20 21 21 22 class I SkeletonProduct(IProduct):22 class IUnibenProduct(IProduct): 23 23 """A representation of a uniben product. 24 24 -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/products/product.py
r14178 r14181 24 24 from waeup.ikoba.utils.helpers import attrs_to_fields 25 25 from waeup.ikoba.products.product import Product 26 from ikobacustom.uniben.products.interfaces import I SkeletonProduct26 from ikobacustom.uniben.products.interfaces import IUnibenProduct 27 27 from ikobacustom.uniben.interfaces import MessageFactory as _ 28 28 29 29 30 class SkeletonProduct(Product):30 class UnibenProduct(Product): 31 31 """This is a product. 32 32 """ 33 grok.implements(I SkeletonProduct)34 grok.provides(I SkeletonProduct)33 grok.implements(IUnibenProduct) 34 grok.provides(IUnibenProduct) 35 35 36 form_fields_interface = I SkeletonProduct36 form_fields_interface = IUnibenProduct 37 37 38 SkeletonProduct = attrs_to_fields(SkeletonProduct)38 UnibenProduct = attrs_to_fields(UnibenProduct) 39 39 40 40 41 class SkeletonProductFactory(grok.GlobalUtility):41 class UnibenProductFactory(grok.GlobalUtility): 42 42 """A factory for products. 43 43 """ … … 48 48 49 49 def __call__(self, *args, **kw): 50 return SkeletonProduct(*args, **kw)50 return UnibenProduct(*args, **kw) 51 51 52 52 def getInterfaces(self): 53 return implementedBy( SkeletonProduct)53 return implementedBy(UnibenProduct) -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/products/tests/test_browser.py
r14178 r14181 27 27 from zope.interface.verify import verifyObject, verifyClass 28 28 from waeup.ikoba.products.tests.test_batching import ProductImportExportSetup 29 from ikobacustom.uniben.products.product import SkeletonProduct30 from ikobacustom.uniben.products.export import SkeletonProductExporter31 from ikobacustom.uniben.products.batching import SkeletonProductProcessor29 from ikobacustom.uniben.products.product import UnibenProduct 30 from ikobacustom.uniben.products.export import UnibenProductExporter 31 from ikobacustom.uniben.products.batching import UnibenProductProcessor 32 32 from ikobacustom.uniben.testing import FunctionalLayer 33 33 … … 38 38 39 39 def setup_for_export(self): 40 product = SkeletonProduct()40 product = UnibenProduct() 41 41 product.product_id = u'SAM' 42 42 product.contract_category = u'sample' … … 50 50 # set values we can expect in export file 51 51 self.setup_for_export() 52 exporter = SkeletonProductExporter()52 exporter = UnibenProductExporter() 53 53 exporter.export_all(self.app, self.outfile) 54 54 result = open(self.outfile, 'rb').read() … … 59 59 'sample,,,[],SAM,,Unnamed,2015-12-04#,,[]\r\n') 60 60 # We can import the same file. 61 processor = SkeletonProductProcessor()61 processor = UnibenProductProcessor() 62 62 result = processor.doImport( 63 63 self.outfile, … … 81 81 self.assertEqual(num_fail,0) 82 82 # We can import the same file in update mode. 83 processor = SkeletonProductProcessor()83 processor = UnibenProductProcessor() 84 84 result = processor.doImport( 85 85 self.outfile, -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/products/tests/test_product.py
r14178 r14181 25 25 26 26 from ikobacustom.uniben.testing import (FunctionalLayer, FunctionalTestCase) 27 from ikobacustom.uniben.products.product import SkeletonProduct28 from ikobacustom.uniben.products.interfaces import I SkeletonProduct27 from ikobacustom.uniben.products.product import UnibenProduct 28 from ikobacustom.uniben.products.interfaces import IUnibenProduct 29 29 30 class SkeletonProductTestCase(FunctionalTestCase):30 class UnibenProductTestCase(FunctionalTestCase): 31 31 32 32 layer = FunctionalLayer … … 36 36 self.assertTrue( 37 37 verifyClass( 38 I SkeletonProduct, SkeletonProduct)38 IUnibenProduct, UnibenProduct) 39 39 ) 40 40 self.assertTrue( 41 41 verifyObject( 42 I SkeletonProduct, SkeletonProduct())42 IUnibenProduct, UnibenProduct()) 43 43 ) 44 44 return 45 45 46 def test_add SkeletonProduct(self):46 def test_addUnibenProduct(self): 47 47 container = ProductsContainer() 48 48 product = createObject(u'waeup.Product') -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/utils/utils.py
r14178 r14181 33 33 ] 34 34 35 class SkeletonIkobaUtils(IkobaUtils):35 class UnibenIkobaUtils(IkobaUtils): 36 36 """A collection of methods subject to customization. 37 37 """
Note: See TracChangeset for help on using the changeset viewer.