From gotcha at codespeak.net Sat Mar 1 08:34:57 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 1 Mar 2008 08:34:57 +0100 (CET) Subject: [KSS-checkins] r51970 - kukit/kss.zope/trunk/kss/zope Message-ID: <20080301073457.32DE4168452@codespeak.net> Author: gotcha Date: Sat Mar 1 08:34:54 2008 New Revision: 51970 Modified: kukit/kss.zope/trunk/kss/zope/meta.zcml Log: add missing i18n domain Modified: kukit/kss.zope/trunk/kss/zope/meta.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/zope/meta.zcml (original) +++ kukit/kss.zope/trunk/kss/zope/meta.zcml Sat Mar 1 08:34:54 2008 @@ -1,4 +1,5 @@ From gotcha at codespeak.net Sat Mar 1 08:35:48 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 1 Mar 2008 08:35:48 +0100 (CET) Subject: [KSS-checkins] r51971 - kukit/kss.zope/trunk/kss/zope/tests Message-ID: <20080301073548.577C21684D7@codespeak.net> Author: gotcha Date: Sat Mar 1 08:35:47 2008 New Revision: 51971 Modified: kukit/kss.zope/trunk/kss/zope/tests/test_actionwrapper.py Log: avoid warning about functionaltestcase Modified: kukit/kss.zope/trunk/kss/zope/tests/test_actionwrapper.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/tests/test_actionwrapper.py (original) +++ kukit/kss.zope/trunk/kss/zope/tests/test_actionwrapper.py Sat Mar 1 08:35:47 2008 @@ -17,15 +17,13 @@ # 02111-1307, USA. from Testing.ZopeTestCase import FunctionalDocFileSuite -##from kss.zope.tests.base import KSSViewFunctionalTestCase -from kss.zope.tests.base import KSSViewTestCase +from kss.zope.tests.base import KSSViewFunctionalTestCase import unittest, doctest def test_suite(): suites = [] suites.append(FunctionalDocFileSuite('../actionwrapper.py', optionflags=doctest.ELLIPSIS, -# test_class=KSSViewFunctionalTestCase, - test_class=KSSViewTestCase, + test_class=KSSViewFunctionalTestCase, )) return unittest.TestSuite(suites) From gotcha at codespeak.net Sat Mar 1 08:36:45 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 1 Mar 2008 08:36:45 +0100 (CET) Subject: [KSS-checkins] r51972 - kukit/kss.zope/trunk/kss/zope/tests Message-ID: <20080301073645.F1B2C1684D7@codespeak.net> Author: gotcha Date: Sat Mar 1 08:36:45 2008 New Revision: 51972 Modified: kukit/kss.zope/trunk/kss/zope/tests/test_kssview_core.py Log: * change protocol version * remove unneeded code Modified: kukit/kss.zope/trunk/kss/zope/tests/test_kssview_core.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/tests/test_kssview_core.py (original) +++ kukit/kss.zope/trunk/kss/zope/tests/test_kssview_core.py Sat Mar 1 08:36:45 2008 @@ -27,7 +27,6 @@ from kss.zope.interfaces import IKSSPluginRegistry from kss.zope.registry import GlobalPluginRegistry from kss.zope.view import KSSView -from kss.core import KSSUnicodeError class KSSTestCase(unittest.TestCase): def setUp(self): @@ -113,7 +112,7 @@ def _wrapped_commands(self, inline): header = textwrap.dedent(u'''\ - + ''') footer = '' return header + inline + footer @@ -145,11 +144,6 @@ awaited = u'''''' self.assertCommandsEqual(result, awaited) -def afterSetUp(self): - KSSViewTestCase.afterSetUp(self) - self.setDebugRequest() - - def test_suite(): suites = [] suites.append(unittest.makeSuite(TestKSSViewCoreCommandSet)) From gotcha at codespeak.net Sat Mar 1 08:37:26 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 1 Mar 2008 08:37:26 +0100 (CET) Subject: [KSS-checkins] r51973 - kukit/kss.zope/trunk/kss/zope Message-ID: <20080301073726.35AEA1684D7@codespeak.net> Author: gotcha Date: Sat Mar 1 08:37:25 2008 New Revision: 51973 Modified: kukit/kss.zope/trunk/kss/zope/actionwrapper.py Log: change protocol version Modified: kukit/kss.zope/trunk/kss/zope/actionwrapper.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/actionwrapper.py (original) +++ kukit/kss.zope/trunk/kss/zope/actionwrapper.py Sat Mar 1 08:37:25 2008 @@ -185,7 +185,7 @@ >>> hasattr(v, 'error') True >>> v(1, b=2) - '\n\nThe error' + '\n\nThe error' In addition, to be publishable, the docstring must exist. Let's see if the wrapper actually does this. If the method had a docstring, From gotcha at codespeak.net Sat Mar 1 08:48:51 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 1 Mar 2008 08:48:51 +0100 (CET) Subject: [KSS-checkins] r51974 - kukit/kss.base/trunk/src/kss/base Message-ID: <20080301074851.58AE11684E9@codespeak.net> Author: gotcha Date: Sat Mar 1 08:48:49 2008 New Revision: 51974 Modified: kukit/kss.base/trunk/src/kss/base/tests.py Log: fix test runner Modified: kukit/kss.base/trunk/src/kss/base/tests.py ============================================================================== --- kukit/kss.base/trunk/src/kss/base/tests.py (original) +++ kukit/kss.base/trunk/src/kss/base/tests.py Sat Mar 1 08:48:49 2008 @@ -4,7 +4,7 @@ def test_suite(): suite = unittest.TestSuite(( doctest.DocFileSuite( - 'README.txt', 'selectors.txt', + 'selectors.txt', 'registry.txt', 'plugin.txt', 'commands.txt', 'corecommands.txt', 'javascript.txt', From gotcha at codespeak.net Sat Mar 1 09:06:19 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 1 Mar 2008 09:06:19 +0100 (CET) Subject: [KSS-checkins] r51975 - kukit/kss.base/trunk/src/kss/base Message-ID: <20080301080619.7AC86168501@codespeak.net> Author: gotcha Date: Sat Mar 1 09:06:17 2008 New Revision: 51975 Modified: kukit/kss.base/trunk/src/kss/base/selectors.txt Log: Some hopefully better wording Modified: kukit/kss.base/trunk/src/kss/base/selectors.txt ============================================================================== --- kukit/kss.base/trunk/src/kss/base/selectors.txt (original) +++ kukit/kss.base/trunk/src/kss/base/selectors.txt Sat Mar 1 09:06:17 2008 @@ -1,10 +1,11 @@ Selectors ========= -The selector is responsible for finding the nodes on which to operate. -Selectors are executed on the client. Most of them has a single parameter. +In the client, the selectors are used to find the DOM nodes on which to operate. +The selectors need to be serialized from the server to the client. A base class is provided for all selectors. +Most of them have a single parameter. >>> from kss.base.selectors import Selector @@ -32,7 +33,7 @@ >>> htmlid.type 'htmlid' -They both need a value to operate on. +Both constructors demand a value. >>> selector = css('div.main a') >>> selector.type @@ -46,9 +47,11 @@ >>> selector.value 'someid' -There are also two somewhat different selectors. The first is special -in that it selects the same node that was used to call the server -action. Also note that it does not accept any arguments. +There are also two somewhat different selectors. + +The first is special in that it selects the same node +that was used to call the server action. +Note that its constructor does not accept any arguments. >>> from kss.base.selectors import samenode >>> samenode.type @@ -59,7 +62,7 @@ >>> selector.value '' -Another core selector is parentnode. This one can be used to use a CSS +The second selector is `parentnode`. It uses a CSS query which only operates on nodes that are the parent (or grandparents). @@ -76,8 +79,9 @@ ------------------------------- Suppose a plugin registers a new selector. It must overwrite type, and -__init__. The type of the selector should always be in namespace-name -notation. Only the core selectors can do without a namespace. +__init__. The type of the selector should always be specified as +`namespace-name`. +Only the core selectors can do without a namespace. >>> from kss.base.selectors import Selector >>> class MyFunkySelector(Selector): @@ -85,8 +89,8 @@ ... def __init__(self, value): ... self.value = value -We will use this class to create selector instances. In real -life, the plugin would register this class now with the plugin +We will use this class to create selector instances. In actual +code, the plugin would register this class with the plugin registry, and the commandset code would look up the class from the registry. However, we test the registration somewhere else, and just use the class as it is for now: @@ -103,7 +107,7 @@ >>> selector.value 'Selector value' -Currently only the "value" property will be marshalled to the +Currently, only the `value` property will be marshalled to the client. Selectors must therefore have their parameter stored as `value`. @@ -118,3 +122,4 @@ >>> print css('div.content') css('div.content') + From gotcha at codespeak.net Sat Mar 1 09:11:38 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 1 Mar 2008 09:11:38 +0100 (CET) Subject: [KSS-checkins] r51976 - kukit/kss.base/trunk/src/kss/base Message-ID: <20080301081138.1117B168505@codespeak.net> Author: gotcha Date: Sat Mar 1 09:11:37 2008 New Revision: 51976 Modified: kukit/kss.base/trunk/src/kss/base/registry.txt Log: Some hopefully better wording Modified: kukit/kss.base/trunk/src/kss/base/registry.txt ============================================================================== --- kukit/kss.base/trunk/src/kss/base/registry.txt (original) +++ kukit/kss.base/trunk/src/kss/base/registry.txt Sat Mar 1 09:11:37 2008 @@ -2,22 +2,22 @@ KSS Registries ============== -KSS can be extendend in a few different ways. To make these things -work we have a few different registries. +KSS can be extended in a few different ways. To make these things +work we have registries. -The registries are all instances of a simple base class. Using these +The registries are all instances of a simple base class. Using them is pretty simple. >>> from kss.base.registry import Registry -We will now demonstrate the working of this registry with an sample -command set. +We demonstrate the interactions with this registry by defining +a sample command set. >>> command_set_registry = Registry() -First we will create a simple factory function for our command -set. Note that any callable object will do. For more information on -command sets look at the documentation in kss.commands. +First we create a simple factory function for our command +set. Note that any callable object will do. (For more information on +command sets, look at the documentation in kss.commands.) >>> def test_command_set_factory(commands): ... pass @@ -27,45 +27,43 @@ >>> command_set_registry.register('test', test_command_set_factory) The name is used as a unique identifier to lookup the command set factory. -When you try to register a factory under the same name you will get an error. +If you try to register a factory under the same name, you get an error. >>> command_set_registry.register('test', test_command_set_factory) Traceback (most recent call last): ... KeyError: ... -This avoids any accidental overrides. If you want to override a command you -can unregister it first. +This avoids accidental overrides. If you want to override a command you +need to unregister it first. >>> command_set_registry.unregister('test') -Unregistering the same thing twice will throw a KeyError. +Unregistering the same thing twice throws a KeyError. >>> command_set_registry.unregister('test') Traceback (most recent call last): ... KeyError: ... -This is because we cannot unregister what is not there. - -Now that the registry is clean we can safely register our command set again. +Now that the registry is clean, we can safely register our command set again. >>> command_set_registry.register('test', test_command_set_factory) -To use a command set we will need to get it from the registry. Let us load the +To use a command set, we need to look it up from the registry. Let us load the previously defined `test` set. >>> command_set_registry.get('test') is test_command_set_factory True -Trying to load a command set which is not defined will result in a key error. +Trying to load a command set which is not defined results in a key error. >>> command_set_registry.get('does-not-exist') Traceback (most recent call last): ... KeyError: ... -Registries can list theirs registered items. +Registries can list the registered items. >>> list(command_set_registry.items()) [('test', )] From gotcha at codespeak.net Sat Mar 1 10:57:26 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 1 Mar 2008 10:57:26 +0100 (CET) Subject: [KSS-checkins] r51977 - in kukit/kss.base/trunk: docs src/kss/base Message-ID: <20080301095726.61465168405@codespeak.net> Author: gotcha Date: Sat Mar 1 10:57:19 2008 New Revision: 51977 Added: kukit/kss.base/trunk/docs/HISTORY.txt Modified: kukit/kss.base/trunk/src/kss/base/__init__.py kukit/kss.base/trunk/src/kss/base/javascript.py kukit/kss.base/trunk/src/kss/base/javascript.txt kukit/kss.base/trunk/src/kss/base/plugin.py kukit/kss.base/trunk/src/kss/base/plugin.txt Log: - renamed `load_plugins`, `unload_plugins`, and `activated_plugins` to respectively `activate`, `deactivate`, and `active_plugins` - hopefully better wording for plugin.txt Added: kukit/kss.base/trunk/docs/HISTORY.txt ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/docs/HISTORY.txt Sat Mar 1 10:57:19 2008 @@ -0,0 +1,11 @@ +Changelog for kss.base + + (name of developer listed in brackets) + +kss.base - 0.4dev Unreleased + + - renamed `load_plugins`, `unload_plugins`, and `activated_plugins` + to respectively `activate`, `deactivate`, and `active_plugins` + [gotcha] + +kss.base - 0.3 Released 2008-02-12 Modified: kukit/kss.base/trunk/src/kss/base/__init__.py ============================================================================== --- kukit/kss.base/trunk/src/kss/base/__init__.py (original) +++ kukit/kss.base/trunk/src/kss/base/__init__.py Sat Mar 1 10:57:19 2008 @@ -1,4 +1,4 @@ from kss.base.commands import KSSCommands from kss.base.selectors import selectors -from kss.base.plugin import load_plugins +from kss.base.plugin import activate from kss.base.commands import xmldata, htmldata, cdatadata Modified: kukit/kss.base/trunk/src/kss/base/javascript.py ============================================================================== --- kukit/kss.base/trunk/src/kss/base/javascript.py (original) +++ kukit/kss.base/trunk/src/kss/base/javascript.py Sat Mar 1 10:57:19 2008 @@ -1,13 +1,13 @@ import os -from kss.base.plugin import activated_plugins +from kss.base.plugin import active_plugins from kss.base.compression.javascript import compress def concatenated(include_extras=False): '''Concatinate the Javascript files for all activate plugins''' scripts = [] - for id, plugin in sorted(activated_plugins(), + for id, plugin in sorted(active_plugins(), key=lambda item: item[1].priority): if include_extras: javascripts = plugin.javascripts + plugin.extra_javascripts @@ -24,11 +24,11 @@ return compress(concatenated(include_extras), compression_level) def extra_scripts(): - '''Return a dictionary of the extra javascripts for all activated + '''Return a dictionary of the extra javascripts for all active plugins''' scripts = {} - for id, plugin in activated_plugins(): + for id, plugin in active_plugins(): for filename in plugin.extra_javascripts: f = open(filename, 'r') scripts[os.path.basename(filename)] = f.read() Modified: kukit/kss.base/trunk/src/kss/base/javascript.txt ============================================================================== --- kukit/kss.base/trunk/src/kss/base/javascript.txt (original) +++ kukit/kss.base/trunk/src/kss/base/javascript.txt Sat Mar 1 10:57:19 2008 @@ -22,8 +22,8 @@ Now if we run the code again after we activate a plugin we get something more interesting. - >>> from kss.base import load_plugins - >>> load_plugins('kss-core') + >>> from kss.base import activate + >>> activate('kss-core') >>> concatenated() '/*\n* Copyright (c) 2005-2007\n* Authors: KSS Project Contributors...' @@ -42,8 +42,8 @@ Finally we will unregister the core plugin to clean up. - >>> from kss.base.plugin import unload_plugins - >>> unload_plugins('kss-core') + >>> from kss.base.plugin import deactivate + >>> deactivate('kss-core') Packed @@ -63,7 +63,7 @@ So now we activate a plugin. - >>> load_plugins('kss-core') + >>> activate('kss-core') By default the packed function does no packing. @@ -84,8 +84,8 @@ We will again unregister the core plugin to clean up. - >>> from kss.base.plugin import unload_plugins - >>> unload_plugins('kss-core') + >>> from kss.base.plugin import deactivate + >>> deactivate('kss-core') Extra scripts @@ -104,7 +104,7 @@ If we activate a plugin we get something more interesting. - >>> load_plugins('kss-core') + >>> activate('kss-core') >>> extra_scripts() {...'base2...js': ...} @@ -113,5 +113,5 @@ Now we can cleanup the registry again. - >>> from kss.base.plugin import unload_plugins - >>> unload_plugins('kss-core') + >>> from kss.base.plugin import deactivate + >>> deactivate('kss-core') Modified: kukit/kss.base/trunk/src/kss/base/plugin.py ============================================================================== --- kukit/kss.base/trunk/src/kss/base/plugin.py (original) +++ kukit/kss.base/trunk/src/kss/base/plugin.py Sat Mar 1 10:57:19 2008 @@ -24,11 +24,7 @@ def _selectors(self): for name, selectors in self.selectors.iteritems(): for selector in selectors: - if name is None: - selector_id = selector.__name__ - else: - selector_id = name + '-' + selector.__name__ - yield selector_id, selector + yield selector.type, selector def register_selectors(self): for id, selector in self._selectors(): @@ -67,7 +63,7 @@ return sorted(plugins, key=lambda item: item[1].priority) -def load_plugins(*names): +def activate(*names): def load(name): for entry_point in iter_entry_points('kss.plugin', name): plugin_factory = entry_point.load() @@ -83,7 +79,7 @@ for name in names: load(name) -def unload_plugins(*names): +def deactivate(*names): for name in names: for entry_point in iter_entry_points('kss.plugin', name): plugin_factory = entry_point.load() @@ -96,6 +92,6 @@ plugin_registry.unregister(name) -def activated_plugins(): +def active_plugins(): return plugin_registry.items() Modified: kukit/kss.base/trunk/src/kss/base/plugin.txt ============================================================================== --- kukit/kss.base/trunk/src/kss/base/plugin.txt (original) +++ kukit/kss.base/trunk/src/kss/base/plugin.txt Sat Mar 1 10:57:19 2008 @@ -2,33 +2,34 @@ Plugins ======= -KSS is a framework which is meant to be extended. An extension is a +KSS is a framework which is meant to be extended. A plugin is a simple Python package with some setuptools glue. -Before any plugin can be used it must be activated. There is a -function for this which will be shown later. We will now just query -all activated plugins and show that it is empty. +Before any plugin can be used, it must be active. There is a +function to activate plugins that we will show later. - >>> from kss.base.plugin import activated_plugins - >>> tuple(activated_plugins()) +At startup, when we query for active plugins, we get an empty tuple. + + >>> from kss.base.plugin import active_plugins + >>> tuple(active_plugins()) () -We will now create a sample registration. A registration consists of a -class like you can see below. +We create a sample registration. A registration consists of a +class as you can see below. -The first thing we need to do is import the `Plugin` base class. This -contains a few methods used in registration. +The first thing we need to do is to import the `Plugin` base class. It +holds a few items used by the registration. >>> from kss.base.plugin import Plugin, file_below_module -Now we can create our class. We will reuse the core commands in this -example. +Now, we can create our class. (We reuse the core commands in this +example.) >>> import kss.base >>> from kss.base.corecommands import KSSCoreCommands >>> from kss.base.selectors import Selector - >>> class silly(Selector): + >>> class Silly(Selector): ... type = 'example-silly' ... def __init__(self, value): ... self.value = value @@ -41,28 +42,28 @@ ... commandsets = { ... 'example': KSSCoreCommands, ... } - ... selectors = {'example': [silly]} + ... selectors = {'example': [Silly]} + +The registration has a few items. -As you can see from the lines above the registration has a few things -in it. The first thing is registering the Javascripts. All items in -the list to the `javascripts` variable should be full paths to your -plugins Javascript. This should not list any third party Javascript -files. For this you can use `extra_javascripts`. +The first item is the list of the names of the Javascripts files that makes +the client-side plugin. All names should be full paths. -The `commandset` var is a dictionary containing the mapping with -identifiers and the command set factory. When using KSS you would -normally use this identifier for the lookup of command sets. +This list should not include any third party Javascript files. +Those are declared in `extra_javascripts`. -If we try the activate our plugin now it will not work. +The `commandset` var is a dictionary that containins the mapping between +command set factories and their identifiers. +Those identifiers are used to look the command sets up. - >>> kss.base.load_plugins('kss-testing') +Before being able to activate our plugin, we need to hook its registration with +`setuptools`. + + >>> kss.base.activate('kss-testing') Traceback (most recent call last): ... KeyError: 'Plugin is not registered: kss-testing' -Now that we have our registration it is time to hook it up with the -setuptools registry. - >>> import pkg_resources >>> class FakeEntryPoint(pkg_resources.EntryPoint): @@ -78,17 +79,14 @@ >>> distribution._ep_map = {'kss.plugin': {'kss-testing': entry_point}} >>> pkg_resources.working_set.add(distribution) + +Let us activate our plugin. -After this we can load our newly created plugin. + >>> kss.base.activate('kss-testing') - >>> kss.base.load_plugins('kss-testing') - -Now that we have activated our plugin it should show up as activated. - - >>> tuple(activated_plugins()) + >>> tuple(active_plugins()) (('kss-testing', ),) - The additional selector we registered is now available in the selector registry. It can be looked up based on the class name with the key from the registrion as the namespace. @@ -97,38 +95,37 @@ >>> print selectors['example-silly']('testing') example-silly('testing') -Finally we will unregister our plugin to clean up. +Finally we deactivate our plugin to clean up. - >>> from kss.base.plugin import unload_plugins - >>> unload_plugins('kss-testing') + >>> from kss.base.plugin import deactivate + >>> deactivate('kss-testing') ----------------- Utility functions ----------------- -When you write a plugin you will need to do a few things. For some of -these things there are helper functions available. +When you write a plugin, you need to do a few things. We have defined +helper functions. Getting full path names for Javascripts --------------------------------------- -One of the helpers which is usefull mostly for extra Javascripts is -`javascripts_from`. This function whill recursively generate an -iterator of all javascripts from a certain path. +`javascripts_from` is usefull mainly for extra Javascripts. +This function generates a recursive iterator of all javascripts +starting from a given path. >>> from kss.base.plugin import javascripts_from, module_path >>> scripts = javascripts_from(module_path(kss.base)) -To test the output we will first sort the scripts (otherwise the test +To test the output, we need to sort the scripts (otherwise the test may fail on different systems). Keep this in mind when creating your -own plugins. If you need a consistent order either sort the output or -use a different way of creating the list of scripts. +own plugins. If you need a consistent order, either sort the output or +use a different way of computing the list of scripts. >>> list(sorted(scripts)) [.../kukit/kukit/dom.js', ..., .../kukit/kukit/serveraction.js', ...] -When we try to load from something which is not a directory we will -get an error. +If we try to load from an identifier which is not a directory, we get an error. >>> import os >>> javascripts_from(os.path.join(module_path(kss.base), @@ -148,13 +145,13 @@ >>> from kss.base.plugin import available_plugins Because we ship with the core plugin it should show up when we call -it. Also the example plugin we make will show here. +it. The example plugin we have made also shows up here. >>> list(available_plugins()) [('kss-core', >> ExamplePlugin.priority = -99999 >>> list(available_plugins()) From jvloothuis at codespeak.net Sat Mar 1 11:35:25 2008 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 1 Mar 2008 11:35:25 +0100 (CET) Subject: [KSS-checkins] r51979 - kukit/kss.base/trunk/src/kss/base Message-ID: <20080301103525.0368D16844B@codespeak.net> Author: jvloothuis Date: Sat Mar 1 11:35:25 2008 New Revision: 51979 Added: kukit/kss.base/trunk/src/kss/base/utils.txt Modified: kukit/kss.base/trunk/src/kss/base/tests.py kukit/kss.base/trunk/src/kss/base/utils.py Log: Readded the code from r51399 which got lost for some reason:: Improved the command lined utility by making it dump all the required . Also made some of the unused options work. The script now has tests as well. Modified: kukit/kss.base/trunk/src/kss/base/tests.py ============================================================================== --- kukit/kss.base/trunk/src/kss/base/tests.py (original) +++ kukit/kss.base/trunk/src/kss/base/tests.py Sat Mar 1 11:35:25 2008 @@ -7,7 +7,7 @@ 'selectors.txt', 'registry.txt', 'plugin.txt', 'commands.txt', 'corecommands.txt', - 'javascript.txt', + 'javascript.txt', 'utils.txt', package='kss.base', optionflags=doctest.ELLIPSIS|doctest.REPORT_ONLY_FIRST_FAILURE, ), Modified: kukit/kss.base/trunk/src/kss/base/utils.py ============================================================================== --- kukit/kss.base/trunk/src/kss/base/utils.py (original) +++ kukit/kss.base/trunk/src/kss/base/utils.py Sat Mar 1 11:35:25 2008 @@ -1,160 +1,58 @@ +import os +import sys import optparse -import ConfigParser - -from paste.script.templates import Template - -from kss.base.javascript import packed -from kss.base.plugin import load_plugins, activated_plugins - - -class KSSConcatJs(object): - '''Prints out or saves a packed javascript of loaded plugins''' - - configSection = "KSSConcatJs" - - def __init__(self): - self.getOptions() - if self.options.configFile: - self.getConfig(self.options.configFile) - self.handleCreation() - - - def getOptions(self): - '''Gets the arguments passed to the script (override config)''' - parser = optparse.OptionParser() - - parser.add_option('-m', '--message', - action='store', - dest='message', - help="message (comment) that will be added to the generated javascript") - parser.add_option('--list', - action='store_true', - dest='listPlugins', - help="lists activated plugins") - parser.add_option('--compression-level', - action='store', - dest='compressionLevel', - help="specifies the compression level (devel / stripped / safe / full / safe-devel / full-devel)") - parser.add_option('--plugin', - action='append', - dest='pluginsToHandle', - help="specifies one additional plugin to load; if you want to specify multiple plugins you can do it by calling --plugin multiple times") - parser.add_option('--no-display', - action='store_true', - dest='noDisplayJavascript', - help="avoids the display of resulting javascript in console") - parser.add_option('--output-file', - action='store', - dest='outputFile', - help="outputs the resulting javascript to the specified file") - parser.add_option('--include-extras', - action='store', - dest='includeExtras', - help="specifies if 3rd party javascripts have to be packed too") - parser.add_option('-v', '--verbose', - action='store_true', - dest='verboseMode', - help="verbose mode") - parser.add_option('-F', - action='store', - dest='configFile', - help="loads options from the specified config file") - - options, args = parser.parse_args() - self.options = options - - - def getConfig(self, fileName): - '''Gets the values in config file only if not overrided by argument''' - config = ConfigParser.ConfigParser() - config.read(fileName) - listParameters = ['pluginsToHandle'] - strParameters = ['compressionLevel', \ - 'outputFile'] - boolParameters = ['listPlugins', \ - 'noDisplayJavascript', \ - 'includeExtras', \ - 'verboseMode'] - for param in strParameters: - if not hasattr(self.options, param): - try: - setattr(self.options, \ - param, \ - config.get(self.configSection, param)) - except ConfigParser.NoOptionError: - pass - for param in boolParameters: - if not hasattr(self.options, param): - try: - setattr(self.options, \ - param, \ - config.getboolean(self.configSection, param)) - except ConfigParser.NoOptionError: - pass - for param in listParameters: - #this is a list so the condition doesn't work with hasattr - if not bool(self.options.pluginsToHandle): - try: - paramList = config.get(self.configSection, param).split(' ') - setattr(self.options, \ - param, \ - paramList) - except ConfigParser.NoOptionError: - pass - - - def makeJS(self, compressionLevel=None, includeExtras=False): - '''Returns a compacted javascript generated from loaded javascripts''' - return packed(compressionLevel, include_extras=False) - - - def setComment(self, javascript, message): - '''Add a comment to the generated javascript''' - return "/* %s */\n\n%s" % (message, javascript) - - def writeToFile(self, fileName, fileContent): - '''Writes the packed javascript to file''' - file = open(fileName, 'w') - file.write(fileContent) - file.close() - - - def listPlugins(self): - '''Displays activated plugins''' - if self.options.verboseMode: - print "Activated plugins :" - for id, plugin in activated_plugins(): - print " * %s" % id - else: - for id, plugin in activated_plugins(): - print id - - - def handleCreation(self): - '''Handles the JS creation regarding options and/or config''' - corePlugin = ('kss-core', ) - if self.options.pluginsToHandle: - plugins = tuple(self.options.pluginsToHandle) + corePlugin - else: - plugins = corePlugin - self.loadedPlugins = load_plugins(*plugins) - - if self.options.listPlugins: - self.listPlugins() - - javascript = self.makeJS(self.options.compressionLevel, \ - self.options.includeExtras) - - if self.options.message: - javascript = self.setComment(javascript, self.options.message) - - if self.options.outputFile: - self.writeToFile(self.options.outputFile, javascript) - elif not self.options.noDisplayJavascript: - print javascript - - -class KSSPluginTemplate(Template): - _template_dir = 'templates/plugin' - summary = 'KSS plugin template' - egg_plugins = ['kss.base'] + +from kss.base import javascript +from kss.base.plugin import activate, active_plugins + +def ksspackage(): + parser = optparse.OptionParser() + parser.add_option('--list', + action='store_true', + dest='list_plugins', + help="lists available plugins") + parser.add_option('--compression', + action='store', + dest='compression', + default='safe', + help="specifies the compression level (devel / stripped / safe / full / safe-devel / full-devel)") + parser.add_option('--plugin', + action='append', + dest='plugins', + default=[], + help="specifies one additional plugin to load; if you want to specify multiple plugins you can do it by calling --plugin multiple times") + + + options, args = parser.parse_args() + + def make_package(): + output_dir = args[0] + if not os.path.exists(output_dir): + os.makedirs(output_dir) + + activate(*options.plugins) + + print "Creating `kss.js` script:", + f = open(os.path.join(output_dir, 'kss.js'), 'w') + f.write(javascript.packed(options.compression)) + f.close() + print "DONE" + + for name, script in javascript.extra_scripts().items(): + print "Creating `%s` script:" % name, + f = open(os.path.join(output_dir, name), 'w') + f.write(script) + f.close() + print "DONE" + + if args: + make_package() + + elif options.list_plugins: + print "Available plugins:" + for id, factory in active_plugins(): + print " %s" % id + + else: + print 'Usage: %s OUTPUTDIR [OPTIONS]' % sys.argv[0] + print 'Try `%s --help` for more information.' % sys.argv[0] Added: kukit/kss.base/trunk/src/kss/base/utils.txt ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/src/kss/base/utils.txt Sat Mar 1 11:35:25 2008 @@ -0,0 +1,75 @@ +========= +Utilities +========= + +KSS ships with various utilties. When you install `kss.base` these get +installed as executables. + + +Create a standalone package +=========================== + +Since the whole KSS framework is pluggable the amount of Javascript +that ends up being used depends a lot on the plugins. To make it easy +to create static files from a know plugin configuration we have the +`ksspackage`. This creates a directory with all the Javascripts needed +to run the set of plugins. + + >>> from pkg_resources import load_entry_point + >>> ksspackage = load_entry_point( + ... 'kss.base', 'console_scripts', 'ksspackage') + +We will first setup a temp directory to contain our stuff. + + >>> import os + >>> from tempfile import mktemp + >>> temp = mktemp() + >>> static_dump = os.path.join(temp, 'static-dump') + +Executing the script without any arguments will raise an error. + + >>> import sys + >>> old_argv = sys.argv + >>> sys.argv = ['ksspackage'] + + >>> ksspackage() + Usage: ksspackage OUTPUTDIR [OPTIONS] + Try `ksspackage --help` for more information. + +It needs at least one argument, the path for the output. + + >>> sys.argv = ['ksspackage', static_dump] + >>> ksspackage() + Creating `kss.js` script: DONE + +If we look into the export we will see only the `kss.js` file. + + >>> os.listdir(static_dump) + ['kss.js'] + +In this case it is empty since we did not give it any plugins to +extract the Javascript from. + + >>> open(os.path.join(static_dump, 'kss.js')).read() + '' + +Now if we give it a plugin it will put the files into the dir. + + >>> sys.argv = ['ksspackage', static_dump, '--plugin=kss-core'] + >>> ksspackage() + Creating `kss.js` script: DONE + Creating `base2-dom-fp.js` script: DONE + Creating `sarissa.js` script: DONE + + >>> list(sorted(os.listdir(static_dump))) + ['base2-dom-fp.js', 'kss.js', 'sarissa.js'] + + >>> sys.argv = old_argv + +Besides creating the scripts the utility can also list the available +plugins. + + >>> sys.argv = ['ksspackage', '--list'] + >>> ksspackage() + Available plugins: + kss-core \ No newline at end of file From gotcha at codespeak.net Sat Mar 1 11:55:41 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 1 Mar 2008 11:55:41 +0100 (CET) Subject: [KSS-checkins] r51980 - kukit/kss.base/trunk/src/kss/base Message-ID: <20080301105541.1AE81168460@codespeak.net> Author: gotcha Date: Sat Mar 1 11:55:40 2008 New Revision: 51980 Modified: kukit/kss.base/trunk/src/kss/base/commands.txt Log: Some hopefully better wording Modified: kukit/kss.base/trunk/src/kss/base/commands.txt ============================================================================== --- kukit/kss.base/trunk/src/kss/base/commands.txt (original) +++ kukit/kss.base/trunk/src/kss/base/commands.txt Sat Mar 1 11:55:40 2008 @@ -2,14 +2,14 @@ KSS Commands ============ -The KSS commands system allows you to create a properly formatted KSS -response. +The KSS client awaits a response with properly formatted commands. +`KSSCommands` is the server-side component that is serialized in the response. Command renderer ================ The command renderer is the core of the system. This object is responsible -for create the KSS response. We will now take a look at an example to see it +for creating the KSS response. We take a look at an example to see it in action. >>> from kss.base import KSSCommands @@ -18,23 +18,23 @@ >>> commands = KSSCommands() -We can add commands to the renderer using the `add` method. To do this we -also need to create a selector. In this case we will use the CSS selector. -For more information about selectors look at the selector documentation. +We can add commands to the renderer using the `add` method. To do this, we +need to instantiate a selector (the CSS selector, in this example). +For more information about selectors, look at the selector documentation. + +Let us add a command. The first argument is the name of the action +which will be invoked on the client. The second argument is the selector. +The keyword arguments become arguments to the client side action. >>> from kss.base.selectors import css >>> commands.add('replaceHTML', css('#someid'), html='some value') -Now we have added a command. The first argument is the name of the action -which will be invoked on the client. Our second argument is the selector. -Any given keyword arguments become arguments to the client side action. - -You can add any number of commands this way. Each command will be executed -in the order that it is added. +You can add any number of commands this way. Commands are executed in the +client in the order they have been added on the server. >>> commands.add('someOtherAction', css('#otherid'), arg='some arg') -Now that we have a few commands we can render them. +Now that we have a few commands, we can render them. >>> commands.render() '...some value...some arg...' @@ -48,26 +48,24 @@ >>> from xml.dom import minidom >>> doc = minidom.parseString(commands.render()) -In this case there are two commands in the response (because of the +In this case, the response hold two commands (added in the previous examples). They are represented as command nodes. >>> doc.getElementsByTagName('command') [, ] -Each parameter is represented by a child node in a command. Their name -is stored in the attribute and their value is put within text nodes or -CDATA blocks. Which type of node is used depends on the type of +Each parameter is represented as a child node in a command. +Parameter name is stored as an attribute. +Parameter value is put within text nodes or CDATA blocks. +Which type of node is used depends on the type of the keyword argument given to the command. -Depending on the type the serialisation to XML changes. Strings and -unicode objects will be send as text nodes. You can also mark data as -HTML, XML or CDATA blocks. This is used so that these can have special -escaping rules. +The serialization to XML depends on the value type. +Strings and unicode objects ar sent as text nodes. +You can also mark data as HTML, XML or CDATA blocks. +These will have specific escaping rules. >>> from kss.base import xmldata, htmldata, cdatadata - -Now if we make a command with these types the output will be different. - >>> commands = KSSCommands() >>> commands.add('htmlAction', css('#someid'), html=htmldata('some value')) >>> commands.add('cdataAction', css('#otherid'), arg=cdatadata('some arg')) @@ -95,14 +93,13 @@ >>> commands.render() '......' -CDATA nodes are used for serializing XML or HTML. This makes the +CDATA nodes are used to serialize XML or HTML. This makes the response more readable when looking at it from traffic sniffers or other debugging tools. -We have another case where CDATA is used. That is when we serialize a -normal value larger than 4KB. This is because Firefox chops text nodes -at 4KB blocks (which makes the client side handling more -difficult). Using CDATA avoids the chopping. +We have another case where CDATA is used : when we serialize text + value larger than 4KB. This is a workaround a Firefox bug. +Firefox chops text nodes at 4KB blocks : this makes the client side handling more difficult). Using CDATA avoids the chopping. The example below demonstrates this behaviour. @@ -127,7 +124,7 @@ >>> commands = KSSCommands() -By default it does nothing. +When empty, it is rendered a blank line. >>> print commands @@ -138,8 +135,8 @@ >>> print commands replaceHTML(css('#someid')) -If you add parameters they are also shown in the string -representation. Parameters are sorted before display to make them +Parameters are also rendered in the string representation. +Parameters are sorted before display to make them stable for testing. >>> commands = KSSCommands() @@ -158,8 +155,7 @@ Features for working with commands ================================== -If we add a parameter with a `None` value it will not be put into the -response. +Parameter with a `None` value is not rendered into the response. >>> commands.clear() >>> commands.add('parameterCommand', css('#something'), @@ -167,9 +163,8 @@ >>> print commands parameterCommand(css('#something'), value='Testing') -You can also use strings instead of a selector instance as a value for -selector. In this case the string will automatically be converted to a -selector on the client. By default this is the CSS selector. +If the selector is a string instead of a selector class instance, +the string is converted to a CSS selector on the client. >>> commands.clear() >>> commands.add('replaceHTML', '#someid', html='some value') @@ -180,30 +175,29 @@ Command sets ============ -A command set wraps the commands system so that you get a highlevel way to +Command sets wrap the commands system and provide a highlevel API to communicate with the browser. Command sets are responsible for escaping and -validating data and can provider a nicer api for calling. +validating data. -We will now take a look at the base class for all commandsets. +Let us take a look at the base class for all commandsets. >>> from kss.base.commands import KSSCommandSet >>> commands = KSSCommands() >>> commandset = KSSCommandSet(commands) -All this does is wrap our commands in the command set. We can still access the +It wraps commands in the command set. We can still access the commands directly by using the `commands` attribute. >>> commandset.commands <...KSSCommands object at ...> -The thing that makes this interesting is the actual command sets. Take a look -at the core commands for a better understanding of the usage pattern. +Take a look at the core command set for a better understanding of the usage pattern. Using command sets ================== -In the previous examples we saw how to load command sets directly. Normally we +In the previous examples, we saw how to load command sets directly. Usually, we do not need to do this. This is because the command renderer can also look them up by name. This is done by using the KSS plugin registry. @@ -213,19 +207,21 @@ >>> from kss.base.corecommands import KSSCoreCommands >>> from kss.base.registry import command_set_registry -Now we can register our command set. For more information about the registry look at the documentation of kss.pluginregistry. +Now we can register our command set. (For more information about the registry +look at the documentation of kss.pluginregistry.) >>> command_set_registry.register('core', KSSCoreCommands) -To access a command set just need to create our command renderer like we do -normally. +Command sets are accessed as attributes on the command renderer. >>> commands = KSSCommands() - -We can now access the command set. This is done using attribute access. - >>> commands.core.replaceInnerHTML(css('div'), 'example') >>> print commands replaceInnerHTML(css('div'), html=htmldata('example')) - + +In this case, we used `replaceInnerHTML` method that is defined in the core +command set. This is equivalent but shorter than explicitely adding a command. + +Let us clean up. + >>> command_set_registry.unregister('core') From gotcha at codespeak.net Sat Mar 1 12:02:02 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 1 Mar 2008 12:02:02 +0100 (CET) Subject: [KSS-checkins] r51981 - kukit/kss.base/trunk/src/kss/base Message-ID: <20080301110202.9A282168034@codespeak.net> Author: gotcha Date: Sat Mar 1 12:02:00 2008 New Revision: 51981 Modified: kukit/kss.base/trunk/src/kss/base/corecommands.py kukit/kss.base/trunk/src/kss/base/corecommands.txt Log: Some hopefully better wording Fix a typo in error message Modified: kukit/kss.base/trunk/src/kss/base/corecommands.py ============================================================================== --- kukit/kss.base/trunk/src/kss/base/corecommands.py (original) +++ kukit/kss.base/trunk/src/kss/base/corecommands.py Sat Mar 1 12:02:00 2008 @@ -8,7 +8,7 @@ def setStyle(self, selector, name, value): if ' ' in name: - raise ValueError('Style properites cannot contain spaces') + raise ValueError('Style properties cannot contain spaces') self.commands.add('setStyle', selector, name=name, value=value) def addClass(self, selector, value): Modified: kukit/kss.base/trunk/src/kss/base/corecommands.txt ============================================================================== --- kukit/kss.base/trunk/src/kss/base/corecommands.txt (original) +++ kukit/kss.base/trunk/src/kss/base/corecommands.txt Sat Mar 1 12:02:00 2008 @@ -2,10 +2,11 @@ Core commands ============= -The core commands wrap all standard KSS actions that are always available. +The core commands wrap all KSS commands provided by the core plugin. +They are always available. These do not contain any effects and focus mostly on DOM manipulation. -First we will need to create our command set. +First we instantiate the command set. >>> from kss.base.corecommands import KSSCoreCommands >>> from kss.base import KSSCommands @@ -14,7 +15,7 @@ >>> commands = KSSCommands() >>> core = KSSCoreCommands(commands) -Now we will look at the individual methods provided by the core commands. +Let us look at the individual methods provided by the core commands. >>> core.replaceInnerHTML(css('div'), 'some <h1>html</h1>') >>> commands.render() @@ -48,7 +49,7 @@ >>> core.setStyle(css('div'), 'some name', 'some value') Traceback (most recent call last): ... - ValueError: Style properites cannot contain spaces + ValueError: Style properties cannot contain spaces Add class @@ -77,14 +78,6 @@ toggleClass(css('div'), value='somename') -Focus ------ - - >>> commands.clear() - >>> core.focus(css('div')) - >>> print commands - focus(css('div')) - ---------------- HTML replacement ---------------- @@ -98,7 +91,7 @@ replaceInnerHTML(css('div'), html=htmldata('some html')) You can also avoid KSS event setup. Use this only if you really need -the speedup because KSS will not be applied to these new nodes. +the speedup, as the KSS resource will not be bound to those new nodes. >>> core.replaceInnerHTML(css('div'), 'some html', withKssSetup=False) >>> print commands From gotcha at codespeak.net Sat Mar 1 12:10:08 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 1 Mar 2008 12:10:08 +0100 (CET) Subject: [KSS-checkins] r51982 - kukit/kss.base/trunk/src/kss/base Message-ID: <20080301111008.6BAA1168480@codespeak.net> Author: gotcha Date: Sat Mar 1 12:10:07 2008 New Revision: 51982 Modified: kukit/kss.base/trunk/src/kss/base/javascript.txt Log: Some hopefully better wording Modified: kukit/kss.base/trunk/src/kss/base/javascript.txt ============================================================================== --- kukit/kss.base/trunk/src/kss/base/javascript.txt (original) +++ kukit/kss.base/trunk/src/kss/base/javascript.txt Sat Mar 1 12:10:07 2008 @@ -5,42 +5,38 @@ The javascript module has some helpers which can be used to easily get the Javascript files from the active plugins. -Concatinated +Concatenated ============ -With the concatenated function you can get the a single string -containing all the Javascript from each active plugin. +With the `concatenated` function, you get a string that +contains the Javascript from all active plugins. >>> from kss.base.javascript import concatenated -When we run the code without activating any plugin we will get an -empty string. +Without any active plugin, we get an empty string. >>> concatenated() '' -Now if we run the code again after we activate a plugin we get -something more interesting. +If we activate a plugin, we get something more interesting. >>> from kss.base import activate >>> activate('kss-core') >>> concatenated() '/*\n* Copyright (c) 2005-2007\n* Authors: KSS Project Contributors...' -An optimization you might want to enable is concatenate the extra -dependencies along side with the plugin code. This will reduce the -number of requests a browser has to make to a website therefore making +As an optimization, you might want to concatenate the extra +dependencies along side with the plugin code. This reduces the +number of requests a browser has to make to the web server therefore making it slightly faster (only for the first page load). - >>> 'XPathParser' in concatenated(include_extras=True) - True - -This example was not there in the previous concatination. - >>> 'XPathParser' in concatenated() False -Finally we will unregister the core plugin to clean up. + >>> 'XPathParser' in concatenated(include_extras=True) + True + +Finally, we deactivate the core plugin to clean up. >>> from kss.base.plugin import deactivate >>> deactivate('kss-core') @@ -50,18 +46,18 @@ ====== The kss.base package ships with a Javascript packer. This can reduce -the filesize of the Javascript. It will also do the concatination of -all registered plugin code. +the filesize of the Javascript. +It also concatenates all registered plugin code. >>> from kss.base.javascript import packed -Like with the concatination we will get an empty string if we just run -it. +Like with the concatenation, we get an empty string if we run +it without any active plugin. >>> packed() '' -So now we activate a plugin. +Now we activate a plugin. >>> activate('kss-core') @@ -71,7 +67,7 @@ >>> no_compression '/*\n* Copyright (c) 2005-2007\n* Authors: KSS Project Contributors...' -To enable compression we need to pass in a a compression level. There +To enable compression, we need to pass the compression level. There are a few available options of which only `safe` is currently usable. >>> with_compression = packed(compression_level='safe') @@ -82,7 +78,7 @@ >>> len(with_compression) < len(no_compression) True -We will again unregister the core plugin to clean up. +We again deactivate the core plugin to clean up. >>> from kss.base.plugin import deactivate >>> deactivate('kss-core') @@ -97,12 +93,12 @@ >>> from kss.base.javascript import extra_scripts -By default we get an empty dictionary. +When no plugins are active, we get an empty dictionary. >>> extra_scripts() {} -If we activate a plugin we get something more interesting. +If we activate a plugin, we get something more interesting. >>> activate('kss-core') >>> extra_scripts() @@ -111,7 +107,7 @@ This dictionary contains the base names of all the registered Javascripts with their file contents as the value. -Now we can cleanup the registry again. +Let us cleanup the registry again. >>> from kss.base.plugin import deactivate >>> deactivate('kss-core') From gotcha at codespeak.net Sat Mar 1 12:32:11 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 1 Mar 2008 12:32:11 +0100 (CET) Subject: [KSS-checkins] r51984 - kukit/kss.base/trunk/src/kss/base Message-ID: <20080301113211.22453168420@codespeak.net> Author: gotcha Date: Sat Mar 1 12:32:10 2008 New Revision: 51984 Modified: kukit/kss.base/trunk/src/kss/base/utils.txt Log: Some hopefully better wording. Some suggestions to improve the usage; test is broken. Modified: kukit/kss.base/trunk/src/kss/base/utils.txt ============================================================================== --- kukit/kss.base/trunk/src/kss/base/utils.txt (original) +++ kukit/kss.base/trunk/src/kss/base/utils.txt Sat Mar 1 12:32:10 2008 @@ -2,31 +2,32 @@ Utilities ========= -KSS ships with various utilties. When you install `kss.base` these get -installed as executables. +KSS ships with various utilities. When you install `kss.base`, they get +installed as executable scripts. Create a standalone package =========================== -Since the whole KSS framework is pluggable the amount of Javascript -that ends up being used depends a lot on the plugins. To make it easy -to create static files from a know plugin configuration we have the -`ksspackage`. This creates a directory with all the Javascripts needed +Since the whole KSS framework is pluggable, the Javascript that ends up +being used depends a lot on the plugins. + +The `ksspackage` makes it easy to create static files from a known plugin configuration. +It creates a directory with all the Javascripts needed to run the set of plugins. >>> from pkg_resources import load_entry_point >>> ksspackage = load_entry_point( ... 'kss.base', 'console_scripts', 'ksspackage') -We will first setup a temp directory to contain our stuff. +Let us setup a temporary directory that will contain our stuff. >>> import os >>> from tempfile import mktemp >>> temp = mktemp() >>> static_dump = os.path.join(temp, 'static-dump') -Executing the script without any arguments will raise an error. +Executing the script without any arguments raises an error. >>> import sys >>> old_argv = sys.argv @@ -36,24 +37,16 @@ Usage: ksspackage OUTPUTDIR [OPTIONS] Try `ksspackage --help` for more information. -It needs at least one argument, the path for the output. - - >>> sys.argv = ['ksspackage', static_dump] - >>> ksspackage() - Creating `kss.js` script: DONE - -If we look into the export we will see only the `kss.js` file. - - >>> os.listdir(static_dump) - ['kss.js'] +It needs at least two arguments, the path for the output and a plugin. -In this case it is empty since we did not give it any plugins to -extract the Javascript from. +To find out which plugin we can use, let us ask for the available plugins. - >>> open(os.path.join(static_dump, 'kss.js')).read() - '' +// >>> sys.argv = ['ksspackage', '--list'] +// >>> ksspackage() +// Available plugins: +// kss-core -Now if we give it a plugin it will put the files into the dir. +Now that we provide a plugin, its files are put into the dir. >>> sys.argv = ['ksspackage', static_dump, '--plugin=kss-core'] >>> ksspackage() @@ -66,10 +59,10 @@ >>> sys.argv = old_argv -Besides creating the scripts the utility can also list the available -plugins. +The code hereunder should be removed : strangely, it only works after the code +above. >>> sys.argv = ['ksspackage', '--list'] >>> ksspackage() Available plugins: - kss-core \ No newline at end of file + kss-core From jvloothuis at codespeak.net Sat Mar 1 13:49:03 2008 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 1 Mar 2008 13:49:03 +0100 (CET) Subject: [KSS-checkins] r51991 - kukit/kss.base/trunk/src/kss/base Message-ID: <20080301124903.68DE81684C3@codespeak.net> Author: jvloothuis Date: Sat Mar 1 13:49:01 2008 New Revision: 51991 Modified: kukit/kss.base/trunk/src/kss/base/plugin.txt kukit/kss.base/trunk/src/kss/base/utils.py kukit/kss.base/trunk/src/kss/base/utils.txt Log: Fixed the listing of plugins for the ksspackage utility Made the plugin test clean up after itself Modified: kukit/kss.base/trunk/src/kss/base/plugin.txt ============================================================================== --- kukit/kss.base/trunk/src/kss/base/plugin.txt (original) +++ kukit/kss.base/trunk/src/kss/base/plugin.txt Sat Mar 1 13:49:01 2008 @@ -156,3 +156,12 @@ >>> ExamplePlugin.priority = -99999 >>> list(available_plugins()) [('testing', ), ('kss-core', )] + + +Cleanup +------- + +Finally we will cleanup the working set so that the next tests won't +find our example plugin. + + >>> pkg_resources.working_set.entry_keys['.'] = [] Modified: kukit/kss.base/trunk/src/kss/base/utils.py ============================================================================== --- kukit/kss.base/trunk/src/kss/base/utils.py (original) +++ kukit/kss.base/trunk/src/kss/base/utils.py Sat Mar 1 13:49:01 2008 @@ -3,7 +3,7 @@ import optparse from kss.base import javascript -from kss.base.plugin import activate, active_plugins +from kss.base.plugin import activate, available_plugins def ksspackage(): parser = optparse.OptionParser() @@ -50,7 +50,8 @@ elif options.list_plugins: print "Available plugins:" - for id, factory in active_plugins(): + + for id, factory in available_plugins(): print " %s" % id else: Modified: kukit/kss.base/trunk/src/kss/base/utils.txt ============================================================================== --- kukit/kss.base/trunk/src/kss/base/utils.txt (original) +++ kukit/kss.base/trunk/src/kss/base/utils.txt Sat Mar 1 13:49:01 2008 @@ -41,10 +41,10 @@ To find out which plugin we can use, let us ask for the available plugins. -// >>> sys.argv = ['ksspackage', '--list'] -// >>> ksspackage() -// Available plugins: -// kss-core + >>> sys.argv = ['ksspackage', '--list'] + >>> ksspackage() + Available plugins: + kss-core Now that we provide a plugin, its files are put into the dir. @@ -59,10 +59,3 @@ >>> sys.argv = old_argv -The code hereunder should be removed : strangely, it only works after the code -above. - - >>> sys.argv = ['ksspackage', '--list'] - >>> ksspackage() - Available plugins: - kss-core From kukit-checkins at codespeak.net Sun Mar 2 15:05:55 2008 From: kukit-checkins at codespeak.net (kukit-checkins at codespeak.net) Date: Sun, 2 Mar 2008 15:05:55 +0100 (CET) Subject: [KSS-checkins] March 85% Off Message-ID: 20080302040518.8593.qmail@hostk215.infobiuro.pl An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20080302/19e93d33/attachment-0001.htm From reebalazs at codespeak.net Sun Mar 2 16:50:45 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 2 Mar 2008 16:50:45 +0100 (CET) Subject: [KSS-checkins] r52043 - kukit/kss.concatresource/branch/1.4 Message-ID: <20080302155045.C1E5916856F@codespeak.net> Author: reebalazs Date: Sun Mar 2 16:50:44 2008 New Revision: 52043 Added: kukit/kss.concatresource/branch/1.4/ - copied from r52042, kukit/kss.concatresource/branch/1.4pre/ Log: Relocate branch to its final place 1.4, 1.4pre will be deleted asap. From reebalazs at codespeak.net Sun Mar 2 16:51:04 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 2 Mar 2008 16:51:04 +0100 (CET) Subject: [KSS-checkins] r52044 - kukit/kukit.js/branch/1.4 Message-ID: <20080302155104.690CD16856C@codespeak.net> Author: reebalazs Date: Sun Mar 2 16:51:03 2008 New Revision: 52044 Added: kukit/kukit.js/branch/1.4/ - copied from r52043, kukit/kukit.js/branch/1.4pre/ Log: Relocate branch to its final place 1.4, 1.4pre will be deleted asap. From reebalazs at codespeak.net Sun Mar 2 16:51:30 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 2 Mar 2008 16:51:30 +0100 (CET) Subject: [KSS-checkins] r52045 - kukit/kss.core/branch/1.4 Message-ID: <20080302155130.5B65916856C@codespeak.net> Author: reebalazs Date: Sun Mar 2 16:51:29 2008 New Revision: 52045 Added: kukit/kss.core/branch/1.4/ - copied from r52044, kukit/kss.core/branch/1.4pre/ Log: Relocate branch to its final place 1.4, 1.4pre will be deleted asap. From reebalazs at codespeak.net Sun Mar 2 16:54:39 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 2 Mar 2008 16:54:39 +0100 (CET) Subject: [KSS-checkins] r52046 - in kukit/kss.core/branch/1.4/kss/core: . pluginregistry Message-ID: <20080302155439.CC9AF16856C@codespeak.net> Author: reebalazs Date: Sun Mar 2 16:54:39 2008 New Revision: 52046 Modified: kukit/kss.core/branch/1.4/kss/core/ (props changed) kukit/kss.core/branch/1.4/kss/core/EXTERNALS.TXT kukit/kss.core/branch/1.4/kss/core/pluginregistry/ (props changed) kukit/kss.core/branch/1.4/kss/core/pluginregistry/EXTERNALS.TXT Log: Set externals Modified: kukit/kss.core/branch/1.4/kss/core/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/branch/1.4/kss/core/EXTERNALS.TXT (original) +++ kukit/kss.core/branch/1.4/kss/core/EXTERNALS.TXT Sun Mar 2 16:54:39 2008 @@ -5,4 +5,4 @@ # You can update your working dir by: # svn propset svn:externals -F EXTERNALS.TXT . # -kukit http://codespeak.net/svn/kukit/kukit.js/branch/1.4pre/ +kukit http://codespeak.net/svn/kukit/kukit.js/branch/1.4/ Modified: kukit/kss.core/branch/1.4/kss/core/pluginregistry/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/branch/1.4/kss/core/pluginregistry/EXTERNALS.TXT (original) +++ kukit/kss.core/branch/1.4/kss/core/pluginregistry/EXTERNALS.TXT Sun Mar 2 16:54:39 2008 @@ -7,4 +7,4 @@ # # concatresource is now included like as batteries -_concatresource https://codespeak.net/svn/kukit/kss.concatresource/branch/1.4pre/kss/concatresource +_concatresource https://codespeak.net/svn/kukit/kss.concatresource/branch/1.4/kss/concatresource From reebalazs at codespeak.net Sun Mar 2 16:55:47 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 2 Mar 2008 16:55:47 +0100 (CET) Subject: [KSS-checkins] r52047 - kukit/kss.demo/branch/1.4 Message-ID: <20080302155547.87009168471@codespeak.net> Author: reebalazs Date: Sun Mar 2 16:55:47 2008 New Revision: 52047 Added: kukit/kss.demo/branch/1.4/ - copied from r52046, kukit/kss.demo/branch/1.4pre/ Log: Relocate branch to its final place 1.4, 1.4pre will be deleted asap. From reebalazs at codespeak.net Sun Mar 2 17:02:58 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 2 Mar 2008 17:02:58 +0100 (CET) Subject: [KSS-checkins] r52049 - in kukit/kss.demo/branch/1.4/kss/demo: . configfeature configfeature/tests Message-ID: <20080302160258.27BDB168564@codespeak.net> Author: reebalazs Date: Sun Mar 2 17:02:57 2008 New Revision: 52049 Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/ kukit/kss.demo/branch/1.4/kss/demo/configfeature/README kukit/kss.demo/branch/1.4/kss/demo/configfeature/__init__.py kukit/kss.demo/branch/1.4/kss/demo/configfeature/configure.zcml kukit/kss.demo/branch/1.4/kss/demo/configfeature/directives.py kukit/kss.demo/branch/1.4/kss/demo/configfeature/fiveconfig.py kukit/kss.demo/branch/1.4/kss/demo/configfeature/fiveconfig.zcml kukit/kss.demo/branch/1.4/kss/demo/configfeature/meta.py kukit/kss.demo/branch/1.4/kss/demo/configfeature/meta.zcml kukit/kss.demo/branch/1.4/kss/demo/configfeature/metacore.zcml kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/ kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/__init__.py kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/__parent__.py kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/configtest.py kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/test_directive.py kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/test_fiveconfig.py Removed: kukit/kss.demo/branch/1.4/kss/demo/EXTERNALS.TXT Modified: kukit/kss.demo/branch/1.4/kss/demo/ (props changed) Log: Include configfeature library statically, instead of an external This is the last version when we use configfeature anyway, so this is a temporary solution. However now since this package will make part of the official distribution. Deleted: /kukit/kss.demo/branch/1.4/kss/demo/EXTERNALS.TXT ============================================================================== --- /kukit/kss.demo/branch/1.4/kss/demo/EXTERNALS.TXT Sun Mar 2 17:02:57 2008 +++ (empty file) @@ -1,8 +0,0 @@ -# -# results of svn propget svn:externals -# http://codespeak.net/svn/kukit/kss.demo/trunk -# -# You can update your working dir by: -# svn propset svn:externals -F EXTERNALS.TXT . -# -configfeature http://codespeak.net/svn/z3/jsonserver/branch/merge/configfeature Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/README ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/README Sun Mar 2 17:02:57 2008 @@ -0,0 +1,35 @@ + +Objectives +---------- + +The goal of the program is to enable defining a feature based on +configuration values set from python code. The directive imports +a python object and uses an attribute of it as a boolean value +to declare a feature or not. + + + + + +Instance can be used as a module itself (in which case a module level +attribute can be looked up) or a class instance (in this case an attribute +of the instance will be used). If there is no such attribute on the instance, +a dictionary key access will be attempted, allowing dictionaries to be used. + +The given attribute is used as a boolean value. It must exist, or else +an error is raised. + +The featured fiveconfig.zcml serves both as an example and also can be +used to identify which version of five is in effect. The configuration +can be used both by zope configuration (by using the features), or +from python code, by directly importing the module that forms the base +for the feature setup. + +The negate attribute is only necessary to overcome the lack of negation +feature in zcml:condition. + Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/__init__.py Sun Mar 2 17:02:57 2008 @@ -0,0 +1,3 @@ +'''\ +Product init +''' Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/configure.zcml ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/configure.zcml Sun Mar 2 17:02:57 2008 @@ -0,0 +1,4 @@ + + + Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/directives.py ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/directives.py Sun Mar 2 17:02:57 2008 @@ -0,0 +1,34 @@ +from zope.interface import Interface +from zope.configuration.fields import GlobalObject, Bool +from zope.schema import ASCII +from zope.app.publisher.browser.metadirectives import IBasicResourceInformation + +class IConfigFeature(IBasicResourceInformation): + """ + Defines a feature based on a python configuration + """ + + feature = ASCII( + title = u"Feature", + description = u"Name of the feature to define", + required = True, + ) + + instance = GlobalObject( + title = u'Object instance', + description = u'Dotted name of the object that holds the attribute.', + required = True, + ) + + attribute = ASCII( + title = u"Attribute", + description = u"Attribute name within the object.", + required = True, + ) + + negate = Bool( + title = u'Negate', + description = u'If to negate the boolean value, default False', + default = False, + required = False, + ) Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/fiveconfig.py ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/fiveconfig.py Sun Mar 2 17:02:57 2008 @@ -0,0 +1,75 @@ +'''\ +Compatibility configuration switches + +This is a transitional solution to attack the problem +of quickly changing Zope3 and Five APIs. + +Import checks are done centrally from here. +The point is that compatibility imports should fail here, +if anything goes wrong. Components should only check +the switches set from here. + +Corresponding configuration features are also set up +from the compat.zcml file. The idea is that all switches +are accessible both from python and zcml. + + +Supported versions: +------------------- + +Zope 2.9, 2.10 +Zope 3.2, 3.3 + +Compatibility matrix +-------------------- + +The following table shows which Five version can and should be used +with which Zope 2 and Zope 3 versions. + +. Zope 2.8 Zope 2.9 Zope 2.10 +. Zope X3 3.0 Zope 3.2 Zope 3.3 +Five 1.0 included +Five 1.2 X +Five 1.3 included +Five 1.4 X +Five trunk included + +''' + +__all__ = ('__compat__', ) + +class DictLike(object): + pass + +__compat__ = DictLike() + +try: + import zope.component.interface + # XXX this now fails on Zope 3.4, so + # commented out even if it gives bad result now + ##import zope.component.location + __compat__.zope_pre_3_3 = False +except ImportError: + # The only supported pre_3_3 version is 3.2 + import zope.app.component.interface + ##import zope.app.location + __compat__.zope_pre_3_3 = True + +try: + import Products.Five +except ImportError: + __compat__.five = False +else: + __compat__.five = True + try: + # Zope 2.8 / Five 1.0.2 + from Products.Five.resource import Resource + __compat__.five_pre_1_3 = True + except ImportError: + # Zope 2.9 / Five 1.3 + from Products.Five.browser.resource import Resource + __compat__.five_pre_1_3 = False + +# Unsupported versions. +if __compat__.five and __compat__.five_pre_1_3: + raise Exception, 'Zope 2.8 or prior versions (Five 1.2 or prior versions) are unsupported, please upgrade!' Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/fiveconfig.zcml ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/fiveconfig.zcml Sun Mar 2 17:02:57 2008 @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/meta.py ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/meta.py Sun Mar 2 17:02:57 2008 @@ -0,0 +1,99 @@ + +from zope.configuration.exceptions import ConfigurationError + +def configfeature(_context, feature, instance, attribute, negate=False): + """Imports a python object and uses an attribute of it as a boolean value + to declare a feature or not. + + Usage + ----- + + We can have an object with attributes, + + >>> class dictlike(object): + ... pass + >>> conf1 = dictlike() + >>> conf1.this = True + >>> conf1.that = False + + and its attributes can defined a feature if they evaluate to True. + The feature will not be defined if the value evaluates to False. + + >>> from zope.configuration.config import ConfigurationContext + >>> c = ConfigurationContext() + >>> configfeature(c, 'f1', conf1, 'this') + >>> c.hasFeature('f1') + True + >>> configfeature(c, 'f2', conf1, 'that') + >>> c.hasFeature('f2') + False + + The boolean value can be negated, this allows it + to overcome the shortage of negating possibilit of zcml:condition. + + >>> configfeature(c, 'f3', conf1, 'this', True) + >>> c.hasFeature('f3') + False + >>> configfeature(c, 'f4', conf1, 'that', True) + >>> c.hasFeature('f4') + True + + Instead of an object with attributes, a dictionary can also be used: + + >>> dconf = {} + >>> dconf['this'] = True + >>> dconf['that'] = False + + >>> configfeature(c, 'f5', dconf, 'this') + >>> c.hasFeature('f5') + True + >>> configfeature(c, 'f6', dconf, 'that') + >>> c.hasFeature('f6') + False + + + Error handling + -------------- + + If there is an unexistent attribute, an error is reported. + + >>> configfeature(c, 'f7', conf1, 'nosuch') #doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ConfigurationError: Object ... does not have attribute or key "nosuch" + + >>> configfeature(c, 'f8', dconf, 'nosuch') #doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ConfigurationError: Object ... does not have attribute or key "nosuch" + + + Finally, like with the "provides" directive normally: + Spaces are not allowed in feature names (this is reserved for providing + many features with a single directive in the futute). + + >>> configfeature(c, 'two words', conf1, 'this') + Traceback (most recent call last): + ... + ValueError: Only one feature name allowed + + """ + + try: + value = getattr(instance, attribute) + except AttributeError: + # also try as dictionary value + try: + value = instance[attribute] + except (TypeError, ValueError, KeyError): + raise ConfigurationError, 'Object %s does not have attribute or key "%s"' % (instance, attribute) + + value = bool(value) + if negate: + value = not value + + if len(feature.split()) > 1: + raise ValueError("Only one feature name allowed") + + if value: + _context.provideFeature(feature) Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/meta.zcml ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/meta.zcml Sun Mar 2 17:02:57 2008 @@ -0,0 +1,10 @@ + + + + + + + + Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/metacore.zcml ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/metacore.zcml Sun Mar 2 17:02:57 2008 @@ -0,0 +1,15 @@ + + + + + + + + + Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/__init__.py Sun Mar 2 17:02:57 2008 @@ -0,0 +1,4 @@ +'''\ +Module init +''' + Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/__parent__.py ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/__parent__.py Sun Mar 2 17:02:57 2008 @@ -0,0 +1,9 @@ +import sys + +def __parent__(modulename, level=1): + 'Figure out parent module' + for i in range(level): + if not isinstance(modulename, basestring): + modulename = modulename.__name__ + modulename = sys.modules['.'.join(modulename.split('.')[:-1])] + return modulename Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/configtest.py ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/configtest.py Sun Mar 2 17:02:57 2008 @@ -0,0 +1,18 @@ + +# module level +conf1 = True +conf2 = False + +class dictlike(object): + pass + +# an object +cobj = dictlike() +cobj.conf3 = True +cobj.conf4 = False + +# a dict +dobj = {} +dobj['conf5'] = True +dobj['conf6'] = False + Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/test_directive.py ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/test_directive.py Sun Mar 2 17:02:57 2008 @@ -0,0 +1,228 @@ + +import sys +import unittest +from zope.testing.doctestunit import DocTestSuite +from __parent__ import __parent__ +configfeature = __parent__(__name__, 2) + +def test_module_level(): + """ + Module level access. + + >>> import zope.configuration.tests + >>> import zope.configuration.xmlconfig + >>> context = zope.configuration.xmlconfig.file('metacore.zcml', configfeature) + + >>> import tempfile + >>> fn = tempfile.mktemp('.zcml') + >>> zcml = open(fn, 'w') + >>> zcml.write(''' + ... + ... + ... + ... + ... + ... ''') + >>> zcml.close() + + >>> context = zope.configuration.xmlconfig.file(fn, configfeature.tests, context) + + >>> context.hasFeature('conf1') + True + >>> context.hasFeature('conf2') + False + >>> context.hasFeature('conf2n') + True + + """ + + +def test_objectlevel(): + """ + Object level access. + + >>> import zope.configuration.tests + >>> import zope.configuration.xmlconfig + >>> context = zope.configuration.xmlconfig.file('metacore.zcml', configfeature) + + >>> import tempfile + >>> fn = tempfile.mktemp('.zcml') + >>> zcml = open(fn, 'w') + >>> zcml.write(''' + ... + ... + ... + ... + ... + ... ''') + >>> zcml.close() + + >>> context = zope.configuration.xmlconfig.file(fn, configfeature.tests, context) + + >>> context.hasFeature('conf3') + True + >>> context.hasFeature('conf4') + False + >>> context.hasFeature('conf4n') + True + + """ + + +def test_dict_level(): + """ + Dictionary level access. + + >>> import zope.configuration.tests + >>> import zope.configuration.xmlconfig + >>> context = zope.configuration.xmlconfig.file('metacore.zcml', configfeature) + + >>> import tempfile + >>> fn = tempfile.mktemp('.zcml') + >>> zcml = open(fn, 'w') + >>> zcml.write(''' + ... + ... + ... + ... + ... + ... ''') + >>> zcml.close() + + >>> context = zope.configuration.xmlconfig.file(fn, configfeature.tests, context) + + >>> context.hasFeature('conf5') + True + >>> context.hasFeature('conf6') + False + >>> context.hasFeature('conf6n') + True + + """ + + +def test_errors(): + """ + Testing errors. + + >>> import zope.configuration.tests + >>> import zope.configuration.xmlconfig + >>> context = zope.configuration.xmlconfig.file('metacore.zcml', configfeature) + + No such instance: raises an error. + + >>> import tempfile + >>> fn = tempfile.mktemp('.zcml') + >>> zcml = open(fn, 'w') + >>> zcml.write(''' + ... + ... + ... + ... ''') + >>> zcml.close() + + >>> context = zope.configuration.xmlconfig.file(fn, configfeature.tests, context) #doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ZopeXMLConfigurationError: ... + ConfigurationError: ... + + No such attribute: an error too + + >>> fn = tempfile.mktemp('.zcml') + >>> zcml = open(fn, 'w') + >>> zcml.write(''' + ... + ... + ... + ... ''') + >>> zcml.close() + + >>> context = zope.configuration.xmlconfig.file(fn, configfeature.tests, context) #doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ZopeXMLConfigurationError: ... + ConfigurationError: Object ... does not have attribute or key "nosuch" + + No such key: an error too + + >>> fn = tempfile.mktemp('.zcml') + >>> zcml = open(fn, 'w') + >>> zcml.write(''' + ... + ... + ... + ... ''') + >>> zcml.close() + + >>> context = zope.configuration.xmlconfig.file(fn, configfeature.tests, context) #doctest: +ELLIPSIS + Traceback (most recent call last): + ... + ZopeXMLConfigurationError: ... + ConfigurationError: Object ... does not have attribute or key "nosuch" + + """ + + +def test_suite(): + return unittest.TestSuite(( + DocTestSuite(configfeature.__name__ + '.meta'), + DocTestSuite(), + )) Added: kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/test_fiveconfig.py ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/1.4/kss/demo/configfeature/tests/test_fiveconfig.py Sun Mar 2 17:02:57 2008 @@ -0,0 +1,27 @@ + +import sys +import unittest +from zope.testing.doctestunit import DocTestSuite +from __parent__ import __parent__ +configfeature = __parent__(__name__, 2) + +def test_fiveconfig(): + """ + The fiveconfig.zcml file declares various Five compatibility features. + We only test that the configuration file can be run. + + >>> import zope.configuration.tests + >>> import zope.configuration.xmlconfig + >>> context = zope.configuration.xmlconfig.file('metacore.zcml', configfeature) + >>> context = zope.configuration.xmlconfig.file('fiveconfig.zcml', configfeature, context) + + >>> context.hasFeature('compat_five') or context.hasFeature('compat_not_five') + True + + """ + + +def test_suite(): + return unittest.TestSuite(( + DocTestSuite(), + )) From reebalazs at codespeak.net Sun Mar 2 18:09:45 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 2 Mar 2008 18:09:45 +0100 (CET) Subject: [KSS-checkins] r52054 - in kukit/kukit.js/trunk: . doc Message-ID: <20080302170945.E7ACE168574@codespeak.net> Author: reebalazs Date: Sun Mar 2 18:09:43 2008 New Revision: 52054 Modified: kukit/kukit.js/trunk/doc/HISTORY.txt kukit/kukit.js/trunk/version.txt Log: Bump version to 1.5 Modified: kukit/kukit.js/trunk/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/trunk/doc/HISTORY.txt (original) +++ kukit/kukit.js/trunk/doc/HISTORY.txt Sun Mar 2 18:09:43 2008 @@ -2,10 +2,12 @@ (name of developer listed in brackets) -kukit.js - 1.4dev Unreleased +kukit.js - 1.5dev Unreleased - ... +kukit.js - 1.4dev Unreleased + - refactor the value provider registry to use a single registry in place of 3. This will enable to define value Modified: kukit/kukit.js/trunk/version.txt ============================================================================== --- kukit/kukit.js/trunk/version.txt (original) +++ kukit/kukit.js/trunk/version.txt Sun Mar 2 18:09:43 2008 @@ -1 +1 @@ -1.4dev unreleased +1.5dev unreleased From reebalazs at codespeak.net Sun Mar 2 18:09:51 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 2 Mar 2008 18:09:51 +0100 (CET) Subject: [KSS-checkins] r52055 - in kukit/kss.core/trunk: docs kss/core Message-ID: <20080302170951.CC82D168575@codespeak.net> Author: reebalazs Date: Sun Mar 2 18:09:51 2008 New Revision: 52055 Modified: kukit/kss.core/trunk/docs/HISTORY.txt kukit/kss.core/trunk/kss/core/version.txt Log: Bump version to 1.5 Modified: kukit/kss.core/trunk/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/trunk/docs/HISTORY.txt (original) +++ kukit/kss.core/trunk/docs/HISTORY.txt Sun Mar 2 18:09:51 2008 @@ -2,10 +2,12 @@ (name of developer listed in brackets) -kss.core - 1.4dev Unreleased +kss.core - 1.5dev Unreleased - ... +kss.core - 1.4dev Unreleased + - refactor the value provider registry to use a single registry in place of 3. This will enable to define value Modified: kukit/kss.core/trunk/kss/core/version.txt ============================================================================== --- kukit/kss.core/trunk/kss/core/version.txt (original) +++ kukit/kss.core/trunk/kss/core/version.txt Sun Mar 2 18:09:51 2008 @@ -1 +1 @@ -1.4dev unreleased +1.5dev unreleased From reebalazs at codespeak.net Sun Mar 2 18:17:34 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 2 Mar 2008 18:17:34 +0100 (CET) Subject: [KSS-checkins] r52056 - in kukit/kss.demo/trunk: . docs kss/demo Message-ID: <20080302171734.0F74B168574@codespeak.net> Author: reebalazs Date: Sun Mar 2 18:17:33 2008 New Revision: 52056 Modified: kukit/kss.demo/trunk/docs/HISTORY.txt kukit/kss.demo/trunk/kss/demo/version.txt kukit/kss.demo/trunk/setup.py Log: Bump version to 1.5 Modified: kukit/kss.demo/trunk/docs/HISTORY.txt ============================================================================== --- kukit/kss.demo/trunk/docs/HISTORY.txt (original) +++ kukit/kss.demo/trunk/docs/HISTORY.txt Sun Mar 2 18:17:33 2008 @@ -2,10 +2,12 @@ (name of developer listed in brackets) -kss.demo - 1.4dev Unreleased +kss.demo - 1.5dev Unreleased - ... +kss.demo - 1.4dev Unreleased + - Use develui.css (style is inline with kssproject.org). [gotcha] Modified: kukit/kss.demo/trunk/kss/demo/version.txt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/version.txt (original) +++ kukit/kss.demo/trunk/kss/demo/version.txt Sun Mar 2 18:17:33 2008 @@ -1 +1 @@ -1.4dev Unreleased +1.5dev Unreleased Modified: kukit/kss.demo/trunk/setup.py ============================================================================== --- kukit/kss.demo/trunk/setup.py (original) +++ kukit/kss.demo/trunk/setup.py Sun Mar 2 18:17:33 2008 @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import sys, os -version = '1.4' +version = '1.5' setup(name='kss.demo', version=version, From reebalazs at codespeak.net Sun Mar 2 18:17:55 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 2 Mar 2008 18:17:55 +0100 (CET) Subject: [KSS-checkins] r52057 - kukit/kss.core/trunk Message-ID: <20080302171755.67FAE168575@codespeak.net> Author: reebalazs Date: Sun Mar 2 18:17:54 2008 New Revision: 52057 Modified: kukit/kss.core/trunk/setup.py Log: Bump version to 1.5 Modified: kukit/kss.core/trunk/setup.py ============================================================================== --- kukit/kss.core/trunk/setup.py (original) +++ kukit/kss.core/trunk/setup.py Sun Mar 2 18:17:54 2008 @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import sys, os -version = '1.4' +version = '1.5' setup(name='kss.core', version=version, From reebalazs at codespeak.net Sun Mar 2 18:19:47 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 2 Mar 2008 18:19:47 +0100 (CET) Subject: [KSS-checkins] r52058 - kukit/kss.demo/branch/1.4 Message-ID: <20080302171947.37F7016855F@codespeak.net> Author: reebalazs Date: Sun Mar 2 18:19:46 2008 New Revision: 52058 Modified: kukit/kss.demo/branch/1.4/setup.py Log: Set egg dependency Modified: kukit/kss.demo/branch/1.4/setup.py ============================================================================== --- kukit/kss.demo/branch/1.4/setup.py (original) +++ kukit/kss.demo/branch/1.4/setup.py Sun Mar 2 18:19:46 2008 @@ -33,6 +33,6 @@ # -*- Entry points: -*- """, dependency_links=[ - 'https://codespeak.net/svn/kukit/kss.core/trunk#egg=kss.core-dev', + 'https://codespeak.net/svn/kukit/kss.core/branch/1.4#egg=kss.core-dev', ], ) From kukit-checkins at codespeak.net Tue Mar 4 15:07:41 2008 From: kukit-checkins at codespeak.net (kukit-checkins at codespeak.net) Date: Tue, 4 Mar 2008 15:07:41 +0100 (CET) Subject: [KSS-checkins] March 80% Off Message-ID: <20080304180702.10328.qmail@bbcache-92.singnet.com.sg> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20080304/7f36c0be/attachment.htm From jvloothuis at codespeak.net Tue Mar 4 15:23:01 2008 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 4 Mar 2008 15:23:01 +0100 (CET) Subject: [KSS-checkins] r52144 - kukit/kss.base/trunk Message-ID: <20080304142301.76C1C169F4F@codespeak.net> Author: jvloothuis Date: Tue Mar 4 15:23:01 2008 New Revision: 52144 Modified: kukit/kss.base/trunk/setup.py Log: Increased the version to match the new target release so kss.django etc. can depend on it Modified: kukit/kss.base/trunk/setup.py ============================================================================== --- kukit/kss.base/trunk/setup.py (original) +++ kukit/kss.base/trunk/setup.py Tue Mar 4 15:23:01 2008 @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.3' +version = '0.4' long_description = """ KSS enables you write rich Ajax applications without having to code From jvloothuis at codespeak.net Tue Mar 4 15:40:48 2008 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 4 Mar 2008 15:40:48 +0100 (CET) Subject: [KSS-checkins] r52146 - in kukit/kss.plugin.scriptaculous/trunk: . kss/plugin/scriptaculous kss/plugin/scriptaculous/javascript Message-ID: <20080304144048.420A2169F63@codespeak.net> Author: jvloothuis Date: Tue Mar 4 15:40:46 2008 New Revision: 52146 Modified: kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/config.py kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/javascript/plugin.js kukit/kss.plugin.scriptaculous/trunk/setup.py Log: Made the plugin work with the recent version of kss.base Modified: kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/config.py ============================================================================== --- kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/config.py (original) +++ kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/config.py Tue Mar 4 15:40:46 2008 @@ -21,5 +21,4 @@ 'scriptaculous': KSSScriptaculousCommands, } - selectors = [] Modified: kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/javascript/plugin.js ============================================================================== --- kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/javascript/plugin.js (original) +++ kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/javascript/plugin.js Tue Mar 4 15:40:46 2008 @@ -9,7 +9,7 @@ } if (kukit.HASEFFECTS) { - kukit.ar.actionRegistry.register("effect", function (oper) { + kukit.actionsGlobalRegistry.register("effect", function (oper) { oper.completeParms([], { 'type': 'fade', 'queue': null, 'scope': null, 'delay': null}, 'scriptaculous effect'); @@ -44,7 +44,7 @@ } }); - kukit.cr.commandRegistry.registerFromAction('effect', kukit.cr.makeSelectorCommand); + kukit.commandsGlobalRegistry.registerFromAction('effect', kukit.cr.makeSelectorCommand); // This is terrible. We needed to copy this part // from prototype. Notice that I put this.$ = Modified: kukit/kss.plugin.scriptaculous/trunk/setup.py ============================================================================== --- kukit/kss.plugin.scriptaculous/trunk/setup.py (original) +++ kukit/kss.plugin.scriptaculous/trunk/setup.py Tue Mar 4 15:40:46 2008 @@ -23,7 +23,7 @@ zip_safe=False, install_requires=[ 'setuptools', - 'kss.base>=dev', + 'kss.base', ], entry_points={ 'kss.plugin': [ From kukit-checkins at codespeak.net Fri Mar 7 15:31:25 2008 From: kukit-checkins at codespeak.net (BestDeals ® Official Site) Date: Fri, 7 Mar 2008 15:31:25 +0100 (CET) Subject: [KSS-checkins] March %74 OFF Message-ID: <20080307163043.9787.qmail@ppp-58-9-101-224.revip2.asianet.co.th> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20080307/e6f58f69/attachment.htm From kukit-checkins at codespeak.net Fri Mar 7 18:58:37 2008 From: kukit-checkins at codespeak.net (kukit-checkins at codespeak.net) Date: Fri, 7 Mar 2008 18:58:37 +0100 (CET) Subject: [KSS-checkins] MedHelp 26497 Message-ID: <20080307115803.4801.qmail@ppp78-37-187-27.pppoe.avangarddsl.ru> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20080307/562fd53c/attachment-0001.htm From reebalazs at codespeak.net Sun Mar 9 08:45:01 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 08:45:01 +0100 (CET) Subject: [KSS-checkins] r52314 - kukit/kss.concatresource/tag/1.4-alpha1 Message-ID: <20080309074501.EBE2D16844D@codespeak.net> Author: reebalazs Date: Sun Mar 9 08:44:59 2008 New Revision: 52314 Added: kukit/kss.concatresource/tag/1.4-alpha1/ - copied from r52313, kukit/kss.concatresource/branch/1.4/ Log: Tag for release From reebalazs at codespeak.net Sun Mar 9 08:46:09 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 08:46:09 +0100 (CET) Subject: [KSS-checkins] r52315 - kukit/kukit.js/tag/1.4-alpha1 Message-ID: <20080309074609.3038016844D@codespeak.net> Author: reebalazs Date: Sun Mar 9 08:46:08 2008 New Revision: 52315 Added: kukit/kukit.js/tag/1.4-alpha1/ - copied from r52314, kukit/kukit.js/branch/1.4/ Log: Tag for release From reebalazs at codespeak.net Sun Mar 9 08:46:24 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 08:46:24 +0100 (CET) Subject: [KSS-checkins] r52316 - kukit/kss.core/tag/1.4-alpha1 Message-ID: <20080309074624.A5F84168450@codespeak.net> Author: reebalazs Date: Sun Mar 9 08:46:24 2008 New Revision: 52316 Added: kukit/kss.core/tag/1.4-alpha1/ - copied from r52315, kukit/kss.core/branch/1.4/ Log: Tag for release From reebalazs at codespeak.net Sun Mar 9 08:46:38 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 08:46:38 +0100 (CET) Subject: [KSS-checkins] r52317 - kukit/kss.demo/tag/1.4-alpha1 Message-ID: <20080309074638.72A24168451@codespeak.net> Author: reebalazs Date: Sun Mar 9 08:46:37 2008 New Revision: 52317 Added: kukit/kss.demo/tag/1.4-alpha1/ - copied from r52316, kukit/kss.demo/branch/1.4/ Log: Tag for release From reebalazs at codespeak.net Sun Mar 9 08:50:13 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 08:50:13 +0100 (CET) Subject: [KSS-checkins] r52318 - in kukit/kss.concatresource/tag/1.4-alpha1: . docs kss/concatresource Message-ID: <20080309075013.0DA1016844D@codespeak.net> Author: reebalazs Date: Sun Mar 9 08:50:12 2008 New Revision: 52318 Removed: kukit/kss.concatresource/tag/1.4-alpha1/setup.cfg Modified: kukit/kss.concatresource/tag/1.4-alpha1/docs/HISTORY.txt kukit/kss.concatresource/tag/1.4-alpha1/kss/concatresource/version.txt kukit/kss.concatresource/tag/1.4-alpha1/setup.py Log: Set release Modified: kukit/kss.concatresource/tag/1.4-alpha1/docs/HISTORY.txt ============================================================================== --- kukit/kss.concatresource/tag/1.4-alpha1/docs/HISTORY.txt (original) +++ kukit/kss.concatresource/tag/1.4-alpha1/docs/HISTORY.txt Sun Mar 9 08:50:12 2008 @@ -2,9 +2,10 @@ (name of developer listed in brackets) -kss.concatresource - 1.4dev Unreleased +kss.concatresource - 1.4-alpha1 Released 2008-03-09 - - ... + - Prepare for release + [ree] kss.concatresource - 1.2 Released 2007-08-17 Modified: kukit/kss.concatresource/tag/1.4-alpha1/kss/concatresource/version.txt ============================================================================== --- kukit/kss.concatresource/tag/1.4-alpha1/kss/concatresource/version.txt (original) +++ kukit/kss.concatresource/tag/1.4-alpha1/kss/concatresource/version.txt Sun Mar 9 08:50:12 2008 @@ -1 +1 @@ -1.4dev Unreleased +1.4-alpha1 Released 2008-03-09 Deleted: /kukit/kss.concatresource/tag/1.4-alpha1/setup.cfg ============================================================================== --- /kukit/kss.concatresource/tag/1.4-alpha1/setup.cfg Sun Mar 9 08:50:12 2008 +++ (empty file) @@ -1,3 +0,0 @@ -[egg_info] -tag_build = dev -tag_svn_revision = true Modified: kukit/kss.concatresource/tag/1.4-alpha1/setup.py ============================================================================== --- kukit/kss.concatresource/tag/1.4-alpha1/setup.py (original) +++ kukit/kss.concatresource/tag/1.4-alpha1/setup.py Sun Mar 9 08:50:12 2008 @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '1.4' +version = '1.4-alpha1' setup(name='concatresource', version=version, From reebalazs at codespeak.net Sun Mar 9 08:51:20 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 08:51:20 +0100 (CET) Subject: [KSS-checkins] r52319 - kukit/kss.concatresource/branch/1.4/docs Message-ID: <20080309075120.6BF9416844D@codespeak.net> Author: reebalazs Date: Sun Mar 9 08:51:19 2008 New Revision: 52319 Modified: kukit/kss.concatresource/branch/1.4/docs/HISTORY.txt Log: Adjust history Modified: kukit/kss.concatresource/branch/1.4/docs/HISTORY.txt ============================================================================== --- kukit/kss.concatresource/branch/1.4/docs/HISTORY.txt (original) +++ kukit/kss.concatresource/branch/1.4/docs/HISTORY.txt Sun Mar 9 08:51:19 2008 @@ -6,6 +6,11 @@ - ... +kss.concatresource - 1.4-alpha1 Released 2008-03-09 + + - Prepare for release + [ree] + kss.concatresource - 1.2 Released 2007-08-17 - Change ;;; rendering in devel mode From reebalazs at codespeak.net Sun Mar 9 08:53:39 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 08:53:39 +0100 (CET) Subject: [KSS-checkins] r52320 - in kukit/kukit.js/tag/1.4-alpha1: . doc Message-ID: <20080309075339.7634216844D@codespeak.net> Author: reebalazs Date: Sun Mar 9 08:53:39 2008 New Revision: 52320 Modified: kukit/kukit.js/tag/1.4-alpha1/doc/HISTORY.txt kukit/kukit.js/tag/1.4-alpha1/version.txt Log: Set release Modified: kukit/kukit.js/tag/1.4-alpha1/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/tag/1.4-alpha1/doc/HISTORY.txt (original) +++ kukit/kukit.js/tag/1.4-alpha1/doc/HISTORY.txt Sun Mar 9 08:53:39 2008 @@ -2,9 +2,7 @@ (name of developer listed in brackets) -kukit.js - 1.4dev Unreleased - - - ... +kukit.js - 1.4-alpha1 Released 2008-03-09 - refactor the value provider registry to use a single registry in place of 3. Modified: kukit/kukit.js/tag/1.4-alpha1/version.txt ============================================================================== --- kukit/kukit.js/tag/1.4-alpha1/version.txt (original) +++ kukit/kukit.js/tag/1.4-alpha1/version.txt Sun Mar 9 08:53:39 2008 @@ -1 +1 @@ -1.4dev unreleased +1.4-alpha1 Released 2008-03-09 From reebalazs at codespeak.net Sun Mar 9 08:54:22 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 08:54:22 +0100 (CET) Subject: [KSS-checkins] r52321 - kukit/kukit.js/branch/1.4/doc Message-ID: <20080309075422.8D03D16844D@codespeak.net> Author: reebalazs Date: Sun Mar 9 08:54:21 2008 New Revision: 52321 Modified: kukit/kukit.js/branch/1.4/doc/HISTORY.txt Log: Adjust history Modified: kukit/kukit.js/branch/1.4/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/branch/1.4/doc/HISTORY.txt (original) +++ kukit/kukit.js/branch/1.4/doc/HISTORY.txt Sun Mar 9 08:54:21 2008 @@ -5,6 +5,8 @@ kukit.js - 1.4dev Unreleased - ... + +kuki.js - 1.4-alpha1 Released 2008-03-09 - refactor the value provider registry to use a single registry in place of 3. From reebalazs at codespeak.net Sun Mar 9 08:58:42 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 08:58:42 +0100 (CET) Subject: [KSS-checkins] r52322 - in kukit/kss.core/tag/1.4-alpha1: . docs kss/core kss/core/pluginregistry Message-ID: <20080309075842.8866116842C@codespeak.net> Author: reebalazs Date: Sun Mar 9 08:58:42 2008 New Revision: 52322 Removed: kukit/kss.core/tag/1.4-alpha1/setup.cfg Modified: kukit/kss.core/tag/1.4-alpha1/docs/HISTORY.txt kukit/kss.core/tag/1.4-alpha1/kss/core/ (props changed) kukit/kss.core/tag/1.4-alpha1/kss/core/EXTERNALS.TXT kukit/kss.core/tag/1.4-alpha1/kss/core/pluginregistry/ (props changed) kukit/kss.core/tag/1.4-alpha1/kss/core/pluginregistry/EXTERNALS.TXT kukit/kss.core/tag/1.4-alpha1/kss/core/version.txt kukit/kss.core/tag/1.4-alpha1/setup.py Log: Set release Modified: kukit/kss.core/tag/1.4-alpha1/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/tag/1.4-alpha1/docs/HISTORY.txt (original) +++ kukit/kss.core/tag/1.4-alpha1/docs/HISTORY.txt Sun Mar 9 08:58:42 2008 @@ -2,9 +2,7 @@ (name of developer listed in brackets) -kss.core - 1.4dev Unreleased - - - ... +kss.core - 1.4-alpha1 Released 2008-03-09 - refactor the value provider registry to use a single registry in place of 3. Modified: kukit/kss.core/tag/1.4-alpha1/kss/core/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/tag/1.4-alpha1/kss/core/EXTERNALS.TXT (original) +++ kukit/kss.core/tag/1.4-alpha1/kss/core/EXTERNALS.TXT Sun Mar 9 08:58:42 2008 @@ -5,4 +5,4 @@ # You can update your working dir by: # svn propset svn:externals -F EXTERNALS.TXT . # -kukit http://codespeak.net/svn/kukit/kukit.js/branch/1.4/ +kukit http://codespeak.net/svn/kukit/kukit.js/trunk/1.4-alpha1/ Modified: kukit/kss.core/tag/1.4-alpha1/kss/core/pluginregistry/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/tag/1.4-alpha1/kss/core/pluginregistry/EXTERNALS.TXT (original) +++ kukit/kss.core/tag/1.4-alpha1/kss/core/pluginregistry/EXTERNALS.TXT Sun Mar 9 08:58:42 2008 @@ -7,4 +7,4 @@ # # concatresource is now included like as batteries -_concatresource https://codespeak.net/svn/kukit/kss.concatresource/branch/1.4/kss/concatresource +_concatresource https://codespeak.net/svn/kukit/kss.concatresource/tag/1.4-alpha1/kss/concatresource Modified: kukit/kss.core/tag/1.4-alpha1/kss/core/version.txt ============================================================================== --- kukit/kss.core/tag/1.4-alpha1/kss/core/version.txt (original) +++ kukit/kss.core/tag/1.4-alpha1/kss/core/version.txt Sun Mar 9 08:58:42 2008 @@ -1 +1 @@ -1.4dev unreleased +1.4-alpha1 Released 2008-03-09 Deleted: /kukit/kss.core/tag/1.4-alpha1/setup.cfg ============================================================================== --- /kukit/kss.core/tag/1.4-alpha1/setup.cfg Sun Mar 9 08:58:42 2008 +++ (empty file) @@ -1,3 +0,0 @@ -[egg_info] -tag_build = dev -tag_svn_revision = true Modified: kukit/kss.core/tag/1.4-alpha1/setup.py ============================================================================== --- kukit/kss.core/tag/1.4-alpha1/setup.py (original) +++ kukit/kss.core/tag/1.4-alpha1/setup.py Sun Mar 9 08:58:42 2008 @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import sys, os -version = '1.4' +version = '1.4-alpha1' setup(name='kss.core', version=version, From reebalazs at codespeak.net Sun Mar 9 09:01:33 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 09:01:33 +0100 (CET) Subject: [KSS-checkins] r52323 - kukit/kss.core/tag/1.4-alpha1/kss/core Message-ID: <20080309080133.A6C8916842C@codespeak.net> Author: reebalazs Date: Sun Mar 9 09:01:32 2008 New Revision: 52323 Modified: kukit/kss.core/tag/1.4-alpha1/kss/core/ (props changed) kukit/kss.core/tag/1.4-alpha1/kss/core/EXTERNALS.TXT Log: Set release (fix) Modified: kukit/kss.core/tag/1.4-alpha1/kss/core/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/tag/1.4-alpha1/kss/core/EXTERNALS.TXT (original) +++ kukit/kss.core/tag/1.4-alpha1/kss/core/EXTERNALS.TXT Sun Mar 9 09:01:32 2008 @@ -5,4 +5,4 @@ # You can update your working dir by: # svn propset svn:externals -F EXTERNALS.TXT . # -kukit http://codespeak.net/svn/kukit/kukit.js/trunk/1.4-alpha1/ +kukit http://codespeak.net/svn/kukit/kukit.js/tag/1.4-alpha1/ From reebalazs at codespeak.net Sun Mar 9 09:16:29 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 09:16:29 +0100 (CET) Subject: [KSS-checkins] r52324 - kukit/kss.core/branch/1.4/docs Message-ID: <20080309081629.53C4D168437@codespeak.net> Author: reebalazs Date: Sun Mar 9 09:16:28 2008 New Revision: 52324 Modified: kukit/kss.core/branch/1.4/docs/HISTORY.txt Log: Adjust history Modified: kukit/kss.core/branch/1.4/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/branch/1.4/docs/HISTORY.txt (original) +++ kukit/kss.core/branch/1.4/docs/HISTORY.txt Sun Mar 9 09:16:28 2008 @@ -6,6 +6,8 @@ - ... +kss.core - 1.4-alpha1 Released 2008-03-09 + - refactor the value provider registry to use a single registry in place of 3. This will enable to define value From reebalazs at codespeak.net Sun Mar 9 09:18:23 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 09:18:23 +0100 (CET) Subject: [KSS-checkins] r52325 - in kukit/kss.demo/tag/1.4-alpha1: . docs kss/demo Message-ID: <20080309081823.F00E816843A@codespeak.net> Author: reebalazs Date: Sun Mar 9 09:18:18 2008 New Revision: 52325 Removed: kukit/kss.demo/tag/1.4-alpha1/setup.cfg Modified: kukit/kss.demo/tag/1.4-alpha1/docs/HISTORY.txt kukit/kss.demo/tag/1.4-alpha1/kss/demo/version.txt kukit/kss.demo/tag/1.4-alpha1/setup.py Log: Set release Modified: kukit/kss.demo/tag/1.4-alpha1/docs/HISTORY.txt ============================================================================== --- kukit/kss.demo/tag/1.4-alpha1/docs/HISTORY.txt (original) +++ kukit/kss.demo/tag/1.4-alpha1/docs/HISTORY.txt Sun Mar 9 09:18:18 2008 @@ -2,9 +2,7 @@ (name of developer listed in brackets) -kss.demo - 1.4dev Unreleased - - - ... +kss.demo - 1.4-alpha1 Released 2008-03-09 - Use develui.css (style is inline with kssproject.org). [gotcha] Modified: kukit/kss.demo/tag/1.4-alpha1/kss/demo/version.txt ============================================================================== --- kukit/kss.demo/tag/1.4-alpha1/kss/demo/version.txt (original) +++ kukit/kss.demo/tag/1.4-alpha1/kss/demo/version.txt Sun Mar 9 09:18:18 2008 @@ -1 +1 @@ -1.4dev Unreleased +1.4-alpha1 Released 2008-03-09 Deleted: /kukit/kss.demo/tag/1.4-alpha1/setup.cfg ============================================================================== --- /kukit/kss.demo/tag/1.4-alpha1/setup.cfg Sun Mar 9 09:18:18 2008 +++ (empty file) @@ -1,3 +0,0 @@ -[egg_info] -tag_build = dev -tag_svn_revision = true Modified: kukit/kss.demo/tag/1.4-alpha1/setup.py ============================================================================== --- kukit/kss.demo/tag/1.4-alpha1/setup.py (original) +++ kukit/kss.demo/tag/1.4-alpha1/setup.py Sun Mar 9 09:18:18 2008 @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import sys, os -version = '1.4' +version = '1.4-alpha1' setup(name='kss.demo', version=version, @@ -27,12 +27,11 @@ install_requires=[ # -*- Extra requirements: -*- 'setuptools', - 'kss.core>=dev', + 'kss.core==1.4-alpha1', ], entry_points=""" # -*- Entry points: -*- """, dependency_links=[ - 'https://codespeak.net/svn/kukit/kss.core/branch/1.4#egg=kss.core-dev', ], ) From reebalazs at codespeak.net Sun Mar 9 09:18:56 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 09:18:56 +0100 (CET) Subject: [KSS-checkins] r52326 - kukit/kss.demo/branch/1.4/docs Message-ID: <20080309081856.C8BCD16843A@codespeak.net> Author: reebalazs Date: Sun Mar 9 09:18:56 2008 New Revision: 52326 Modified: kukit/kss.demo/branch/1.4/docs/HISTORY.txt Log: Adjust history Modified: kukit/kss.demo/branch/1.4/docs/HISTORY.txt ============================================================================== --- kukit/kss.demo/branch/1.4/docs/HISTORY.txt (original) +++ kukit/kss.demo/branch/1.4/docs/HISTORY.txt Sun Mar 9 09:18:56 2008 @@ -6,6 +6,8 @@ - ... +kss.demo - 1.4-alpha1 Released 2008-03-09 + - Use develui.css (style is inline with kssproject.org). [gotcha] From reebalazs at codespeak.net Sun Mar 9 14:23:40 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 14:23:40 +0100 (CET) Subject: [KSS-checkins] r52331 - kukit/kss.core/trunk/docs Message-ID: <20080309132340.3437B168422@codespeak.net> Author: reebalazs Date: Sun Mar 9 14:23:38 2008 New Revision: 52331 Added: kukit/kss.core/trunk/docs/NEWS.txt Log: Add what's new in 1.4 Added: kukit/kss.core/trunk/docs/NEWS.txt ============================================================================== --- (empty file) +++ kukit/kss.core/trunk/docs/NEWS.txt Sun Mar 9 14:23:38 2008 @@ -0,0 +1,104 @@ + + +New in kss 1.4 +-------------- + +- Major code refactoring, for better readibility and speedups. + +- Lots and lots of ecma unittests and selenium tests that test kss.core + and the core plugin, are added. All are checkable from a single click + from any browser. + +- Base2 is used for css selection, instead of the original cssQuery (if + present). Significantly faster page load. + +- multiple selectors in the same rule are allowed, ie.:: + + selector1:click selector2:click { ... } + + or even:: + + selector1:keyup selector2:keydown { ... } + +- Value providers can be recursive, ie.:: + + nodeAttr(kssAttr(blah)) + + is allowed. + +- added url() special value provider, the first is alternate syntax for:: + + action-server: blah; + blah-kssUrl: "http://foo.bar/blahblah"; + + you can now say in one line:: + + action-server: blah url(http://foo.bar/blahblah); + + This may be handy if you want to call @@ url-s. + +- added alias() special value provider, this enables using more client + actions on the same node:: + + action-client: setAttribute; + setAttribute-key: foo; + setAttribute-value: bar; + action-client: setAttribute alias(other); + other-key: foo2; + other-value: bar2; + +- enable node selection in the same line as the action specification, ie. + instead of:: + + action-client: foo; + foo-kssSelector: css(div.klass); + + you can also say:: + + action-client: foo css(div.klass); + +- enable full form submits in the same line as the action specification, + ie. instead of:: + + action-server: foo; + foo-kssSubmitForm: currentForm(); + + you can also say:: + + action-server: foo currentForm(); + +- Value providers can be used also in the "event binder id", eg. + instead of the static binder id:: + + xxxxx:click(blah) { ... } + + a dynamic binder id can also be used:: + + xxxxx:click(kssAttr(blah)) { ... } + + This feature is needed for upcoming use cases like drag and drop. + +- Remove previously deprecated form() and + currentForm() value providers from normal + action parameters (remark: they should now + be used with xxx-kssSelector or directly on the action-client line as + described above, and they properly support Zope multiform + fields like :list, :record, :records.) + +- Demos and selenium tests are removed from kss.demo and are now placed + together with the plugin in kss.core. This means, all 3rdparty plugins + should now have a zope-only demo page with a selenium test, if the + plugin is loaded the demo appears in the index and the test is run + together with all tests. (Demos can be viewed and tested by kss.demo.) + We also have kss.template that creates a skeleton kss plugin with + all bells and whistles. + +- Implement loglevels based on cookies (also backported to 1.2.) + +- Other fixes (also backported to 1.2):: + + - Fix error fallback handling + + - Fix multiple selection form fields marshalling on Safari and IE + + From reebalazs at codespeak.net Sun Mar 9 14:25:00 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Mar 2008 14:25:00 +0100 (CET) Subject: [KSS-checkins] r52332 - kukit/kss.core/branch/1.4/docs Message-ID: <20080309132500.DC5C4168422@codespeak.net> Author: reebalazs Date: Sun Mar 9 14:25:00 2008 New Revision: 52332 Added: kukit/kss.core/branch/1.4/docs/NEWS.txt - copied unchanged from r52331, kukit/kss.core/trunk/docs/NEWS.txt Log: Backport -r52231 from trunk: Add what's new in 1.4 From jvloothuis at codespeak.net Tue Mar 11 21:45:11 2008 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 11 Mar 2008 21:45:11 +0100 (CET) Subject: [KSS-checkins] r52397 - kukit/kss.core/branch/kss.core-on-kss.zope Message-ID: <20080311204511.44FBE169E2B@codespeak.net> Author: jvloothuis Date: Tue Mar 11 21:45:08 2008 New Revision: 52397 Added: kukit/kss.core/branch/kss.core-on-kss.zope/ Log: New package for the kss.core compat layer From jvloothuis at codespeak.net Tue Mar 11 21:48:00 2008 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 11 Mar 2008 21:48:00 +0100 (CET) Subject: [KSS-checkins] r52398 - kukit/buildout/kss.zope/transition Message-ID: <20080311204800.55B0D168414@codespeak.net> Author: jvloothuis Date: Tue Mar 11 21:47:59 2008 New Revision: 52398 Modified: kukit/buildout/kss.zope/transition/ (props changed) kukit/buildout/kss.zope/transition/EXTERNALS.txt Log: Added kss.core Modified: kukit/buildout/kss.zope/transition/EXTERNALS.txt ============================================================================== --- kukit/buildout/kss.zope/transition/EXTERNALS.txt (original) +++ kukit/buildout/kss.zope/transition/EXTERNALS.txt Tue Mar 11 21:47:59 2008 @@ -2,3 +2,4 @@ kss.base https://codespeak.net/svn/kukit/kss.base/trunk # kss.demo is branched mainly to not depend on kss.core egg: kss.demo https://codespeak.net/svn/kukit/kss.demo/branch/kss-zope-transition +kss.core https://codespeak.net/svn/kukit/kss.core/branch/kss.core-on-kss.zope From jvloothuis at codespeak.net Tue Mar 11 22:19:08 2008 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 11 Mar 2008 22:19:08 +0100 (CET) Subject: [KSS-checkins] r52399 - in kukit: kss.core/branch/kss.core-on-kss.zope kss.core/branch/kss.core-on-kss.zope/src kss.core/branch/kss.core-on-kss.zope/src/kss kss.core/branch/kss.core-on-kss.zope/src/kss/core kss.zope/trunk/kss/core kss.zope/trunk/kss/core_future Message-ID: <20080311211908.B0BFA169E0A@codespeak.net> Author: jvloothuis Date: Tue Mar 11 22:19:06 2008 New Revision: 52399 Added: kukit/kss.core/branch/kss.core-on-kss.zope/setup.py - copied, changed from r52397, kukit/kss.zope/trunk/setup.py kukit/kss.core/branch/kss.core-on-kss.zope/src/ kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/ kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/__init__.py - copied unchanged from r52397, kukit/kss.zope/trunk/kss/__init__.py kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/ - copied from r52397, kukit/kss.zope/trunk/kss/core/ Removed: kukit/kss.zope/trunk/kss/core/ kukit/kss.zope/trunk/kss/core_future/ Log: Splitted the kss.core compatibility layer off into a seperate package Copied: kukit/kss.core/branch/kss.core-on-kss.zope/setup.py (from r52397, kukit/kss.zope/trunk/setup.py) ============================================================================== --- kukit/kss.zope/trunk/setup.py (original) +++ kukit/kss.core/branch/kss.core-on-kss.zope/setup.py Tue Mar 11 22:19:06 2008 @@ -1,15 +1,14 @@ from setuptools import setup, find_packages from textwrap import dedent -version = '1.4' +version = '2.0' setup( - name = 'kss.zope', + name = 'kss.core', version = version, description = "KSS (Kinetic Style Sheets) core framework", long_description = dedent("""\ """), - # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers classifiers = [ "Framework :: Zope2", "Framework :: Zope3", @@ -21,12 +20,13 @@ author_email = 'kss-devel at codespeak.net', url = 'http://kssproject.org', license = 'GPL', - packages = find_packages(exclude=['ez_setup']), - namespace_packages = ['kss'], + package_dir={'': 'src'}, + packages=find_packages('src'), + namespace_packages=['kss'], include_package_data = True, zip_safe = False, install_requires = [ - 'kss.base>=dev', + 'kss.zope>=dev', 'setuptools', ], entry_points={ From jvloothuis at codespeak.net Tue Mar 11 23:03:54 2008 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 11 Mar 2008 23:03:54 +0100 (CET) Subject: [KSS-checkins] r52402 - in kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core: . tests Message-ID: <20080311220354.85EAA169E0A@codespeak.net> Author: jvloothuis Date: Tue Mar 11 23:03:53 2008 New Revision: 52402 Added: kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/siteview.txt - copied unchanged from r52396, kukit/kss.core/trunk/kss/core/siteview.txt Modified: kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/kssview.py kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/meta.zcml kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/tests/configure-unittest.zcml Log: Started to make as much tests for the kss.core compatibility layer work The meta.zcml now includes the meta.zcml from kss.zope, this makes sure this is always loaded Readded the siteview test. This is a duplicate of the one in kss.zope but since the old kss.core had it the first version of kss.core should have it as well (to maximize coverage). Modified: kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/kssview.py ============================================================================== --- kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/kssview.py (original) +++ kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/kssview.py Tue Mar 11 23:03:53 2008 @@ -15,7 +15,11 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. -from kss.zope.view import KSSView +from kss.zope.view import KSSView, SiteView from kss.zope.commandset import ZopeCommandSet as CommandSet AzaxBaseView = KSSView + +# Pyflakes +SiteView +CommandSet Modified: kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/meta.zcml ============================================================================== --- kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/meta.zcml (original) +++ kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/meta.zcml Tue Mar 11 23:03:53 2008 @@ -1,8 +1,6 @@ - + Modified: kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/tests/configure-unittest.zcml ============================================================================== --- kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/tests/configure-unittest.zcml (original) +++ kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/tests/configure-unittest.zcml Tue Mar 11 23:03:53 2008 @@ -3,17 +3,6 @@ xmlns:five="http://namespaces.zope.org/five" xmlns:zcml="http://namespaces.zope.org/zcml" > - - - -