From hannosch at codespeak.net Sun Jun 6 21:31:51 2010 From: hannosch at codespeak.net (hannosch at codespeak.net) Date: Sun, 6 Jun 2010 21:31:51 +0200 (CEST) Subject: [KSS-checkins] r75154 - kukit/kss.core/trunk Message-ID: <20100606193151.A6875282BF6@codespeak.net> Author: hannosch Date: Sun Jun 6 21:31:48 2010 New Revision: 75154 Modified: kukit/kss.core/trunk/CHANGES.txt Log: Much less whitespace Modified: kukit/kss.core/trunk/CHANGES.txt ============================================================================== --- kukit/kss.core/trunk/CHANGES.txt (original) +++ kukit/kss.core/trunk/CHANGES.txt Sun Jun 6 21:31:48 2010 @@ -10,314 +10,313 @@ 1.6.0.a3 (2010-04-27) --------------------- - - Add BeforeRenderKSSCommandsEvent notification. - [gotcha] +- Add BeforeRenderKSSCommandsEvent notification. + [gotcha] 1.6.0.a2 (2010-03-09) --------------------- - - Made GenericResource declare that it implements IResource. - [optilude] +- Made GenericResource declare that it implements IResource. + [optilude] - - Add timeout tests in error handling demo - [gotcha, jfroche] - - - Add SetActionServerTimeout client action - [gotcha, jfroche] +- Add timeout tests in error handling demo + [gotcha, jfroche] + +- Add SetActionServerTimeout client action + [gotcha, jfroche] 1.6.0.a1 (2009-11-19) --------------------- - - adjust ISite import to work in Zope 2.12 - [davisagli] +- adjust ISite import to work in Zope 2.12 + [davisagli] - - call cleanup when the test layer is torn down to avoid polluting - the test environment - [davisagli] +- call cleanup when the test layer is torn down to avoid polluting + the test environment + [davisagli] - - Avoid dependency on zope.app.zapi package. - [hannosch] +- Avoid dependency on zope.app.zapi package. + [hannosch] - - Specify package dependencies. - [hannosch] +- Specify package dependencies. + [hannosch] 1.4.7 (2009-05-11) ------------------ - - Fix kukit payload in favor of IE6 XP SP3. - xmlns="http://www.kukit.org/commands/1.1" removed - from kukit tag as it breaks IE6 XP SP3. - [gotcha] +- Fix kukit payload in favor of IE6 XP SP3. + xmlns="http://www.kukit.org/commands/1.1" removed + from kukit tag as it breaks IE6 XP SP3. + [gotcha] 1.4.6 (2009-04-10) ------------------ - - fix RequestManager's handling of the sendingTimeout parameter, - to enable setting the timeout globally from custom code, if needed. - [ree] - +- fix RequestManager's handling of the sendingTimeout parameter, + to enable setting the timeout globally from custom code, if needed. + [ree] + 1.4.5 (2009-02-02) ------------------ - - Added kss.blur action. - [simon] +- Added kss.blur action. + [simon] 1.4.4 (2009-01-05) ------------------ - - Fix the ca_cancel (action-cancel) test that was broken - on IE7 because it contained the same id more times. - [ree] - - - Fix or improve calculateAbsoluteURL to handle absolute - and relative urls correctly, as well as get rid of the - double slash (//) issue. - It also satisfies the tests kss_url_param and - kss_url_param_multiprop, that now work as intended, - with previous workaround removed. - [ree] - - - Use the real request in the json logic so skin layers, request parmeters, - etc. are available. - [wichert] - +- Fix the ca_cancel (action-cancel) test that was broken + on IE7 because it contained the same id more times. + [ree] + +- Fix or improve calculateAbsoluteURL to handle absolute + and relative urls correctly, as well as get rid of the + double slash (//) issue. + It also satisfies the tests kss_url_param and + kss_url_param_multiprop, that now work as intended, + with previous workaround removed. + [ree] + +- Use the real request in the json logic so skin layers, request parmeters, + etc. are available. + [wichert] + 1.4.3 (2008-08-18) ------------------ - - Replaced license header of third-party sarissa.js - to workaround the license detection of ohloh. - sarissa.js is redistributed under GNU GPL v2 - as previously. - [ree] +- Replaced license header of third-party sarissa.js + to workaround the license detection of ohloh. + sarissa.js is redistributed under GNU GPL v2 + as previously. + [ree] - - Fix cssQuery-compat.js to use newest base2 api. - [ree] +- Fix cssQuery-compat.js to use newest base2 api. + [ree] 1.4.2 (2008-07-06) ------------------ - - Include meta.zcml from configure.zcml, in order to - allow easier loading of dependent zcml during unittests - [gotcha, jfroche] +- Include meta.zcml from configure.zcml, in order to + allow easier loading of dependent zcml during unittests + [gotcha, jfroche] 1.4.1 (2008-06-02) ------------------ - - Add @@kss_devel_mode/needs_old_cssquery, to enable a workaround - for Safari 3.1 to work. - [ree] - - - Fix a typo that caused an exception instead of - logging an error message, this happened when - an action was registered twice with the same name. - [ree] - +- Add @@kss_devel_mode/needs_old_cssquery, to enable a workaround + for Safari 3.1 to work. + [ree] + +- Fix a typo that caused an exception instead of + logging an error message, this happened when + an action was registered twice with the same name. + [ree] 1.4 (2008-04-21) ---------------- - - - Updated base2-dom-fp.js with newest version. - [ree] - - - Change concatresource to accept resources with - "application/x-javascript" content type only - [ree] - - - DONE ONLY ON BRANCH 1.4 !!! - Add improved demos - (insertions in tbody is not included : that demo is - still broken in IE6) - [cryu, jone, gotcha] - - - fix setKssAttribute action and command - (closes bug 8048 from plone.org) - [gotcha] - - fix action-cancel - [gotcha] +- Updated base2-dom-fp.js with newest version. + [ree] + +- Change concatresource to accept resources with + "application/x-javascript" content type only + [ree] + +- DONE ONLY ON BRANCH 1.4 !!! + Add improved demos + (insertions in tbody is not included : that demo is + still broken in IE6) + [cryu, jone, gotcha] + +- fix setKssAttribute action and command + (closes bug 8048 from plone.org) + [gotcha] + +- fix action-cancel + [gotcha] 1.4-rc1 (2008-03-25) -------------------- - - disabled input values should not be submitted with the form - [gotcha] +- disabled input values should not be submitted with the form + [gotcha] - - Updated base2-don-fp.js with newest version. - This fixes breakage on FireFox 3. - [ree] +- Updated base2-don-fp.js with newest version. + This fixes breakage on FireFox 3. + [ree] 1.4-alpha1 (2008-03-09) ----------------------- - - refactor the value provider registry to use - a single registry in place of 3. - This will enable to define value - providers that recieve non-string parameters - like a node selection. - [ree] - - - Remove previously deprecated form() and - currentForm() value providers from normal - action parameters (remark: they should - be used with kssSelector.) - They now give a parsing error. - [ree] - - - Implement multiproperties in - action-client and action-server - [ree] - - - add url() and alias() providers - [ree] - - - Change develui.css to have its style inline with - kssproject.org. - [gotcha] - - - Add some tests for binder classes. - [ree] - - - Improve some of the demos to make them Selenium testable - under both dev and prod mode, fix their tests. - [gotcha] - - - Use functions in token table instead of code strings - that were evaluated. 'eval' is very slow. - in kukit.js [gotcha] - - - Refactor code towards module and class closures. - in kukit.js [gotcha] - - - Fix multiple selection form fields - marshalling on Safari - (fixes #22 in kssproject) - and on IE. - [ree] - - - Fix error fallback handling - [ree] - - - Implement loglevels based on cookies - Add handling of log levels to the kss mode view - [ree] - - - Moved the core demos to this package from kss.demo. - They are now located under the core plugin. - [ree] - - - Implement event binding based on the ids fetched - dynamically from the dom, by value providers. - [ree] - - - Changed kukit payload to encode HTML content of CDATA. - This was necessary because us a supposed bug in FF, that - prevented us to use base2 (xpath selection did not work - on inserted elements, due to namespace issues.) - Get rid of forceToDom, make sure all plugins accept html - parameters as strings. - [ree] +- refactor the value provider registry to use + a single registry in place of 3. + This will enable to define value + providers that recieve non-string parameters + like a node selection. + [ree] + +- Remove previously deprecated form() and + currentForm() value providers from normal + action parameters (remark: they should + be used with kssSelector.) + They now give a parsing error. + [ree] + +- Implement multiproperties in + action-client and action-server + [ree] + +- add url() and alias() providers + [ree] + +- Change develui.css to have its style inline with + kssproject.org. + [gotcha] + +- Add some tests for binder classes. + [ree] + +- Improve some of the demos to make them Selenium testable + under both dev and prod mode, fix their tests. + [gotcha] + +- Use functions in token table instead of code strings + that were evaluated. 'eval' is very slow. + in kukit.js [gotcha] + +- Refactor code towards module and class closures. + in kukit.js [gotcha] + +- Fix multiple selection form fields + marshalling on Safari + (fixes #22 in kssproject) + and on IE. + [ree] + +- Fix error fallback handling + [ree] + +- Implement loglevels based on cookies + Add handling of log levels to the kss mode view + [ree] + +- Moved the core demos to this package from kss.demo. + They are now located under the core plugin. + [ree] + +- Implement event binding based on the ids fetched + dynamically from the dom, by value providers. + [ree] + +- Changed kukit payload to encode HTML content of CDATA. + This was necessary because us a supposed bug in FF, that + prevented us to use base2 (xpath selection did not work + on inserted elements, due to namespace issues.) + Get rid of forceToDom, make sure all plugins accept html + parameters as strings. + [ree] 1.2 (2007-08-17) ---------------- - - Refactored js code. - [gotcha] +- Refactored js code. + [gotcha] 1.2-rc2 (2007-07-27) -------------------- - - Prepare for release. - [ree] +- Prepare for release. + [ree] - - when attrname is kssattr:xxx, IE chokes on certain nodes - [gotcha] +- when attrname is kssattr:xxx, IE chokes on certain nodes + [gotcha] - - fix form marshalling - [gotcha] +- fix form marshalling + [gotcha] 1.2-rc1.1 --------- - - Prepare for release. - Identical with 1.2-rc1, just created for consistent versions. - [ree] +- Prepare for release. + Identical with 1.2-rc1, just created for consistent versions. + [ree] 1.2-rc1 ------- - - Deprecated addClassName, removeClassName actions and - commands in favour of addClass and removeClass. - Deprecated "name" and "classname" parameter in addClass, - removeClass, toggleClass actions and commands in favour of - "value". - [ree] - - - implement new packing directives and two disctint - versions of the javascript (development and production), - this is achieved from javascript with the ;;; marker - Also add the @@kss_devel_mode/ui view for changing - the development mode from the browser. - [ree] - - - Add the passnode selector that can be used to access - the value of a default parm passed programmatically - from the event (via makeActionOper) - [ree] - - - Add action moveNodeAsLastChild - [ree] - - - Death to Azax (... long live KSS)! - Removing last traces of the old name from the sources - [gotcha] - - - Changed querying for css selectors to base2 instead of - cssQuery. Base2 is supposed to be a lot faster than - the old cssQuery. Usage is alternating, if base2 is - present that one is used, otherwise it uses the old - cssQuery code which stays the default. - [jvloothuis, ree] - - - Add moveNodeBefore action (presumably missing) - [ree] - - - Refactor load event, separate iload and load events. - The new event binder handles both events together. A - new parameter, evt-iload-autodetect is introduced, if - this is false we don't use detection but the iframe - must cooperate on telling us wnen we are done. There - is deprecation warning issued for the load events, if - bound on an iframe, in which case an iload event must - be used. - [ree] - - - refactor event binding to allow different iterators to bind - events in a binder instance, matching the need of the events. - [ree] +- Deprecated addClassName, removeClassName actions and + commands in favour of addClass and removeClass. + Deprecated "name" and "classname" parameter in addClass, + removeClass, toggleClass actions and commands in favour of + "value". + [ree] + +- implement new packing directives and two disctint + versions of the javascript (development and production), + this is achieved from javascript with the ;;; marker + Also add the @@kss_devel_mode/ui view for changing + the development mode from the browser. + [ree] + +- Add the passnode selector that can be used to access + the value of a default parm passed programmatically + from the event (via makeActionOper) + [ree] + +- Add action moveNodeAsLastChild + [ree] + +- Death to Azax (... long live KSS)! + Removing last traces of the old name from the sources + [gotcha] + +- Changed querying for css selectors to base2 instead of + cssQuery. Base2 is supposed to be a lot faster than + the old cssQuery. Usage is alternating, if base2 is + present that one is used, otherwise it uses the old + cssQuery code which stays the default. + [jvloothuis, ree] + +- Add moveNodeBefore action (presumably missing) + [ree] + +- Refactor load event, separate iload and load events. + The new event binder handles both events together. A + new parameter, evt-iload-autodetect is introduced, if + this is false we don't use detection but the iframe + must cooperate on telling us wnen we are done. There + is deprecation warning issued for the load events, if + bound on an iframe, in which case an iload event must + be used. + [ree] + +- refactor event binding to allow different iterators to bind + events in a binder instance, matching the need of the events. + [ree] 1.2-beta2 --------- - - Make the binding of the nodes together in one batch - [ree] +- Make the binding of the nodes together in one batch + [ree] - - added kssSubmitForm action parameter - and deprecation - [ree] +- added kssSubmitForm action parameter + and deprecation + [ree] 1.2-beta1 --------- - - Prepare for release - [ree] +- Prepare for release + [ree] 1.2-alpha2 ---------- - - Merge in Philikon's refactorization - Move docs to doc/ - [ree] +- Merge in Philikon's refactorization + Move docs to doc/ + [ree] - - Initial package structure. - [zopeskel] +- Initial package structure. + [zopeskel] From hannosch at codespeak.net Sun Jun 6 21:32:24 2010 From: hannosch at codespeak.net (hannosch at codespeak.net) Date: Sun, 6 Jun 2010 21:32:24 +0200 (CEST) Subject: [KSS-checkins] r75155 - in kukit/kss.core/trunk: . kss/core/tests Message-ID: <20100606193224.8937A282BF6@codespeak.net> Author: hannosch Date: Sun Jun 6 21:32:22 2010 New Revision: 75155 Modified: kukit/kss.core/trunk/CHANGES.txt kukit/kss.core/trunk/kss/core/tests/base.py Log: Avoid some really old Zope 2.9 compatibility code. Modified: kukit/kss.core/trunk/CHANGES.txt ============================================================================== --- kukit/kss.core/trunk/CHANGES.txt (original) +++ kukit/kss.core/trunk/CHANGES.txt Sun Jun 6 21:32:22 2010 @@ -4,8 +4,8 @@ 1.6.0.a4 (unreleased) --------------------- -- Nothing changed yet. - +- Avoid some really old Zope 2.9 compatibility code. + [hannosch] 1.6.0.a3 (2010-04-27) --------------------- Modified: kukit/kss.core/trunk/kss/core/tests/base.py ============================================================================== --- kukit/kss.core/trunk/kss/core/tests/base.py (original) +++ kukit/kss.core/trunk/kss/core/tests/base.py Sun Jun 6 21:32:22 2010 @@ -16,15 +16,12 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. -from textwrap import dedent - import warnings from Testing.ZopeTestCase import ZopeTestCase, FunctionalTestCase from zope import interface from zope.publisher.interfaces.browser import IBrowserRequest from zope.testing import cleanup -#from zope.app.testing import placelesssetup import kss.core from kss.core import KSSView @@ -41,29 +38,12 @@ from zope.configuration.xmlconfig import XMLConfig XMLConfig('tests/configure-unittest.zcml', kss.core)() else: - from Products.Five.zcml import load_string, load_config + from Products.Five.zcml import load_config load_config('meta.zcml', package=Products.Five) - try: - load_config('traversing.zcml', package=Products.Five) - except IOError: - # Let's try the Zope 2.9 way (zope.app.traversing is - # moved in 2.10) - load_string(dedent('''\ - - - - - ''')) + import zope.traversing + load_config('configure.zcml', package=zope.traversing) + # Load the permissions config, if it's there try: load_config('permissions.zcml', package=Products.Five) From hannosch at codespeak.net Sun Jun 6 22:19:11 2010 From: hannosch at codespeak.net (hannosch at codespeak.net) Date: Sun, 6 Jun 2010 22:19:11 +0200 (CEST) Subject: [KSS-checkins] r75156 - kukit/kss.concatresource/trunk/kss/concatresource/compression Message-ID: <20100606201911.8205E282BF6@codespeak.net> Author: hannosch Date: Sun Jun 6 22:19:09 2010 New Revision: 75156 Modified: kukit/kss.concatresource/trunk/kss/concatresource/compression/__init__.py Log: Support application/javascript Modified: kukit/kss.concatresource/trunk/kss/concatresource/compression/__init__.py ============================================================================== --- kukit/kss.concatresource/trunk/kss/concatresource/compression/__init__.py (original) +++ kukit/kss.concatresource/trunk/kss/concatresource/compression/__init__.py Sun Jun 6 22:19:09 2010 @@ -8,6 +8,7 @@ def compress(data, content_type, compress_level): 'Returns compressed text for a given content type' - assert content_type == 'application/x-javascript', \ + js = ['application/javascript', 'application/x-javascript'] + assert content_type in js, \ 'Only application/x-javascript content types are supported.' return compress_javascript(data, compress_level) From hannosch at codespeak.net Sun Jun 6 22:20:17 2010 From: hannosch at codespeak.net (hannosch at codespeak.net) Date: Sun, 6 Jun 2010 22:20:17 +0200 (CEST) Subject: [KSS-checkins] r75157 - kukit/kss.concatresource/trunk/kss/concatresource/compression Message-ID: <20100606202017.5D4E3282BF6@codespeak.net> Author: hannosch Date: Sun Jun 6 22:20:15 2010 New Revision: 75157 Modified: kukit/kss.concatresource/trunk/kss/concatresource/compression/__init__.py Log: Adjust the error message to be correct and more helpful Modified: kukit/kss.concatresource/trunk/kss/concatresource/compression/__init__.py ============================================================================== --- kukit/kss.concatresource/trunk/kss/concatresource/compression/__init__.py (original) +++ kukit/kss.concatresource/trunk/kss/concatresource/compression/__init__.py Sun Jun 6 22:20:15 2010 @@ -9,6 +9,5 @@ def compress(data, content_type, compress_level): 'Returns compressed text for a given content type' js = ['application/javascript', 'application/x-javascript'] - assert content_type in js, \ - 'Only application/x-javascript content types are supported.' + assert content_type in js, 'Unsupported content type %s.' % content_type return compress_javascript(data, compress_level) From hannosch at codespeak.net Sat Jun 12 11:22:11 2010 From: hannosch at codespeak.net (hannosch at codespeak.net) Date: Sat, 12 Jun 2010 11:22:11 +0200 (CEST) Subject: [KSS-checkins] r75313 - in kukit/kss.core/trunk: . kss/core kss/core/tests Message-ID: <20100612092211.B1E31282BEC@codespeak.net> Author: hannosch Date: Sat Jun 12 11:22:09 2010 New Revision: 75313 Modified: kukit/kss.core/trunk/CHANGES.txt kukit/kss.core/trunk/kss/core/actionwrapper.py kukit/kss.core/trunk/kss/core/tests/base.py kukit/kss.core/trunk/kss/core/tests/test_kssview.py kukit/kss.core/trunk/kss/core/tests/test_kssview_core.py kukit/kss.core/trunk/kss/core/tests/test_kssview_functional.py kukit/kss.core/trunk/kss/core/tests/test_siteview.py kukit/kss.core/trunk/kss/core/tests/test_ttwapi.py Log: Avoid deprecation warnings under Zope 2.13. Modified: kukit/kss.core/trunk/CHANGES.txt ============================================================================== --- kukit/kss.core/trunk/CHANGES.txt (original) +++ kukit/kss.core/trunk/CHANGES.txt Sat Jun 12 11:22:09 2010 @@ -4,6 +4,9 @@ 1.6.0.a4 (unreleased) --------------------- +- Avoid deprecation warnings under Zope 2.13. + [hannosch] + - Avoid some really old Zope 2.9 compatibility code. [hannosch] Modified: kukit/kss.core/trunk/kss/core/actionwrapper.py ============================================================================== --- kukit/kss.core/trunk/kss/core/actionwrapper.py (original) +++ kukit/kss.core/trunk/kss/core/actionwrapper.py Sat Jun 12 11:22:09 2010 @@ -129,12 +129,10 @@ Since there could be a thousand reasons why Five's magic could fail, it's good to check this. (XXX Note that this must be adjusted to run on Zope3.) + # BBB Zope 2.12 >>> try: - ... import Products.Five + ... from Zope2.App.zcml import load_string, load_config ... except ImportError: - ... # probably zope 3, not supported - ... raise 'Zope3 not supported in this test' - ... else: ... from Products.Five.zcml import load_string, load_config >>> import kss.core.tests Modified: kukit/kss.core/trunk/kss/core/tests/base.py ============================================================================== --- kukit/kss.core/trunk/kss/core/tests/base.py (original) +++ kukit/kss.core/trunk/kss/core/tests/base.py Sat Jun 12 11:22:09 2010 @@ -19,6 +19,12 @@ import warnings from Testing.ZopeTestCase import ZopeTestCase, FunctionalTestCase +# BBB Zope 2.12 +try: + from Zope2.App.zcml import load_config +except ImportError: + from Products.Five.zcml import load_config + from zope import interface from zope.publisher.interfaces.browser import IBrowserRequest from zope.testing import cleanup @@ -29,41 +35,29 @@ class KSSCoreLayer: @classmethod def setUp(cls): + import AccessControl + import Products.Five + load_config('meta.zcml', package=Products.Five) + + import zope.traversing + load_config('configure.zcml', package=zope.traversing) + + # Load the permissions config, if it's there try: - import Products.Five - except ImportError: - # probably zope 3 - pass - # XXX TODO fix this?? --- never run yet on Z3 - from zope.configuration.xmlconfig import XMLConfig - XMLConfig('tests/configure-unittest.zcml', kss.core)() - else: - from Products.Five.zcml import load_config - load_config('meta.zcml', package=Products.Five) - - import zope.traversing - load_config('configure.zcml', package=zope.traversing) - - # Load the permissions config, if it's there - try: - load_config('permissions.zcml', package=Products.Five) - except IOError: - # Zope 2.10 / Five 1.3.6 does not have it - pass - load_config('configure-unittest.zcml', package=kss.core.tests) + load_config('permissions.zcml', package=AccessControl) + except IOError: + load_config('permissions.zcml', package=Products.Five) + + load_config('configure-unittest.zcml', package=kss.core.tests) @classmethod def tearDown(cls): cleanup.cleanUp() - # placelesssetup.tearDown() + class KSSLayer(KSSCoreLayer): @classmethod def setUp(cls): - try: - from Products.Five.zcml import load_config - except ImportError: - raise ImportError("KSSLayer requires Five to be installed.") load_config('meta.zcml', package=kss.core) load_config('configure.zcml', package=kss.core) @@ -125,6 +119,3 @@ "use 'KSSViewFunctionalTestCase'- KSS uppercase instead." warnings.warn(message, DeprecationWarning, 2) KSSViewFunctionalTestCase.__init__(self, *args, **kw) - - - Modified: kukit/kss.core/trunk/kss/core/tests/test_kssview.py ============================================================================== --- kukit/kss.core/trunk/kss/core/tests/test_kssview.py (original) +++ kukit/kss.core/trunk/kss/core/tests/test_kssview.py Sat Jun 12 11:22:09 2010 @@ -16,6 +16,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. +import doctest import unittest from kss.core.interfaces import IKSSView, IKSSCommands @@ -28,7 +29,7 @@ from kss.core.tests.commandinspector import CommandInspectorView import zope.component.event -from zope.testing import doctest, cleanup +from zope.testing import cleanup from zope.publisher.interfaces.browser import IBrowserRequest from zope.app.component.hooks import setHooks Modified: kukit/kss.core/trunk/kss/core/tests/test_kssview_core.py ============================================================================== --- kukit/kss.core/trunk/kss/core/tests/test_kssview_core.py (original) +++ kukit/kss.core/trunk/kss/core/tests/test_kssview_core.py Sat Jun 12 11:22:09 2010 @@ -20,6 +20,7 @@ import textwrap from kss.core import KSSUnicodeError from kss.core.tests.base import KSSViewTestCase +from kss.core.tests.base import KSSViewFunctionalTestCase from Testing.ZopeTestCase import FunctionalDocFileSuite class TestKSSViewCoreCommandSet(KSSViewTestCase): @@ -38,10 +39,7 @@ self.assertEqual(command.getSelector(), 'selector') params = command.getParams() self.assertEqual(len(params), 0) - - # XXX since lxml is gone, the next cases are no problem anymore - # Nevertheless, we test all these cases - + def _checkSetHtmlResult(self, content, content2=None): view = self.createView() view.getCommandSet('core').replaceInnerHTML('div.class', content) @@ -151,7 +149,7 @@ self.assertCommandsEqual(result, awaited) def afterSetUp(self): - KSSViewTestCase.afterSetUp(self) + KSSViewFunctionalTestCase.afterSetUp(self) self.setDebugRequest() @@ -160,7 +158,7 @@ suites.append(unittest.makeSuite(TestKSSViewCoreCommandSet)) suites.append(unittest.makeSuite(FTestKSSViewCoreCommandSet)) suites.append(FunctionalDocFileSuite('../actionwrapper.py', - test_class=KSSViewTestCase, + test_class=KSSViewFunctionalTestCase, setUp=afterSetUp, - tearDown=KSSViewTestCase.beforeTearDown.im_func)) + tearDown=KSSViewFunctionalTestCase.beforeTearDown.im_func)) return unittest.TestSuite(suites) Modified: kukit/kss.core/trunk/kss/core/tests/test_kssview_functional.py ============================================================================== --- kukit/kss.core/trunk/kss/core/tests/test_kssview_functional.py (original) +++ kukit/kss.core/trunk/kss/core/tests/test_kssview_functional.py Sat Jun 12 11:22:09 2010 @@ -16,9 +16,14 @@ import unittest import Products.Five -from Products.Five import zcml from Testing.ZopeTestCase import FunctionalDocTestSuite +# BBB Zope 2.12 +try: + from Zope2.App import zcml +except Exception, e: + from Products.Five import zcml + from zope import event, component from zope.testing.cleanup import cleanUp from zope.lifecycleevent import ObjectModifiedEvent @@ -68,8 +73,13 @@ being traversed to. Also, let's make sure that if in the course of this view, an object event is fired, the view will dispatch to KSS-specific subscribers: - - >>> from Products.Five.testbrowser import Browser + + # BBB Zope 2.12 + >>> try: + ... from Testing.testbrowser import Browser + ... except ImportError: + ... from Products.Five.testbrowser import Browser + >>> browser = Browser('http://localhost:8080/testkssview') >>> print browser.contents I'm the current site. Modified: kukit/kss.core/trunk/kss/core/tests/test_siteview.py ============================================================================== --- kukit/kss.core/trunk/kss/core/tests/test_siteview.py (original) +++ kukit/kss.core/trunk/kss/core/tests/test_siteview.py Sat Jun 12 11:22:09 2010 @@ -1,8 +1,14 @@ +import doctest import unittest import zope.component.event # import does the trick -from zope.testing import doctest from zope.testing.cleanup import cleanUp -from zope.app.component.hooks import setHooks + +# BBB Zope 2.11 +try: + from zope.site.hooks import setHooks +except ImportError: + from zope.app.component.hooks import setHooks + def setUp(test=None): setHooks() Modified: kukit/kss.core/trunk/kss/core/tests/test_ttwapi.py ============================================================================== --- kukit/kss.core/trunk/kss/core/tests/test_ttwapi.py (original) +++ kukit/kss.core/trunk/kss/core/tests/test_ttwapi.py Sat Jun 12 11:22:09 2010 @@ -7,15 +7,26 @@ allow_module('kss.core.tests.help_ttwapi') import Products.Five.component -from Products.Five import zcml + +# BBB Zope 2.12 +try: + from Zope2.App import zcml +except ImportError: + from Products.Five import zcml from zope import component from zope.lifecycleevent import ObjectModifiedEvent -from zope.app.component.hooks import setHooks + +# BBB Zope 2.12 +try: + from zope.site.hooks import setHooks +except ImportError: + from zope.app.component.hooks import setHooks from kss.core import KSSView from kss.core.tests.base import KSSViewTestCase + class TTWTestCase(KSSViewTestCase): class layer(KSSViewTestCase.layer): From hannosch at codespeak.net Sat Jun 12 11:31:55 2010 From: hannosch at codespeak.net (hannosch at codespeak.net) Date: Sat, 12 Jun 2010 11:31:55 +0200 (CEST) Subject: [KSS-checkins] r75314 - in kukit/kss.core/trunk/kss/core: . tests Message-ID: <20100612093155.2B619282BEC@codespeak.net> Author: hannosch Date: Sat Jun 12 11:31:53 2010 New Revision: 75314 Modified: kukit/kss.core/trunk/kss/core/siteview.txt kukit/kss.core/trunk/kss/core/tests/test_kssview.py kukit/kss.core/trunk/kss/core/tests/test_kssview_functional.py kukit/kss.core/trunk/kss/core/ttwapi.py Log: Some more BBB handling Modified: kukit/kss.core/trunk/kss/core/siteview.txt ============================================================================== --- kukit/kss.core/trunk/kss/core/siteview.txt (original) +++ kukit/kss.core/trunk/kss/core/siteview.txt Sat Jun 12 11:31:53 2010 @@ -51,7 +51,12 @@ Now we make the view the current site. We'll see that its site manager has become the current component registry: - >>> from zope.app.component.hooks import setSite + # BBB Zope 2.12 + >>> try: + ... from zope.site.hooks import setSite + ... except ImportError: + ... from zope.app.component.hooks import setSite + >>> setSite(view) >>> old_sitemanager is component.getSiteManager() Modified: kukit/kss.core/trunk/kss/core/tests/test_kssview.py ============================================================================== --- kukit/kss.core/trunk/kss/core/tests/test_kssview.py (original) +++ kukit/kss.core/trunk/kss/core/tests/test_kssview.py Sat Jun 12 11:31:53 2010 @@ -31,7 +31,13 @@ import zope.component.event from zope.testing import cleanup from zope.publisher.interfaces.browser import IBrowserRequest -from zope.app.component.hooks import setHooks + +# BBB Zope 2.12 +try: + from zope.site.hooks import setHooks +except ImportError: + from zope.app.component.hooks import setHooks + def setUpAjaxView(test=None): setHooks() Modified: kukit/kss.core/trunk/kss/core/tests/test_kssview_functional.py ============================================================================== --- kukit/kss.core/trunk/kss/core/tests/test_kssview_functional.py (original) +++ kukit/kss.core/trunk/kss/core/tests/test_kssview_functional.py Sat Jun 12 11:31:53 2010 @@ -27,7 +27,12 @@ from zope import event, component from zope.testing.cleanup import cleanUp from zope.lifecycleevent import ObjectModifiedEvent -from zope.app.component.hooks import getSite, setHooks + +# BBB Zope 2.12 +try: + from zope.site.hooks import getSite, setHooks +except ImportError: + from zope.app.component.hooks import getSite, setHooks from kss.core import KSSView Modified: kukit/kss.core/trunk/kss/core/ttwapi.py ============================================================================== --- kukit/kss.core/trunk/kss/core/ttwapi.py (original) +++ kukit/kss.core/trunk/kss/core/ttwapi.py Sat Jun 12 11:31:53 2010 @@ -1,7 +1,12 @@ -from zope.app.component.hooks import getSite, setSite from zope import event from zope.app.publication.zopepublication import BeforeTraverseEvent +# BBB Zope 2.12 +try: + from zope.site.hooks import getSite, setSite +except ImportError: + from zope.app.component.hooks import getSite, setSite + from kss.core import KSSView from kss.core.interfaces import IKSSView from kss.core.unicode_quirks import force_unicode From hannosch at codespeak.net Sat Jun 12 11:33:49 2010 From: hannosch at codespeak.net (hannosch at codespeak.net) Date: Sat, 12 Jun 2010 11:33:49 +0200 (CEST) Subject: [KSS-checkins] r75315 - kukit/kss.core/trunk/kss/core/tests Message-ID: <20100612093349.934AE282BEC@codespeak.net> Author: hannosch Date: Sat Jun 12 11:33:48 2010 New Revision: 75315 Modified: kukit/kss.core/trunk/kss/core/tests/test_kssview_functional.py Log: Less general except Modified: kukit/kss.core/trunk/kss/core/tests/test_kssview_functional.py ============================================================================== --- kukit/kss.core/trunk/kss/core/tests/test_kssview_functional.py (original) +++ kukit/kss.core/trunk/kss/core/tests/test_kssview_functional.py Sat Jun 12 11:33:48 2010 @@ -21,7 +21,7 @@ # BBB Zope 2.12 try: from Zope2.App import zcml -except Exception, e: +except ImportError: from Products.Five import zcml from zope import event, component From hannosch at codespeak.net Sat Jun 12 11:53:04 2010 From: hannosch at codespeak.net (hannosch at codespeak.net) Date: Sat, 12 Jun 2010 11:53:04 +0200 (CEST) Subject: [KSS-checkins] r75317 - kukit/kss.concatresource/trunk/kss/concatresource Message-ID: <20100612095304.A29F0282BEC@codespeak.net> Author: hannosch Date: Sat Jun 12 11:53:02 2010 New Revision: 75317 Modified: kukit/kss.concatresource/trunk/kss/concatresource/cachingadapter.py kukit/kss.concatresource/trunk/kss/concatresource/fileresource.py kukit/kss.concatresource/trunk/kss/concatresource/meta.py kukit/kss.concatresource/trunk/kss/concatresource/resource.py Log: Simplify some really old BBB code Modified: kukit/kss.concatresource/trunk/kss/concatresource/cachingadapter.py ============================================================================== --- kukit/kss.concatresource/trunk/kss/concatresource/cachingadapter.py (original) +++ kukit/kss.concatresource/trunk/kss/concatresource/cachingadapter.py Sat Jun 12 11:53:02 2010 @@ -1,12 +1,7 @@ from time import time from interfaces import ICachedResource from zope.interface import implements - -try: - from zope.datetime import rfc1123_date -except ImportError: - # Zope < 2.10 - from zope.app.datetimeutils import rfc1123_date +from zope.datetime import rfc1123_date class CachedResource(object): Modified: kukit/kss.concatresource/trunk/kss/concatresource/fileresource.py ============================================================================== --- kukit/kss.concatresource/trunk/kss/concatresource/fileresource.py (original) +++ kukit/kss.concatresource/trunk/kss/concatresource/fileresource.py Sat Jun 12 11:53:02 2010 @@ -6,14 +6,7 @@ ''' from zope.interface import implements -try: - from zope.contenttype import guess_content_type -except ImportError: # BBB: Zope < 2.10 - try: - # XXX ??? What zope version needs this? - from zope.app.contenttypes import guess_content_type - except ImportError: - from zope.app.content_types import guess_content_type +from zope.contenttype import guess_content_type import os from interfaces import IContextFile Modified: kukit/kss.concatresource/trunk/kss/concatresource/meta.py ============================================================================== --- kukit/kss.concatresource/trunk/kss/concatresource/meta.py (original) +++ kukit/kss.concatresource/trunk/kss/concatresource/meta.py Sat Jun 12 11:53:02 2010 @@ -1,6 +1,7 @@ from zope.security.checker import CheckerPublic, NamesChecker from zope.configuration.exceptions import ConfigurationError from zope.publisher.interfaces.browser import IBrowserRequest +from zope.publisher.interfaces.browser import IDefaultBrowserLayer from zope.interface import Interface from resource import ConcatResourceFactory @@ -15,20 +16,16 @@ from App.class_init import InitializeClass except ImportError: from Globals import InitializeClass - from Products.Five.metaclass import makeClass - from Products.Five.security import protectClass -try: - from zope.publisher.interfaces.browser import IDefaultBrowserLayer - _layer = IDefaultBrowserLayer - __pre_3_2__ = False -except ImportError: - from zope.app.servicenames import Presentation - _layer = 'default' - __pre_3_2__ = True + # BBB Zope 2.12 + try: + from AccessControl.security import protectClass + except ImportError: + from Products.Five.security import protectClass + + from Products.Five.metaclass import makeClass try: - from zope.component import zcml from zope.component.zcml import handler __pre_3_3__ = False except: @@ -50,7 +47,7 @@ def concatresource(_context, name, files=None, compress_level='safe', caching='default', lmt_check_period=60.0, - layer=_layer, permission='zope.Public'): + layer=IDefaultBrowserLayer, permission='zope.Public'): if not files: raise ConfigurationError( @@ -92,25 +89,17 @@ factory = res_factory(res, name, compress_level, caching, lmt_check_period, resource_factory=new_class, checker=checker) - if __pre_3_2__: + if __pre_3_3__: _context.action( discriminator = ('resource', name, IBrowserRequest, layer), callable = handler, - args = (Presentation, 'provideResource', - name, IBrowserRequest, factory, layer), + args = ('provideAdapter', + (layer,), Interface, name, factory, _context.info), ) else: - if __pre_3_3__: - _context.action( - discriminator = ('resource', name, IBrowserRequest, layer), - callable = handler, - args = ('provideAdapter', - (layer,), Interface, name, factory, _context.info), - ) - else: - _context.action( - discriminator = ('resource', name, IBrowserRequest, layer), - callable = handler, - args = ('registerAdapter', - factory, (layer,), Interface, name, _context.info), - ) + _context.action( + discriminator = ('resource', name, IBrowserRequest, layer), + callable = handler, + args = ('registerAdapter', + factory, (layer,), Interface, name, _context.info), + ) Modified: kukit/kss.concatresource/trunk/kss/concatresource/resource.py ============================================================================== --- kukit/kss.concatresource/trunk/kss/concatresource/resource.py (original) +++ kukit/kss.concatresource/trunk/kss/concatresource/resource.py Sat Jun 12 11:53:02 2010 @@ -4,32 +4,19 @@ from interfaces import ICachedResource import cachingadapter # force adapter registration -try: - from zope.publisher.browser import BrowserView - from zope.datetime import time as timeFromDateTimeString -except ImportError: - # Zope < 2.10 - from zope.app.publisher.browser import BrowserView - from zope.app.datetimeutils import time as timeFromDateTimeString +from zope.publisher.browser import BrowserView +from zope.datetime import time as timeFromDateTimeString +__five__ = True try: - import Products.Five + from Products.Five.browser.resource import Resource except ImportError: __five__ = False from zope.app.publisher.browser.resource import Resource else: - __five__ = True - try: - # Zope 2.8 / Five 1.0.2 - from Products.Five.resource import Resource - __five_pre_1_3_ = True - except ImportError: - # Zope 2.9 / Five 1.3 - from Products.Five.browser.resource import Resource - __five_pre_1_3__ = False - from zope.app.publisher.interfaces import IResource - + + class GenericResource(BrowserView, Resource): """A publishable resource""" From kukit-checkins at codespeak.net Thu Jun 17 14:51:48 2010 From: kukit-checkins at codespeak.net (kukit-checkins at codespeak.net) Date: Thu, 17 Jun 2010 14:51:48 +0200 (CEST) Subject: kukit-checkins VIAGRA ® Official Site -46% Message-ID: <20100617125148.999A636C230@codespeak.net> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20100617/4a1c0de0/attachment.htm