- Timestamp:
- 5 Dec 2016, 09:14:32 (8 years ago)
- Location:
- main/ikobacustom.aaue/trunk/src/ikobacustom/aaue
- Files:
-
- 7 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.aaue/trunk/src/ikobacustom/aaue/products/__init__.py
r12177 r14310 2 2 """ 3 3 # Make this a package. 4 from ikobacustom. skeleton.products.product import SkeletonProduct4 from ikobacustom.aaue.products.product import AAUEProduct 5 5 6 6 __all__ = [ 7 ' SkeletonProduct',7 'AAUEProduct', 8 8 ] -
main/ikobacustom.aaue/trunk/src/ikobacustom/aaue/products/batching.py
r12284 r14310 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Batch processing for skeletonproducts.18 """Batch processing for aaue products. 19 19 """ 20 20 import grok 21 21 from waeup.ikoba.products.batching import ProductProcessor 22 from ikobacustom. skeleton.products.interfaces import ISkeletonProduct23 from ikobacustom. skeleton.interfaces import MessageFactory as _22 from ikobacustom.aaue.products.interfaces import IAAUEProduct 23 from ikobacustom.aaue.interfaces import MessageFactory as _ 24 24 25 class SkeletonProductProcessor(ProductProcessor):25 class AAUEProductProcessor(ProductProcessor): 26 26 27 iface = I SkeletonProduct28 name = _(' SkeletonProduct Processor')29 util_name = ' skeletonproductprocessor'27 iface = IAAUEProduct 28 name = _('AAUE Product Processor') 29 util_name = 'aaueproductprocessor' 30 30 grok.name(util_name) -
main/ikobacustom.aaue/trunk/src/ikobacustom/aaue/products/export.py
r12270 r14310 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Exporters for skeletonproducts.18 """Exporters for aaue products. 19 19 """ 20 20 import grok 21 21 from waeup.ikoba.utils.helpers import iface_names 22 22 from waeup.ikoba.products.export import ProductExporter 23 from ikobacustom. skeleton.products.interfaces import ISkeletonProduct24 from ikobacustom. skeleton.interfaces import MessageFactory as _23 from ikobacustom.aaue.products.interfaces import IAAUEProduct 24 from ikobacustom.aaue.interfaces import MessageFactory as _ 25 25 26 26 27 class SkeletonProductExporter(ProductExporter):27 class AAUEProductExporter(ProductExporter): 28 28 """Exporter for products. 29 29 """ 30 30 31 fields = tuple(sorted(iface_names(I SkeletonProduct))) + (31 fields = tuple(sorted(iface_names(IAAUEProduct))) + ( 32 32 'users_with_local_roles',) 33 33 34 34 #: The title under which this exporter will be displayed 35 #title = _(u' SkeletonProducts')35 #title = _(u'AAUE Products') -
main/ikobacustom.aaue/trunk/src/ikobacustom/aaue/products/interfaces.py
r12292 r14310 17 17 ## 18 18 from waeup.ikoba.products.interfaces import IProduct 19 from ikobacustom. skeleton.interfaces import MessageFactory as _19 from ikobacustom.aaue.interfaces import MessageFactory as _ 20 20 21 21 22 class I SkeletonProduct(IProduct):23 """A representation of a skeletonproduct.22 class IAAUEProduct(IProduct): 23 """A representation of a aaue product. 24 24 25 25 """ -
main/ikobacustom.aaue/trunk/src/ikobacustom/aaue/products/product.py
r12399 r14310 24 24 from waeup.ikoba.utils.helpers import attrs_to_fields 25 25 from waeup.ikoba.products.product import Product 26 from ikobacustom. skeleton.products.interfaces import ISkeletonProduct27 from ikobacustom. skeleton.interfaces import MessageFactory as _26 from ikobacustom.aaue.products.interfaces import IAAUEProduct 27 from ikobacustom.aaue.interfaces import MessageFactory as _ 28 28 29 29 30 class SkeletonProduct(Product):30 class AAUEProduct(Product): 31 31 """This is a product. 32 32 """ 33 grok.implements(I SkeletonProduct)34 grok.provides(I SkeletonProduct)33 grok.implements(IAAUEProduct) 34 grok.provides(IAAUEProduct) 35 35 36 form_fields_interface = I SkeletonProduct36 form_fields_interface = IAAUEProduct 37 37 38 SkeletonProduct = attrs_to_fields(SkeletonProduct)38 AAUEProduct = attrs_to_fields(AAUEProduct) 39 39 40 40 41 class SkeletonProductFactory(grok.GlobalUtility):41 class AAUEProductFactory(grok.GlobalUtility): 42 42 """A factory for products. 43 43 """ … … 45 45 grok.name(u'waeup.Product') 46 46 title = u"Create a new product.", 47 description = u"This factory instantiates new skeletonproducts."47 description = u"This factory instantiates new aaue products." 48 48 49 49 def __call__(self, *args, **kw): 50 return SkeletonProduct(*args, **kw)50 return AAUEProduct(*args, **kw) 51 51 52 52 def getInterfaces(self): 53 return implementedBy( SkeletonProduct)53 return implementedBy(AAUEProduct) -
main/ikobacustom.aaue/trunk/src/ikobacustom/aaue/products/tests/test_browser.py
r12685 r14310 27 27 from zope.interface.verify import verifyObject, verifyClass 28 28 from waeup.ikoba.products.tests.test_batching import ProductImportExportSetup 29 from ikobacustom. skeleton.products.product import SkeletonProduct30 from ikobacustom. skeleton.products.export import SkeletonProductExporter31 from ikobacustom. skeleton.products.batching import SkeletonProductProcessor32 from ikobacustom. skeleton.testing import FunctionalLayer29 from ikobacustom.aaue.products.product import AAUEProduct 30 from ikobacustom.aaue.products.export import AAUEProductExporter 31 from ikobacustom.aaue.products.batching import AAUEProductProcessor 32 from ikobacustom.aaue.testing import FunctionalLayer 33 33 34 34 … … 38 38 39 39 def setup_for_export(self): 40 product = SkeletonProduct()40 product = AAUEProduct() 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 = AAUEProductExporter() 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 = AAUEProductProcessor() 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 = AAUEProductProcessor() 84 84 result = processor.doImport( 85 85 self.outfile, -
main/ikobacustom.aaue/trunk/src/ikobacustom/aaue/products/tests/test_product.py
r12177 r14310 17 17 ## 18 18 """ 19 Tests for skeletonproducts.19 Tests for aaue products. 20 20 """ 21 21 from zope.interface.verify import verifyClass, verifyObject … … 24 24 from waeup.ikoba.products.container import ProductsContainer 25 25 26 from ikobacustom. skeleton.testing import (FunctionalLayer, FunctionalTestCase)27 from ikobacustom. skeleton.products.product import SkeletonProduct28 from ikobacustom. skeleton.products.interfaces import ISkeletonProduct26 from ikobacustom.aaue.testing import (FunctionalLayer, FunctionalTestCase) 27 from ikobacustom.aaue.products.product import AAUEProduct 28 from ikobacustom.aaue.products.interfaces import IAAUEProduct 29 29 30 class SkeletonProductTestCase(FunctionalTestCase):30 class AAUEProductTestCase(FunctionalTestCase): 31 31 32 32 layer = FunctionalLayer … … 36 36 self.assertTrue( 37 37 verifyClass( 38 I SkeletonProduct, SkeletonProduct)38 IAAUEProduct, AAUEProduct) 39 39 ) 40 40 self.assertTrue( 41 41 verifyObject( 42 I SkeletonProduct, SkeletonProduct())42 IAAUEProduct, AAUEProduct()) 43 43 ) 44 44 return 45 45 46 def test_add SkeletonProduct(self):46 def test_addAAUEProduct(self): 47 47 container = ProductsContainer() 48 48 product = createObject(u'waeup.Product')
Note: See TracChangeset for help on using the changeset viewer.