Changeset 12484


Ignore:
Timestamp:
18 Jan 2015, 08:19:27 (10 years ago)
Author:
Henrik Bettermann
Message:

Rename PCNLicenseContract.

Location:
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/batching.py

    r12401 r12484  
    2626    IPCNCustomerJPGDocument,
    2727    IPCNCustomerPDFDocument,
    28     IPCNLicenseContract)
     28    IRONContract)
    2929from ikobacustom.pcn.interfaces import MessageFactory as _
    3030
     
    5757    factory_name = 'waeup.PCNCustomerPDFDocument'
    5858
    59 class PCNLicenseContractProcessor(ContractProcessorBase):
    60     """A batch processor for IPCNLicenseContract objects.
     59class RONContractProcessor(ContractProcessorBase):
     60    """A batch processor for IRONContract objects.
    6161    """
    62     util_name = 'pcnlicensecontractprocessor'
     62    util_name = 'roncontractprocessor'
    6363    grok.name(util_name)
    6464    name = _('PCN Customer Contract Processor')
    65     iface = IPCNLicenseContract
    66     factory_name = 'waeup.PCNLicenseContract'
     65    iface = IRONContract
     66    factory_name = 'waeup.RONContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py

    r12401 r12484  
    2828from ikobacustom.pcn.interfaces import MessageFactory as _
    2929from ikobacustom.pcn.customers.interfaces import (
    30     IPCNLicenseContract, IPCNLicenseContractEdit, IPCNLicenseContractProcess)
     30    IRONContract, IRONContractEdit, IRONContractProcess)
    3131
    3232
    33 class PCNLicenseContract(ContractBase):
     33class RONContract(ContractBase):
    3434    """This is a sample contract.
    3535    """
    3636
    3737    grok.implements(
    38         IPCNLicenseContractProcess,
    39         IPCNLicenseContract,
    40         IPCNLicenseContractEdit,
     38        IRONContractProcess,
     39        IRONContract,
     40        IRONContractEdit,
    4141        ICustomerNavigation)
    4242
    4343    contract_category = 'license'
    4444
    45     form_fields_interface = IPCNLicenseContract
     45    form_fields_interface = IRONContract
    4646
    47     edit_form_fields_interface = IPCNLicenseContractEdit
     47    edit_form_fields_interface = IRONContractEdit
    4848
    49     check_docs_interface = IPCNLicenseContract
     49    check_docs_interface = IRONContract
    5050
    51 PCNLicenseContract = attrs_to_fields(PCNLicenseContract)
     51RONContract = attrs_to_fields(RONContract)
    5252
    5353
    5454# Contracts must be importable. So we might need a factory.
    55 class PCNLicenseContractFactory(grok.GlobalUtility):
     55class RONContractFactory(grok.GlobalUtility):
    5656    """A factory for contracts.
    5757    """
    5858    grok.implements(IFactory)
    59     grok.name(u'waeup.PCNLicenseContract')
     59    grok.name(u'waeup.RONContract')
    6060    title = u"Create a new license contract.",
    6161    description = u"This factory instantiates new license contract instances."
    6262
    6363    def __call__(self, *args, **kw):
    64         return PCNLicenseContract(*args, **kw)
     64        return RONContract(*args, **kw)
    6565
    6666    def getInterfaces(self):
    67         return implementedBy(PCNLicenseContract)
     67        return implementedBy(RONContract)
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py

    r12401 r12484  
    2323from ikobacustom.pcn.customers.interfaces import (
    2424    IPCNCustomer, IPCNCustomerJPGDocument,
    25     IPCNCustomerPDFDocument, IPCNLicenseContract)
     25    IPCNCustomerPDFDocument, IRONContract)
    2626from ikobacustom.pcn.interfaces import MessageFactory as _
    2727
     
    5050
    5151
    52 class PCNLicenseContractExporter(ContractExporterBase):
     52class RONContractExporter(ContractExporterBase):
    5353    """Exporter for Contract instances.
    5454    """
    55     grok.name('pcnlicensecontracts')
    56     iface = IPCNLicenseContract
     55    grok.name('roncontracts')
     56    iface = IRONContract
    5757    title = _(u'PCN Customer License Contracts')
    58     class_name = 'PCNLicenseContract'
     58    class_name = 'RONContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12401 r12484  
    4646# Customer contract interfaces
    4747
    48 class IPCNLicenseContract(IContract):
     48class IRONContract(IContract):
    4949    """A customer contract sample with document attached.
    5050
    5151    """
    5252
    53     document_object = schema.Choice(
    54         title = _(u'Document'),
    55         source = CustomerDocumentSource(),
    56         required = False,
    57         )
     53    #document_object = schema.Choice(
     54    #    title = _(u'Document'),
     55    #    source = CustomerDocumentSource(),
     56    #    required = False,
     57    #    )
    5858
    59 class IPCNLicenseContractProcess(IPCNLicenseContract):
     59class IRONContractProcess(IRONContract):
    6060    """Interface for processing contract data.
    6161    """
     
    6969        )
    7070
    71 class IPCNLicenseContractEdit(IPCNLicenseContract):
     71class IRONContractEdit(IRONContract):
    7272    """Interface for editing sample contract data by customers.
    7373
     
    8080        )
    8181
    82     document_object = schema.Choice(
    83         title = _(u'Document'),
    84         source = CustomerDocumentSource(),
    85         required = True,
    86         )
     82    #document_object = schema.Choice(
     83    #    title = _(u'Document'),
     84    #    source = CustomerDocumentSource(),
     85    #    required = True,
     86    #    )
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py

    r12460 r12484  
    3434    PCNCustomerPDFDocumentExporter,
    3535    PCNCustomerJPGDocumentExporter,
    36     PCNLicenseContractExporter)
     36    RONContractExporter)
    3737from ikobacustom.pcn.customers.batching import (
    3838    PCNCustomerProcessor,
    3939    PCNCustomerPDFDocumentProcessor,
    4040    PCNCustomerJPGDocumentProcessor,
    41     PCNLicenseContractProcessor)
     41    RONContractProcessor)
    4242from ikobacustom.pcn.testing import FunctionalLayer, samples_dir
    4343
     
    6868        customer['documents'].addDocument(document1)
    6969        customer['documents'].addDocument(document2)
    70         contract = createObject(u'waeup.PCNLicenseContract')
     70        contract = createObject(u'waeup.RONContract')
    7171        contract.tc_dict = {'en':u'Hello World'}
    7272        customer['contracts'].addContract(contract)
     
    210210        # set values we can expect in export file
    211211        self.setup_for_export()
    212         exporter = PCNLicenseContractExporter()
     212        exporter = RONContractExporter()
    213213        exporter.export_all(self.app, self.outfile)
    214214        result = open(self.outfile, 'rb').read()
     
    217217            'history,last_product_id,product_object,product_options,'
    218218            'state,tc_dict,title,user_id\r\n'
    219             'PCNLicenseContract,license,%s,,'
     219            'RONContract,license,%s,,'
    220220            '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']'
    221221            ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n'
    222222            % self.contract.contract_id)
    223223        # We can reimport the file if we change the header (user_id -> customer_id)
    224         processor = PCNLicenseContractProcessor()
     224        processor = RONContractProcessor()
    225225        open(self.outfile, 'wb').write(
    226226            'class_name,contract_category,contract_id,document_object,'
    227227            'history,last_product_id,product_object,product_options,'
    228228            'state,tc_dict,title,user_id\r\n'
    229             'PCNLicenseContract,license,%s,,'
     229            'RONContract,license,%s,,'
    230230            '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']'
    231231            ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n'
     
    270270        self._contract_category = u'license'
    271271        self._document_factory = 'waeup.PCNCustomerPDFDocument'
    272         self._contract_factory = 'waeup.PCNLicenseContract'
     272        self._contract_factory = 'waeup.RONContract'
    273273        return
    274274
     
    326326        self._contract_category = u'license'
    327327        self._document_factory = 'waeup.PCNCustomerPDFDocument'
    328         self._contract_factory = 'waeup.PCNLicenseContract'
     328        self._contract_factory = 'waeup.RONContract'
    329329        return
    330330
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py

    r12401 r12484  
    2929
    3030from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase)
    31 from ikobacustom.pcn.customers.contracts import PCNLicenseContract
    32 from ikobacustom.pcn.customers.interfaces import IPCNLicenseContract
     31from ikobacustom.pcn.customers.contracts import RONContract
     32from ikobacustom.pcn.customers.interfaces import IRONContract
    3333
    3434
     
    3838
    3939    def test_interfaces(self):
    40         verify.verifyClass(IPCNLicenseContract, PCNLicenseContract)
    41         verify.verifyClass(ICustomerNavigation, PCNLicenseContract)
    42         verify.verifyObject(IPCNLicenseContract, PCNLicenseContract())
    43         verify.verifyObject(ICustomerNavigation, PCNLicenseContract())
     40        verify.verifyClass(IRONContract, RONContract)
     41        verify.verifyClass(ICustomerNavigation, RONContract)
     42        verify.verifyObject(IRONContract, RONContract())
     43        verify.verifyObject(ICustomerNavigation, RONContract())
    4444        return
    4545
    4646    def test_addContract(self):
    4747        container = ContractsContainer()
    48         contract = createObject(u'waeup.PCNLicenseContract')
     48        contract = createObject(u'waeup.RONContract')
    4949        id = contract.contract_id
    5050        container.addContract(contract)
    5151        self.assertEqual(container[id], contract)
    5252        self.assertRaises(TypeError, container.addContract, object())
    53         self.assertEqual(contract.class_name, 'PCNLicenseContract')
     53        self.assertEqual(contract.class_name, 'RONContract')
    5454        return
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py

    r12401 r12484  
    5454        #'SampleContract': _('Sample Contract'),
    5555
    56         'PCNLicenseContract': _('PCN License Contract'),
     56        'RONContract': _('Retention Of Name'),
    5757        }
    5858
     
    6565        'pcncustomerjpgdocuments',
    6666        'pcncustomerpdfdocuments',
    67         'pcnlicensecontracts')
     67        'roncontracts')
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/utils.py

    r12412 r12484  
    6868        'pcncustomerjpgdocuments',
    6969        'pcncustomerpdfdocuments',
    70         'pcnlicensecontracts')
     70        'roncontracts')
    7171
    7272    BATCH_PROCESSOR_NAMES = (
     
    7474        'pcncustomerjpgdocumentprocessor',
    7575        'pcncustomerpdfdocumentprocessor',
    76         'pcnlicensecontractprocessor',
     76        'roncontractprocessor',
    7777        'pcnproductprocessor',
    7878        'pdfdocumentprocessor',
Note: See TracChangeset for help on using the changeset viewer.