Author: jmorliaguet Date: Fri Mar 24 00:01:49 2006 New Revision: 2709 Added: cpsskins/branches/jmo-perspectives/setup/test/ cpsskins/branches/jmo-perspectives/setup/test/__init__.py (contents, props changed) cpsskins/branches/jmo-perspectives/setup/test/dummy.py (contents, props changed) cpsskins/branches/jmo-perspectives/setup/test/resource4.xml (contents, props changed) Log:
- added missing files Added: cpsskins/branches/jmo-perspectives/setup/test/__init__.py ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/setup/test/__init__.py Fri Mar 24 00:01:49 2006 @@ -0,0 +1,19 @@ +############################################################################## +# +# Copyright (c) 2005-2006 Nuxeo and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +############################################################################## +""" + +$Id$ +""" +__docformat__ = "reStructuredText" + Added: cpsskins/branches/jmo-perspectives/setup/test/dummy.py ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/setup/test/dummy.py Fri Mar 24 00:01:49 2006 @@ -0,0 +1,64 @@ +############################################################################## +# +# Copyright (c) 2005-2006 Nuxeo and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +############################################################################## +"""Application setup tests + +$Id$ +""" +__docformat__ = "reStructuredText" + +from xml.dom.minidom import parseString + +from zope.component import adapts +from zope.component.factory import Factory +from zope.interface import Interface, implements + +from cpsskins.io.interfaces import IDataExporter, IDataImporter + +class IDummyResource(Interface): + """Dummy resource interface""" + +class DummyResource(object): + """A dummy resource for testing. + """ + implements(IDummyResource) + + def __init__(self, title=u''): + self.title = title + + def setTitle(self, title=u''): + self.title = title + + def __repr__(self): + return '<Dummy resource: %s>' % self.title + +DummyFactory = Factory(DummyResource, "Dummy Factory", + "Factory that creates dummy resources") + +class DummyResourceImporter(object): + + adapts(IDummyResource) + implements(IDataImporter) + + def __init__(self, context): + self.context = context + + def load(self, xml=u''): + context = self.context + dom = parseString(xml) + dummies = dom.getElementsByTagName('dummy') + if dummies: + dummy = dummies[0] + context.name = dummy.getAttribute('name') + context.title = dummy.getAttribute('title') + Added: cpsskins/branches/jmo-perspectives/setup/test/resource4.xml ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/setup/test/resource4.xml Fri Mar 24 00:01:49 2006 @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<setting name="test.setting4" title="Test setting 4"> + <dummy name="dummy.resource" title="Dummy resource 4" /> +</setting> -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins