Changeset 12371 for main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products
- Timestamp:
- 3 Jan 2015, 07:38:07 (10 years ago)
- Location:
- main/ikobacustom.pcn/trunk
- Files:
-
- 9 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/products/__init__.py
r12177 r12371 2 2 """ 3 3 # Make this a package. 4 from ikobacustom. skeleton.products.product import SkeletonProduct4 from ikobacustom.pcn.products.product import PCNProduct 5 5 6 6 __all__ = [ 7 ' SkeletonProduct',7 'PCNProduct', 8 8 ] -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/batching.py
r12284 r12371 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Batch processing for skeleton products.18 """Batch processing for pcn 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.pcn.products.interfaces import IPCNProduct 23 from ikobacustom.pcn.interfaces import MessageFactory as _ 24 24 25 class SkeletonProductProcessor(ProductProcessor):25 class PCNProductProcessor(ProductProcessor): 26 26 27 iface = I SkeletonProduct28 name = _(' SkeletonProduct Processor')29 util_name = ' skeletonproductprocessor'27 iface = IPCNProduct 28 name = _('PCN Product Processor') 29 util_name = 'pcnproductprocessor' 30 30 grok.name(util_name) -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/export.py
r12270 r12371 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Exporters for skeleton products.18 """Exporters for pcn 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.pcn.products.interfaces import IPCNProduct 24 from ikobacustom.pcn.interfaces import MessageFactory as _ 25 25 26 26 27 class SkeletonProductExporter(ProductExporter):27 class PCNProductExporter(ProductExporter): 28 28 """Exporter for products. 29 29 """ 30 30 31 fields = tuple(sorted(iface_names(I SkeletonProduct))) + (31 fields = tuple(sorted(iface_names(IPCNProduct))) + ( 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'PCN Products') -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/interfaces.py
r12292 r12371 17 17 ## 18 18 from waeup.ikoba.products.interfaces import IProduct 19 from ikobacustom. skeleton.interfaces import MessageFactory as _19 from ikobacustom.pcn.interfaces import MessageFactory as _ 20 20 21 21 22 class I SkeletonProduct(IProduct):23 """A representation of a skeleton product.22 class IPCNProduct(IProduct): 23 """A representation of a pcn product. 24 24 25 25 """ -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/product.py
r12270 r12371 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.pcn.products.interfaces import IPCNProduct 27 from ikobacustom.pcn.interfaces import MessageFactory as _ 28 28 29 29 30 class SkeletonProduct(Product):30 class PCNProduct(Product): 31 31 """This is a product. 32 32 """ 33 grok.implements(I SkeletonProduct)34 grok.provides(I SkeletonProduct)33 grok.implements(IPCNProduct) 34 grok.provides(IPCNProduct) 35 35 36 SkeletonProduct = attrs_to_fields(SkeletonProduct)36 PCNProduct = attrs_to_fields(PCNProduct) 37 37 38 38 39 class SkeletonProductFactory(grok.GlobalUtility):39 class PCNProductFactory(grok.GlobalUtility): 40 40 """A factory for products. 41 41 """ … … 43 43 grok.name(u'waeup.Product') 44 44 title = u"Create a new product.", 45 description = u"This factory instantiates new skeleton products."45 description = u"This factory instantiates new pcn products." 46 46 47 47 def __call__(self, *args, **kw): 48 return SkeletonProduct(*args, **kw)48 return PCNProduct(*args, **kw) 49 49 50 50 def getInterfaces(self): 51 return implementedBy( SkeletonProduct)51 return implementedBy(PCNProduct) -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/tests/test_browser.py
r12367 r12371 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.pcn.products.product import PCNProduct 30 from ikobacustom.pcn.products.export import PCNProductExporter 31 from ikobacustom.pcn.products.batching import PCNProductProcessor 32 from ikobacustom.pcn.testing import FunctionalLayer 33 33 34 34 … … 38 38 39 39 def setup_for_export(self): 40 product = SkeletonProduct()40 product = PCNProduct() 41 41 product.product_id = u'LIC' 42 42 product.valid_from = datetime.date(2015, 12, 4) … … 49 49 # set values we can expect in export file 50 50 self.setup_for_export() 51 exporter = SkeletonProductExporter()51 exporter = PCNProductExporter() 52 52 exporter.export_all(self.app, self.outfile) 53 53 result = open(self.outfile, 'rb').read() … … 57 57 'license,,[],LIC,,Unnamed,2015-12-04#,,[]\r\n') 58 58 # We can import the same file. 59 processor = SkeletonProductProcessor()59 processor = PCNProductProcessor() 60 60 result = processor.doImport( 61 61 self.outfile, … … 77 77 self.assertEqual(num_fail,0) 78 78 # We can import the same file in update mode. 79 processor = SkeletonProductProcessor()79 processor = PCNProductProcessor() 80 80 result = processor.doImport( 81 81 self.outfile, -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/tests/test_product.py
r12177 r12371 17 17 ## 18 18 """ 19 Tests for skeleton products.19 Tests for pcn 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.pcn.testing import (FunctionalLayer, FunctionalTestCase) 27 from ikobacustom.pcn.products.product import PCNProduct 28 from ikobacustom.pcn.products.interfaces import IPCNProduct 29 29 30 class SkeletonProductTestCase(FunctionalTestCase):30 class PCNProductTestCase(FunctionalTestCase): 31 31 32 32 layer = FunctionalLayer … … 36 36 self.assertTrue( 37 37 verifyClass( 38 I SkeletonProduct, SkeletonProduct)38 IPCNProduct, PCNProduct) 39 39 ) 40 40 self.assertTrue( 41 41 verifyObject( 42 I SkeletonProduct, SkeletonProduct())42 IPCNProduct, PCNProduct()) 43 43 ) 44 44 return 45 45 46 def test_add SkeletonProduct(self):46 def test_addPCNProduct(self): 47 47 container = ProductsContainer() 48 48 product = createObject(u'waeup.Product')
Note: See TracChangeset for help on using the changeset viewer.