From kukit-checkins at codespeak.net Sat Nov 3 02:09:00 2007 From: kukit-checkins at codespeak.net (VIAGRA ® Official Site) Date: Sat, 3 Nov 2007 02:09:00 +0100 (CET) Subject: [KSS-checkins] November 77% OFF Message-ID: <20071103070927.11683.qmail@ppp85-141-206-63.pppoe.mtu-net.ru> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20071103/c17d8da5/attachment.htm From reebalazs at codespeak.net Mon Nov 5 09:15:30 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 5 Nov 2007 09:15:30 +0100 (CET) Subject: [KSS-checkins] r48304 - kukit/KssTheme/trunk/skins/ksstheme_images Message-ID: <20071105081530.C21368146@code0.codespeak.net> Author: reebalazs Date: Mon Nov 5 09:15:29 2007 New Revision: 48304 Added: kukit/KssTheme/trunk/skins/ksstheme_images/favicon.ico (contents, props changed) Log: Adding favicon Added: kukit/KssTheme/trunk/skins/ksstheme_images/favicon.ico ============================================================================== Binary file. No diff available. From reebalazs at codespeak.net Mon Nov 5 19:20:29 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 5 Nov 2007 19:20:29 +0100 (CET) Subject: [KSS-checkins] r48324 - kukit/kss.buildout/trunk/src/kss.recipe.checkjavaversion/src/kss/recipe/checkjavaversion Message-ID: <20071105182029.F2CAA81C7@code0.codespeak.net> Author: reebalazs Date: Mon Nov 5 19:20:28 2007 New Revision: 48324 Modified: kukit/kss.buildout/trunk/src/kss.recipe.checkjavaversion/src/kss/recipe/checkjavaversion/__init__.py Log: Fix borken recipee at two points: - version must be checked against none, obj <= None comparision throws exception. - when runnning java --version, stdout must be checked (for compatibility I also still check stderr, but I have no idea what evil app may have outputted to stderr its version string, originally.) Modified: kukit/kss.buildout/trunk/src/kss.recipe.checkjavaversion/src/kss/recipe/checkjavaversion/__init__.py ============================================================================== --- kukit/kss.buildout/trunk/src/kss.recipe.checkjavaversion/src/kss/recipe/checkjavaversion/__init__.py (original) +++ kukit/kss.buildout/trunk/src/kss.recipe.checkjavaversion/src/kss/recipe/checkjavaversion/__init__.py Mon Nov 5 19:20:28 2007 @@ -16,12 +16,17 @@ location = options['location'] required = LooseVersion(options.get('javaversion', '0')) installed = self.getInstalledJavaVersion() - assert (required <= installed), "Installed Java version (%s) less than required (%s)" % (installed, required) + # We have to check for installed = None, because otherwise we'd get an error. + assert (installed is not None and required <= installed), "Installed Java version (%s) less than required (%s)" % (installed, required) return location def getInstalledJavaVersion(self): stdin, stdout, stderr = os.popen3('java -version') + # XXX, is there any java version that outputs to stderr instead of stdout??? line = stderr.readline() + # We have to check stdout too + if not line: + line = stdout.readline() results = re.search('"([._0-9]+)"', line) if results: version = LooseVersion(results.group(1)) From kukit-checkins at codespeak.net Tue Nov 6 11:33:53 2007 From: kukit-checkins at codespeak.net (VIAGRA ® Official Site) Date: Tue, 6 Nov 2007 11:33:53 +0100 (CET) Subject: [KSS-checkins] November 72% OFF Message-ID: <20071106143347.14141.qmail@byfly.86.57.209.43.grodno.by> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20071106/88734a75/attachment.htm From kukit-checkins at codespeak.net Tue Nov 6 14:39:23 2007 From: kukit-checkins at codespeak.net (VIAGRA ® Official Site) Date: Tue, 6 Nov 2007 14:39:23 +0100 (CET) Subject: [KSS-checkins] November 73% OFF Message-ID: <20071106153918.3099.qmail@ppp-124.120.166.237.revip2.asianet.co.th> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20071106/0bc581d8/attachment.htm From jvloothuis at codespeak.net Tue Nov 6 20:33:38 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 6 Nov 2007 20:33:38 +0100 (CET) Subject: [KSS-checkins] r48342 - kukit/buildout/kss.zope Message-ID: <20071106193338.9FFAA81CF@code0.codespeak.net> Author: jvloothuis Date: Tue Nov 6 20:33:37 2007 New Revision: 48342 Added: kukit/buildout/kss.zope/ Log: buildout setup for testing kss.zope inside plone From jvloothuis at codespeak.net Tue Nov 6 20:36:44 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 6 Nov 2007 20:36:44 +0100 (CET) Subject: [KSS-checkins] r48343 - in kukit/buildout/kss.zope: . src var Message-ID: <20071106193644.8583C8221@code0.codespeak.net> Author: jvloothuis Date: Tue Nov 6 20:36:43 2007 New Revision: 48343 Added: kukit/buildout/kss.zope/EXTERNALS.txt kukit/buildout/kss.zope/README.txt kukit/buildout/kss.zope/WINDOWS.txt kukit/buildout/kss.zope/base.cfg kukit/buildout/kss.zope/bootstrap.py kukit/buildout/kss.zope/buildout.cfg kukit/buildout/kss.zope/default.cfg.sample kukit/buildout/kss.zope/devel.cfg kukit/buildout/kss.zope/src/ (props changed) kukit/buildout/kss.zope/src/EXTERNALS.txt kukit/buildout/kss.zope/var/ Modified: kukit/buildout/kss.zope/ (props changed) Log: Simple fork of ploneout to accomodate the new kss.zope package Added: kukit/buildout/kss.zope/EXTERNALS.txt ============================================================================== --- (empty file) +++ kukit/buildout/kss.zope/EXTERNALS.txt Tue Nov 6 20:36:43 2007 @@ -0,0 +1,5 @@ +# +# created by: svn propset svn:externals -F ./EXTERNALS.txt . +# + +products https://svn.plone.org/svn/plone/bundles/trunk Added: kukit/buildout/kss.zope/README.txt ============================================================================== --- (empty file) +++ kukit/buildout/kss.zope/README.txt Tue Nov 6 20:36:43 2007 @@ -0,0 +1,225 @@ +======== +ploneout +======== + +by Hanno Schlichting, Martin Aspeli et. al. + +'ploneout' is a "buildout" for Zope 2 and Plone. It helps you set up a +Zope 2.10 instance, with Plone 3 installed. You can also use it as a starting +point for your own projects, creating your own "buildout" to manage your +particular packages and configuration. + +Additional requirements +----------------------- + +You need to have an unrestricted internet access for the first time you build +your environment. Otherwise you might get some rather cryptic errors in urllib2, +which suggest that it couldn't download some of the required tarballs. + +The only Plone dependency besides Python itself, that is not currently tracked +with ploneout is the Python Imaging Library (PIL). As it requires a lot of +secondary development libraries to be installed on your system in order to be +able to compile the Python C extensions, you better use your OS specific +package management tools to install it. + +For a list of available Windows installers, have a look at +http://effbot.org/downloads/#PIL. If you are on a Mac using MacPorts you can +use "sudo port install py-pil" if you use the MacPorts provided Python as a base +for your ploneout. + +Optional preparations +--------------------- + +Buildout supports setting some variables per logged in user instead of per +buildout environment. This is useful to share all downloaded eggs and tarballs +for all environments for example, instead of having to download those for every +environment. If you want to reuse any eggs or tarballs create a directory +called '.buildout' in your $HOME folder. In this directory create a file called +'default.cfg' and put the following lines in their or copy the +default.cfg.sample file and adjust the paths to your environment: + + [buildout] + eggs-directory = /some/folder/for/eggs + download-directory = /some/folder/for/downloads + download-cache = /some/folder/for/downloads + +Make sure to adjust those paths to something you like and have access to and +create those folders. If you don't want to share any eggs or downloads you can +ignore this whole step. + +How do I use it? +---------------- + +Run the following command from the ploneout directory: + + $ python bootstrap.py + +This creates a few directories used by buildout. Then run: + + $ bin/buildout -v + +The -v isn't necessary, but may make you feel better in the knowledge that +a lot is going on. + +This will take a long time and use up to 200Mb of disk space. It will: + + - Create the 'parts' directory + - Create a directory var where your Data.fs will live. + - Download a Zope 2 tarball into parts/zope2. + - Build Zope 2, using 'setup.py build_ext -i' + - Build a Zope 2 instance in parts/instance + - Install Plone 3's products and eggs into the Zope 2 instance + +If you've done this once, you can speed up the process by running + + $ bin/buildout -o + +This tells buildout that you do not want it to go online and check for updates. + +To start Zope 2, you can now do: + + $ bin/instance fg + +If you wish to have an interactive python prompt that has all the packages +Zope is aware of, e.g. for testing purposes, you can run: + + $ bin/zopepy + +What's going on? +---------------- + +'ploneout' uses 'zc.buildout'. You can read more about zc.buildout on its +pypi page: http://python.org/pypi/zc.buildout + +In brief, buildout depends on two things: + + - Python eggs with entry points that define "recipes" + - A buildout.cfg file that pieces together these recipes into a script + +When you run bin/buildout, it parses buildout.cfg. Let's look at that file: + + [buildout] + ... + + parts = + zope2 + instance + zopepy + + find-links = + http://download.zope.org/distribution/ + http://effbot.org/downloads + + eggs = + elementtree + python-yadis + python-openid + python-urljr + + develop = + src/kss.core + src/plone.app.contentmenu + ... + + [zope2] + recipe = z2c.recipe.zope2install + url = http://www.zope.org/Products/Zope/2.10.2/Zope-2.10.2.tgz + + [instance] + recipe = z2c.recipe.zope2instance + zope2-location = ${zope2:location} + user = admin:admin + eggs = + ${buildout:eggs} + archetypes.kss + kss.core + ... + + products = + ${buildout:directory}/products + + [zopepy] + recipe = zc.recipe.egg + eggs = ${instance:eggs} + interpreter = zopepy + extra-paths = ${zope2:location}/lib/python + scripts = zopepy + +The main section is '[buildout]', which defines the 'parts' that will make up +this buildout, in the order that they will be executed. It also specifies a +number of eggs that should be installed within the self-contained python +environment that buildout creates (these will be downloaded from pypi as +necessary) in the 'eggs' parameter, as well as a list of eggs that are +actually bundled with the buildout (found in the src/) directory, in the +'develop' parameter. The development eggs need to have the conventional egg +file system layout and egg info. There is also a list of URLs under +'find-links', which helps buildout download eggs not found in the standard +pypi repository. + +The first part is 'zope2', and you will see the corresponding definition in +the '[zope2]' section. This, like all sections, first defines the 'recipe' +that should be used. The recipe is the name of an egg, which will be +downloaded from pypi if possible. It could also come from the eggs listed +under 'develop'. + +After the recipe definition, each part may have a number of options. Here is +what happens: + + 1. The zope2 part uses the z2c.recipe.zope2install recipe. This egg, by + way of an entry point, will execute some Python code that downloads a + Zope 2 release tarball on the URL specified in the 'url' parameter, and + puts it in 'parts/zope2'. + + 2. Next the instance part is executed, using z2c.recipe.zope2instance. This + creates a Zope 2 instance from the Zope 2 download created with the zope2 + part, and patches its etc/zope.conf file a little. There are a number of + parameters in play: + + zope2-location -- specifies the Zope checkout or extracted tarball which + should be used to create the instance. You can use the one checked out by + the z2c.recipe.zope2install or use one already found on your system. + + user -- sets the username and password for the root Zope user + + debug-mode -- Set to 'off' if you don't want to use debug mode + (recommended for production servers) + + verbose-security -- Set to 'on' to turn on verbose security settings. + Again, this is not recommended for production servers. This has the side + effect of setting "security-policy-implementation python" + + eggs -- lists a number of eggs that will be available at runtime when + Zope is started up. + + products -- specifies the directories which will house the products for + the instance. zope.conf is patched so that Zope does not only look for + products under $INSTANCE_HOME/products, but also in these directories. + One additional directory is found at the root of the buildout. This is + done so that the instance can be re-created from scratch more easily. + + 3. Finally, the zopepy part sets up a custom python interpreter (or rather, + a script which launches Python with the correct paths set) which will have + available the various packages that buildout prepares for Zope. This is + useful for testing. + +How do I use this for my own projects? +-------------------------------------- + +It is not terribly difficult to write new recipes (especially if you can learn +by example), and it's easier still to write your own buildout.cfg files. To +simple use 'ploneout' for your own projects, though, all you should need +to do is: + + - copy the whole of ploneout to a new directory, probably with a different + name + + - create your own eggs in 'src/'. You may want to use PasteScript and + ZopeSkel for this. See http://plone.org/documentation/how-to/use-paster + + - edit buildout.cfg to list your eggs and set any project-specific options + +Then you simply run bootstrap.py and bin/buildout as above. You can re-run +bin/buildout when your configuration changes to re-configure your buildout. + +The advantage of this, of course, is that you can then replicate your own +buildout across different machines (e.g. to a server or between developers). Added: kukit/buildout/kss.zope/WINDOWS.txt ============================================================================== --- (empty file) +++ kukit/buildout/kss.zope/WINDOWS.txt Tue Nov 6 20:36:43 2007 @@ -0,0 +1,138 @@ +=================== +Ploneout on Windows +=================== + +In order to get a working 'ploneout' environment for Plone 3.0 on Windows you +will need a fast internet connection all the time. We will need to download +several hundreds of megabytes the first time. This how-to will tell you all the +steps you need to take to go from a fresh Windows XP (other Windows versions +should work the same or similiar) to a full ploneout environment. If you +already have some of the tools described here installed, you can skip the +relevant sections. Make sure you read them nonetheless so you are certain +that you have indeed taken all the necessary steps. + +Python (http://www.python.org/) +------------------------------- + + - Download and install Python 2.4.4 using the Windows installer from + http://www.python.org/ftp/python/2.4.4/python-2.4.4.msi + Select 'Install for all users' and it will put Python into the + "C:\Python24" folder by default. + + - You also want the pywin32 extensions available from + http://downloads.sourceforge.net/pywin32/pywin32-210.win32-py2.4.exe?modtime=1159009237&big_mirror=0 + + - And as a last step you want to download the Python imaging library available + from http://effbot.org/downloads/PIL-1.1.6.win32-py2.4.exe + + - If you develop Zope based applications you will usually only need Python 2.4 + at the moment, so it's easiest to put the Python binary on the systems PATH, + so you don't need to specify its location manually each time you call it. + + Thus, put "C:\Python24" and "C:\Python24\Scripts" onto the PATH. You can + find the PATH definition in the control panel under system preferences on + the advanced tab at the bottom. The button is called environment variables. + You want to add it at the end of the already existing PATH in the system + section. Paths are separated by a semicolons. + + - You can test if this was successful by opening a new shell (cmd) and type + in 'python -V'. It should report version 2.4.4 (or whichever version you + installed). + + Opening a new shell can be done quickly by using the key combination + 'Windows-r' or if you are using Parallels on a Mac 'Apple-r'. Type in 'cmd' + into the popup box that opens up and hit enter. + + +Subversion (http://subversion.tigris.org) +----------------------------------------- + + - Download the nice installer from + http://subversion.tigris.org/files/documents/15/35379/svn-1.4.2-setup.exe + + - Run the installer. It defaults to installing into + "C:\Program Files\Subversion". + + - Now put the install locations bin subfolder (for example + "C:\Program Files\Subversion\bin") on your system PATH in the same way you + put Python on it. + + - Open a new shell again and type in: 'svn --version' it should report + version 1.4.2 or newer. + + +MinGW (http://www.mingw.org/) +----------------------------- + + This is a native port of the gcc compiler and its dependencies for Windows. + There are other approaches enabling you to compile Python C extensions on + Windows including Cygwin and using the official Microsoft C compiler, but this + is a lightweight approach that uses only freely available tools. As + it's used by a lot of people chances are high it will work for you and there's + plenty of documentation out there to help you in troubleshooting problems. + + - Download the MinGW installer from + http://downloads.sourceforge.net/mingw/MinGW-5.1.3.exe?modtime=1168794334&big_mirror=1 + + - The installer will ask you which options you would like to install. Choose + base and make here. It will install into "C:\MinGW" by default. The install + might take some time as it's getting files from sourceforge.net and you + might need to hit 'retry' a couple of times. + + - Now put the install location's bin subfolder (for example "C:\MinGW\bin") on + your system PATH in the same way you put Python on it. + + - Test this again by typing in: 'gcc --version' on a newly opened shell and + it should report version 3.4.2 or newer. + + +Configure Distutils to use MinGW +-------------------------------- + + Some general information are available from + http://www.mingw.org/MinGWiki/index.php/Python%20extensions for example but + you don't need to read them all. + + - Create a file called 'distutils.cfg' in "C:\Python24\Lib\distutils". Open it + with a text editor ('notepad distutils.cfg') and fill in the following lines: + + [build] + compiler=mingw32 + + This will tell distutils to use MinGW as the default compiler, so you don't + need to specify it manually using "--compiler=mingw32" while calling a + package's setup.py with a command that involves building C extensions. This + is extremely useful if the build command is written down in a buildout + recipe where you cannot change the options without hacking the recipe + itself. The z2c.recipe.zope2install used in ploneout is one such example. + + +Get ploneout +------------ + + - Create a new folder (for example "C:\plone"). This will host your + development environment and will need at least 300mb of free disk space. + + - Open a shell (cmd) and change into that folder ('cd c:\plone') + + - Checkout ploneout trunk for a development version for Plone 3. + This will take a long time, as it checks out all Plone products and eggs. + 'svn co https://svn.plone.org/svn/plone/ploneout/trunk plone30' + + If your connection gets interrupted you can resume the checkout by calling + 'svn up plone30'. + + +Bootstrap ploneout +------------------ + + - Change into the checked out folder ('cd plone30') and run + 'python bootstrap.py'. This will create a few folders and download + zc.buildout and setuptools from the CheeseShop. + + - Now you can type in 'bin\buildout -v' which will download a few tarballs + and configures your environment. This will take quite some time the first + time you run it. + + - Read the README.txt included in ploneout for more details about how you + can use it. Added: kukit/buildout/kss.zope/base.cfg ============================================================================== --- (empty file) +++ kukit/buildout/kss.zope/base.cfg Tue Nov 6 20:36:43 2007 @@ -0,0 +1,126 @@ +[buildout] + +find-links = + http://download.zope.org/ppix/ + http://download.zope.org/distribution/ + http://effbot.org/downloads + +eggs = + elementtree + python-gettext >= 0.6 + +develop = + src/Products.ATReferenceBrowserWidget + src/Products.CMFDynamicViewFTI + src/Products.CMFFormController + src/Products.CMFQuickInstallerTool + src/Products.PlacelessTranslationService + src/Products.PloneLanguageTool + src/Products.PlonePAS + src/Products.ResourceRegistries + src/Products.SecureMailHost + src/Products.statusmessages + src/archetypes.kss + src/kss.core + src/plone.app.contentmenu + src/plone.app.content + src/plone.app.contentrules + src/plone.app.controlpanel + src/plone.app.customerize + src/plone.app.form + src/plone.app.i18n + src/plone.app.iterate + src/plone.app.kss + src/plone.app.layout + src/plone.app.linkintegrity + src/plone.app.openid + src/plone.app.portlets + src/plone.app.redirector + src/plone.app.viewletmanager + src/plone.app.vocabularies + src/plone.app.workflow + src/plone.contentrules + src/plone.fieldsets + src/plone.i18n + src/plone.intelligenttext + src/plone.locking + src/plone.memoize + src/plone.openid + src/plone.portlets + src/plone.session + src/plone.theme + src/txtfilter + src/wicked + src/five.customerize + src/five.localsitemanager + + +[zope2] +recipe = plone.recipe.zope2install +# url = http://www.zope.org/Products/Zope/2.10.4/Zope-2.10.4-final.tgz +svn = svn://svn.zope.org/repos/main/Zope/trunk + + +[instance] +recipe = plone.recipe.zope2instance +zope2-location = ${zope2:location} +user = admin:admin +debug-mode = on +verbose-security = on +#http-address = 127.0.0.1:8080 +products = + ${buildout:directory}/products + +eggs = + ${buildout:eggs} + Products.ATReferenceBrowserWidget + Products.CMFDynamicViewFTI + Products.CMFFormController + Products.CMFQuickInstallerTool + Products.PlacelessTranslationService + Products.PloneLanguageTool + Products.PlonePAS + Products.ResourceRegistries + Products.SecureMailHost + Products.statusmessages + archetypes.kss + kss.core + plone.app.contentmenu + plone.app.content + plone.app.contentrules + plone.app.controlpanel + plone.app.customerize + plone.app.form + plone.app.i18n + plone.app.iterate + plone.app.kss + plone.app.layout + plone.app.linkintegrity + plone.app.openid + plone.app.portlets + plone.app.redirector + plone.app.viewletmanager + plone.app.vocabularies + plone.app.workflow + plone.contentrules + plone.fieldsets + plone.i18n + plone.intelligenttext + plone.locking + plone.memoize + plone.openid + plone.portlets + plone.session + plone.theme + txtfilter + wicked + five.customerize + five.localsitemanager + + +[zopepy] +recipe = zc.recipe.egg +eggs = ${instance:eggs} +interpreter = zopepy +extra-paths = ${zope2:location}/lib/python +scripts = zopepy Added: kukit/buildout/kss.zope/bootstrap.py ============================================================================== --- (empty file) +++ kukit/buildout/kss.zope/bootstrap.py Tue Nov 6 20:36:43 2007 @@ -0,0 +1,55 @@ +############################################################################## +# +# Copyright (c) 2006 Zope Corporation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +############################################################################## +"""Bootstrap a buildout-based project + +Simply run this script in a directory containing a buildout.cfg. +The script accepts buildout command-line options, so you can +use the -c option to specify an alternate configuration file. + +$Id: bootstrap.py 75593 2007-05-06 21:11:27Z jim $ +""" + +import os, shutil, sys, tempfile, urllib2 + +tmpeggs = tempfile.mkdtemp() + +try: + import pkg_resources +except ImportError: + ez = {} + exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' + ).read() in ez + ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) + + import pkg_resources + +cmd = 'from setuptools.command.easy_install import main; main()' +if sys.platform == 'win32': + cmd = '"%s"' % cmd # work around spawn lamosity on windows + +ws = pkg_resources.working_set +assert os.spawnle( + os.P_WAIT, sys.executable, sys.executable, + '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout', + dict(os.environ, + PYTHONPATH= + ws.find(pkg_resources.Requirement.parse('setuptools')).location + ), + ) == 0 + +ws.add_entry(tmpeggs) +ws.require('zc.buildout') +import zc.buildout.buildout +zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) +shutil.rmtree(tmpeggs) Added: kukit/buildout/kss.zope/buildout.cfg ============================================================================== --- (empty file) +++ kukit/buildout/kss.zope/buildout.cfg Tue Nov 6 20:36:43 2007 @@ -0,0 +1,35 @@ +[buildout] + +extends = + base.cfg + devel.cfg + +parts = + zope2 + instance + zopepy + +# clouseau +# docfindertab +# enablesettrace +# ptprofiler +# zopeprofiler +# zptdebugger +# pdbdebugmode +# deadlockdebugger +# ipzope + + +[instance] + +products = + ${buildout:directory}/products + +# ${clouseau:location} +# ${docfindertab:location} +# ${enablesettrace:location} +# ${ptprofiler:location} +# ${zopeprofiler:location} +# ${zptdebugger:location} +# ${pdbdebugmode:location} +# ${deadlockdebugger:location} Added: kukit/buildout/kss.zope/default.cfg.sample ============================================================================== --- (empty file) +++ kukit/buildout/kss.zope/default.cfg.sample Tue Nov 6 20:36:43 2007 @@ -0,0 +1,10 @@ +[buildout] + +# Specify this option to install eggs into a central place +# eggs-directory = /some/folder/for/eggs + +# Specify this option to cache downloaded Zope tarballs +# download-directory = /some/folder/for/downloads + +# Specify this option to cache downloaded eggs and source tarballs +# download-cache = /some/folder/for/downloads Added: kukit/buildout/kss.zope/devel.cfg ============================================================================== --- (empty file) +++ kukit/buildout/kss.zope/devel.cfg Tue Nov 6 20:36:43 2007 @@ -0,0 +1,63 @@ +[clouseau] +recipe = plone.recipe.bundlecheckout +url = https://svn.plone.org/svn/collective/Clouseau/trunk +subfolder = Clouseau + + +[docfindertab] +recipe = plone.recipe.bundlecheckout +url = https://svn.plone.org/svn/collective/DocFinderTab/trunk +subfolder = DocFinderTab + + +[enablesettrace] +recipe = plone.recipe.bundlecheckout +url = svn://svn.zope.org/repos/main/Products.enablesettrace/trunk +subfolder = enablesettrace + + +[ptprofiler] +recipe = plone.recipe.bundlecheckout +url = https://svn.infrae.com/PTProfiler/trunk +subfolder = PTProfiler + + +[zopeprofiler] +recipe = plone.recipe.distros +urls = http://www.dieter.handshake.de/pyprojects/zope/ZopeProfiler.tgz + + +[zptdebugger] +recipe = plone.recipe.bundlecheckout +url = https://svn.plone.org/svn/collective/ZPTDebugger/trunk +subfolder = ZPTDebugger + + +[pdbdebugmode] +recipe = plone.recipe.bundlecheckout +url = https://svn.plone.org/svn/collective/PDBDebugMode/trunk +subfolder = PDBDebugMode + + +[deadlockdebugger] +recipe = plone.recipe.bundlecheckout +url = http://svn.nuxeo.org/pub/Zope2/DeadlockDebugger/trunk +subfolder = DeadlockDebugger + + +[ipzope] +# a IPython Shell for interactive use with zope running. +# you also need to put +# https://svn.plone.org/svn/collective/dotipython/trunk/ipy_profile_zope.py +# to your $HOME/.ipython directory for the following to work. +recipe = zc.recipe.egg +eggs = + ipython + ${instance:eggs} +initialization = + import sys, os + os.environ["SOFTWARE_HOME"] = "${zope2:location}/lib/python" + os.environ["INSTANCE_HOME"] = "${instance:location}" + sys.argv[1:1] = "-p zope".split() +extra-paths = ${zope2:location}/lib/python +scripts = ipython=ipzope Added: kukit/buildout/kss.zope/src/EXTERNALS.txt ============================================================================== --- (empty file) +++ kukit/buildout/kss.zope/src/EXTERNALS.txt Tue Nov 6 20:36:43 2007 @@ -0,0 +1,56 @@ +# +# created by: svn propset svn:externals -F ./EXTERNALS.TXT . +# + +# Products packages + +Products.ATReferenceBrowserWidget https://svn.plone.org/svn/archetypes/MoreFieldsAndWidgets/ATReferenceBrowserWidget/trunk +Products.CMFDynamicViewFTI https://svn.plone.org/svn/collective/CMFDynamicViewFTI/trunk +Products.CMFFormController https://svn.plone.org/svn/collective/CMFFormController/trunk +Products.CMFQuickInstallerTool https://svn.plone.org/svn/collective/CMFQuickInstallerTool/trunk +Products.PlacelessTranslationService https://svn.plone.org/svn/collective/PlacelessTranslationService/trunk +Products.PloneLanguageTool https://svn.plone.org/svn/collective/PloneLanguageTool/trunk +Products.PlonePAS https://svn.plone.org/svn/collective/PlonePAS/branches/3.x +Products.ResourceRegistries https://svn.plone.org/svn/plone/ResourceRegistries/trunk +Products.SecureMailHost https://svn.plone.org/svn/collective/SecureMailHost/trunk +Products.statusmessages https://svn.plone.org/svn/collective/statusmessages/trunk + +# kss related packages +archetypes.kss https://svn.plone.org/svn/archetypes/archetypes.kss/trunk +kss.core https://codespeak.net/svn/kukit/kss.core/trunk + +# plone.* packages +plone.contentrules https://svn.plone.org/svn/plone/plone.contentrules/trunk +plone.fieldsets https://svn.plone.org/svn/plone/plone.fieldsets/trunk +plone.i18n https://svn.plone.org/svn/plone/plone.i18n/trunk +plone.locking https://svn.plone.org/svn/plone/plone.locking/trunk +plone.memoize https://svn.plone.org/svn/plone/plone.memoize/trunk +plone.openid https://svn.plone.org/svn/plone/plone.openid/trunk +plone.portlets https://svn.plone.org/svn/plone/plone.portlets/trunk +plone.session https://svn.plone.org/svn/plone/plone.session/trunk +plone.theme https://svn.plone.org/svn/plone/plone.theme/trunk +plone.intelligenttext https://svn.plone.org/svn/plone/plone.intelligenttext/trunk + +# plone.app.* packages +plone.app.contentmenu https://svn.plone.org/svn/plone/plone.app.contentmenu/trunk +plone.app.content https://svn.plone.org/svn/plone/plone.app.content/trunk +plone.app.contentrules https://svn.plone.org/svn/plone/plone.app.contentrules/trunk +plone.app.controlpanel https://svn.plone.org/svn/plone/plone.app.controlpanel/trunk +plone.app.customerize https://svn.plone.org/svn/plone/plone.app.customerize/trunk +plone.app.form https://svn.plone.org/svn/plone/plone.app.form/trunk +plone.app.i18n https://svn.plone.org/svn/plone/plone.app.i18n/trunk +plone.app.iterate https://svn.plone.org/svn/plone/plone.app.iterate/trunk +plone.app.kss https://svn.plone.org/svn/plone/plone.app.kss/trunk +plone.app.layout https://svn.plone.org/svn/plone/plone.app.layout/trunk +plone.app.linkintegrity https://svn.plone.org/svn/plone/plone.app.linkintegrity/trunk +plone.app.portlets https://svn.plone.org/svn/plone/plone.app.portlets/trunk +plone.app.redirector https://svn.plone.org/svn/plone/plone.app.redirector/trunk +plone.app.viewletmanager https://svn.plone.org/svn/plone/plone.app.viewletmanager/trunk +plone.app.vocabularies https://svn.plone.org/svn/plone/plone.app.vocabularies/trunk +plone.app.workflow https://svn.plone.org/svn/plone/plone.app.workflow/trunk +plone.app.openid https://svn.plone.org/svn/plone/plone.app.openid/trunk + +txtfilter https://svn.plone.org/svn/collective/txtfilter/trunk +wicked https://svn.plone.org/svn/collective/wicked/trunk +five.customerize svn://svn.zope.org/repos/main/five.customerize/branches/plone-3.0-branch +five.localsitemanager svn://svn.zope.org/repos/main/five.localsitemanager/trunk From jvloothuis at codespeak.net Tue Nov 6 21:04:00 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 6 Nov 2007 21:04:00 +0100 (CET) Subject: [KSS-checkins] r48344 - kukit/kss.zope Message-ID: <20071106200400.E7D088277@code0.codespeak.net> Author: jvloothuis Date: Tue Nov 6 21:04:00 2007 New Revision: 48344 Added: kukit/kss.zope/ Log: New package for Zope support based on kss.base From jvloothuis at codespeak.net Tue Nov 6 21:04:10 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 6 Nov 2007 21:04:10 +0100 (CET) Subject: [KSS-checkins] r48345 - kukit/kss.zope/trunk Message-ID: <20071106200410.462298289@code0.codespeak.net> Author: jvloothuis Date: Tue Nov 6 21:04:10 2007 New Revision: 48345 Added: kukit/kss.zope/trunk/ Log: New package for Zope support based on kss.base From jvloothuis at codespeak.net Tue Nov 6 21:31:58 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 6 Nov 2007 21:31:58 +0100 (CET) Subject: [KSS-checkins] r48346 - in kukit/kss.zope/trunk: . kss kss/core kss/core/pluginregistry kss/core/pluginregistry/browser kss/core/pluginregistry/deprecated kss/core/pluginregistry/json kss/core/pluginregistry/json/browser kss/zope Message-ID: <20071106203158.39056822B@code0.codespeak.net> Author: jvloothuis Date: Tue Nov 6 21:31:55 2007 New Revision: 48346 Added: kukit/kss.zope/trunk/kss/ kukit/kss.zope/trunk/kss/__init__.py kukit/kss.zope/trunk/kss/core/ kukit/kss.zope/trunk/kss/core/BeautifulSoup.py - copied unchanged from r48341, kukit/kss.core/trunk/kss/core/BeautifulSoup.py kukit/kss.zope/trunk/kss/core/__init__.py kukit/kss.zope/trunk/kss/core/configure.zcml kukit/kss.zope/trunk/kss/core/interfaces.py kukit/kss.zope/trunk/kss/core/kssview.py kukit/kss.zope/trunk/kss/core/meta.zcml kukit/kss.zope/trunk/kss/core/pluginregistry/ kukit/kss.zope/trunk/kss/core/pluginregistry/EXTERNALS.TXT kukit/kss.zope/trunk/kss/core/pluginregistry/__init__.py kukit/kss.zope/trunk/kss/core/pluginregistry/action.py kukit/kss.zope/trunk/kss/core/pluginregistry/browser/ kukit/kss.zope/trunk/kss/core/pluginregistry/browser/__init__.py kukit/kss.zope/trunk/kss/core/pluginregistry/browser/configure.zcml kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develui.css kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develui.js kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develui.kss kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develui.pt kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develview.py kukit/kss.zope/trunk/kss/core/pluginregistry/browser/interfaces.py kukit/kss.zope/trunk/kss/core/pluginregistry/command.py kukit/kss.zope/trunk/kss/core/pluginregistry/commandset.py kukit/kss.zope/trunk/kss/core/pluginregistry/configure.py kukit/kss.zope/trunk/kss/core/pluginregistry/configure.zcml kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/ kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/__init__.py kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/configure.py kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/directives.py kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/meta.zcml kukit/kss.zope/trunk/kss/core/pluginregistry/directives.py kukit/kss.zope/trunk/kss/core/pluginregistry/event_type.py kukit/kss.zope/trunk/kss/core/pluginregistry/interfaces.py kukit/kss.zope/trunk/kss/core/pluginregistry/json/ kukit/kss.zope/trunk/kss/core/pluginregistry/json/__init__.py kukit/kss.zope/trunk/kss/core/pluginregistry/json/browser/ kukit/kss.zope/trunk/kss/core/pluginregistry/json/browser/jsonkukit.js kukit/kss.zope/trunk/kss/core/pluginregistry/json/config.py kukit/kss.zope/trunk/kss/core/pluginregistry/json/configure.zcml kukit/kss.zope/trunk/kss/core/pluginregistry/json/interfaces.py kukit/kss.zope/trunk/kss/core/pluginregistry/json/utils.py kukit/kss.zope/trunk/kss/core/pluginregistry/meta.zcml kukit/kss.zope/trunk/kss/core/pluginregistry/plugin.py kukit/kss.zope/trunk/kss/core/pluginregistry/pprovider.py kukit/kss.zope/trunk/kss/core/pluginregistry/registry.py kukit/kss.zope/trunk/kss/core/pluginregistry/selector_type.py kukit/kss.zope/trunk/kss/core/unicode_quirks.py - copied unchanged from r48341, kukit/kss.core/trunk/kss/core/unicode_quirks.py kukit/kss.zope/trunk/kss/zope/ kukit/kss.zope/trunk/kss/zope/__init__.py kukit/kss.zope/trunk/kss/zope/actionwrapper.py - copied unchanged from r48341, kukit/kss.core/trunk/kss/core/actionwrapper.py kukit/kss.zope/trunk/kss/zope/configure.zcml kukit/kss.zope/trunk/kss/zope/interfaces.py - copied unchanged from r48341, kukit/kss.core/trunk/kss/core/interfaces.py kukit/kss.zope/trunk/kss/zope/view.py - copied, changed from r48341, kukit/kss.core/trunk/kss/core/kssview.py kukit/kss.zope/trunk/setup.py Log: Initial fake enough version for Zope and Plone to start up Added: kukit/kss.zope/trunk/kss/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/__init__.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,6 @@ +# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages +try: + __import__('pkg_resources').declare_namespace(__name__) +except ImportError: + from pkgutil import extend_path + __path__ = extend_path(__path__, __name__) Added: kukit/kss.zope/trunk/kss/core/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/__init__.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,4 @@ +from kss.zope.view import KSSView +from kss.core.unicode_quirks import force_unicode +from kss.base.commands import KSSCommandSet as CommandSet +from kss.zope.actionwrapper import KSSExplicitError, kssaction Added: kukit/kss.zope/trunk/kss/core/configure.zcml ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/configure.zcml Tue Nov 6 21:31:55 2007 @@ -0,0 +1,2 @@ + + Added: kukit/kss.zope/trunk/kss/core/interfaces.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/interfaces.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1 @@ +from kss.zope.interfaces import IKSSView Added: kukit/kss.zope/trunk/kss/core/kssview.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/kssview.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1 @@ +from kss.base.commands import KSSCommandSet as CommandSet Added: kukit/kss.zope/trunk/kss/core/meta.zcml ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/meta.zcml Tue Nov 6 21:31:55 2007 @@ -0,0 +1,8 @@ + + + + + + + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/EXTERNALS.TXT ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/EXTERNALS.TXT Tue Nov 6 21:31:55 2007 @@ -0,0 +1,10 @@ +# +# results of svn propget svn:externals +# http://codespeak.net/svn/kukit/azax/trunk/plugins +# +# You can update your working dir by: +# svn propset svn:externals -F EXTERNALS.TXT . +# + +# concatresource is now included like as batteries +_concatresource https://codespeak.net/svn/kukit/kss.concatresource/trunk/kss/concatresource Added: kukit/kss.zope/trunk/kss/core/pluginregistry/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/__init__.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,26 @@ +# Copyright (c) 2005-2007 +# Authors: KSS Project Contributors (see docs/CREDITS.txt) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +'''\ +Module init +''' + +from plugin import KSSPluginError +from command import Command, checkRegisteredCommand_old +from event_type import EventType +from action import Action, checkRegisteredCommand +from selector_type import SelectorType, checkRegisteredSelector Added: kukit/kss.zope/trunk/kss/core/pluginregistry/action.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/action.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,55 @@ +# Copyright (c) 2005-2007 +# Authors: KSS Project Contributors (see docs/CREDITS.txt) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +from plugin import KSSPlugin, KSSPluginError +from interfaces import IAction +from zope.interface import implements +import zope.component as capi + +def checkRegisteredCommand(name): + 'Check if it is a registered command.' + try: + command = capi.getUtility(IAction, name) + except capi.ComponentLookupError: + raise KSSPluginError, '"%s" is not a registered kss command' % (name, ) + # check if the action has a valid command factory + if command.command_factory == 'none': + raise KSSPluginError, '"%s" kss command has missing command_factory' % (name, ) + # issue deprecation warning, if necessary + command.check_deprecation() + +class Action(KSSPlugin): + '''The action plugin + + ''' + + implements(IAction) + + def __init__(self, name, jsfile, command_factory, + params_mandatory, params_optional, deprecated): + KSSPlugin.__init__(self, name, jsfile) + self.command_factory = command_factory + self.params_mandatory = params_mandatory + self.params_optional = params_optional + self.deprecated = deprecated + + def check_deprecation(self): + if self.deprecated: + import warnings, textwrap + warnings.warn(textwrap.dedent('''\ + The usage of the kss command "%s" is deprecated, + %s''' % (self.name, self.deprecated)), DeprecationWarning, 2) Added: kukit/kss.zope/trunk/kss/core/pluginregistry/browser/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/browser/__init__.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,4 @@ +'''\ +Module init +''' + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/browser/configure.zcml ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/browser/configure.zcml Tue Nov 6 21:31:55 2007 @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develui.css ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develui.css Tue Nov 6 21:31:55 2007 @@ -0,0 +1,99 @@ +body { + font-family: Verdana, Arial, sans-serif; + font-size: 11pt; +} + +h3 { + font-size: 110%; + margin-top: 0.5em; + margin-bottom: 0.2em; +} + +#global-links { + display: table; + font-size: 80%; +} + +#global-links ul { + display: table-row; +} + +#global-links ul li { + display: table-cell; +} + +#global-links a { + display: block; + padding: 0.25em; + margin: 0.25em; + border: 1px solid #FF8888; + color: #CC0000; + text-decoration: none; +} + +#global-links a:hover { + border-color: #FF0000; + background-color: #FFCCCC; +} + +#target { + padding: 1em; + margin: 0.5em 0; + border: 1px solid #CCCCCC; + background-color: #EEEEEE; +} + +.cursorPointer { + cursor: pointer; +} + +.click { + color: #880000; +} + +radio.click { + background-color: #880000; +} + +a.button, +input[type="submit"] { + width: auto; + padding: 0.2em; + border: 1px solid #FF8888; + color: #CC0000; + text-decoration: none; +} + +fieldset { + margin: 0.5em 0; +} + +fieldset div { + margin: 0.3em 0; +} + +.help { + font-size: 80%; + color: #AAAAAA; +} + +.help pre { + color: black; + border: 1px solid #CCCCCC; + background-color: #EEEEEE; + padding: 0.5em; + margin: 0.25em; +} + +.container { + padding : 1em; +} + +.red { + color: red; +} + +.green { + color: green; +} + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develui.js ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develui.js Tue Nov 6 21:31:55 2007 @@ -0,0 +1,5 @@ + +/* At the moment, there is no javascript, and + * switching is done from the server side. + */ + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develui.kss ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develui.kss Tue Nov 6 21:31:55 2007 @@ -0,0 +1,4 @@ + +/* At the moment, there is no kss. + */ + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develui.pt ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develui.pt Tue Nov 6 21:31:55 2007 @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Kss mode setup

+ +

+ Current KSS mode is + developmentproduction. +

+ +

+ If you call @@kss_devel_mode/ison on the current context, + you get True if in development mode, False in in production mode. +

+ +

+ Set KSS mode cookie +

+
+
+ Click the button to toggle mode. +
+ +
+ + + +
+

The cookie is global to the site and may be overridden by a + local utility (eg. ResourceRegistries, in Plone)

+ +
+ +

Back

+ + + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develview.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/browser/develview.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,120 @@ + +try: + from Products.Five import BrowserView + BrowserView +except ImportError: + from zope.publisher.browser import BrowserView + +from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile +from interfaces import IDevelView +from zope.interface import implements +from zope.traversing.interfaces import ITraverser +from zope.publisher.interfaces import NotFound + +COOKIE_NAME = '__kss_devel' + +class DevelView(BrowserView): + implements(IDevelView) + + # Zope3 requires the implementation of + # IBrowserPublisher, in order for the methods + # to be traversable. + # + # An alternative would be: + # + # + # + # + + def publishTraverse(self, request, name): + try: + return getattr(self, name) + except AttributeError: + raise NotFound(self.context, name, request) + + def browserDefault(self, request): + # make ui the default method + return self, ('ui', ) + + # -- + # Accessable methods + # -- + + def ison(self): + '''Checks if running in development mode + + Two ways to induce development mode: + + - set the cookie on the request + + - switch portal_js tool into debug mode, this will + select development mode without the cookie + + ''' + ison = COOKIE_NAME in self.request.cookies + + if not ison: + # Check from javascript tool + # XXX this should not be done from here, but I don't want to + # modify other components yet. + try: + from Products.CMFCore.utils import getToolByName + js_tool = getToolByName(self.context.aq_inner, 'portal_javascripts') + ison = js_tool.getDebugMode() + except: + pass + + result = bool(ison) + return result + + def isoff(self, REQUEST=None): + 'Check if running in production mode' + result = not(self.ison()) + if REQUEST is not None: + result = str(result) + return result + + def set(self): + 'Sets development mode cookie' + self.request.response.setCookie(COOKIE_NAME, '1', path='/') + + def unset(self): + 'Unsets development mode cookie' + self.request.response.expireCookie(COOKIE_NAME, path='/') + + _ui = ViewPageTemplateFile('develui.pt', content_type='text/html;charset=utf-8') + + def ui(self): + 'User interface for interactive switching' + options = {} + if 'devel' in self.request.form: + self.set() + # setting it also to have immediate effect in the page + options['devel_mode'] = True + if 'prod' in self.request.form: + self.unset() + if COOKIE_NAME in self.request.cookies: + # setting it also to have immediate effect in the page + options['devel_mode'] = False + return self._ui(**options) + + def ui_js(self): + 'Javascript needed for the ui' + resource = ITraverser(self.context).traverse('++resource++kss_devel_ui.js', + request=self.request) + cooked = resource.GET() + return cooked + + def ui_css(self): + 'CSS needed for the ui' + resource = ITraverser(self.context).traverse('++resource++kss_devel_ui.css', + request=self.request) + cooked = resource.GET() + return cooked + + def ui_kss(self): + 'KSS needed for the ui' + resource = ITraverser(self.context).traverse('++resource++kss_devel_ui.kss', + request=self.request) + cooked = resource.GET() + return cooked Added: kukit/kss.zope/trunk/kss/core/pluginregistry/browser/interfaces.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/browser/interfaces.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,40 @@ + + +from zope.publisher.interfaces.browser import IBrowserPublisher + +class IDevelView(IBrowserPublisher): + + def ison(): + '''Checks if running in development mode + + Two ways to induce development mode: + + - set the cookie on the request + + - switch portal_js tool into debug mode, this will + select development mode without the cookie + + ''' + + def isoff(): + 'Check if running in production mode' + + def set(): + 'Sets development mode cookie' + + def unset(): + 'Unsets development mode cookie' + + def ui(): + 'User interface for interactive switching' + + def ui_js(): + 'Javascript needed for the ui' + + def ui_css(): + 'CSS needed for the ui' + + def ui_kss(): + 'KSS needed for the ui' + + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/command.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/command.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,39 @@ +# Copyright (c) 2005-2007 +# Authors: KSS Project Contributors (see docs/CREDITS.txt) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +from plugin import KSSPlugin +from interfaces import ICommand +from plugin import KSSPluginError +import zope.component as capi +from zope.interface import implements + +def checkRegisteredCommand_old(name): + 'Check if it is a registered command.' + try: + command = capi.getUtility(ICommand, name) + except capi.ComponentLookupError: + raise KSSPluginError, '"%s" is not a registered kss command' % (name, ) + +class Command(KSSPlugin): + '''The command plugin + + ''' + + implements(ICommand) + + def __init__(self, name, jsfile): + KSSPlugin.__init__(self, name, jsfile) Added: kukit/kss.zope/trunk/kss/core/pluginregistry/commandset.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/commandset.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,57 @@ +# Copyright (c) 2005-2007 +# Authors: KSS Project Contributors (see docs/CREDITS.txt) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +from zope.interface import implements +import zope.component as capi + +from plugin import KSSPluginError +from plugin import registerPlugin +from interfaces import ICommandSet + +def getRegisteredCommandSet(name): + 'Get the command set' + try: + commandset = capi.getUtility(ICommandSet, name) + except capi.ComponentLookupError: + raise KSSPluginError, '"%s" is not a registered kss command set' % (name, ) + return commandset + +class CommandSet(object): + '''The command set plugin + + registers the command adapter interface + (like IKssCoreCommands), this makes possible + to look them up by name instead of by interface + ''' + + implements(ICommandSet) + + def __init__(self, name, provides): + self.name = name + self.provides = provides + +def registerAndAllowCommandSet(class_, name, provides, *arg, **kw): + registerPlugin(CommandSet, ICommandSet, name, provides, *arg, **kw) + try: + import Products.Five + except ImportError: + pass + else: + # Allow TTW to use commandsets + from AccessControl import allow_class + allow_class(class_) + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/configure.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/configure.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,88 @@ +# Copyright (c) 2005-2007 +# Authors: KSS Project Contributors (see docs/CREDITS.txt) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +from zope.component.zcml import adapter +from interfaces import IEventType, ISelectorType, IAction, IParamProvider +from event_type import EventType +from action import Action +from selector_type import SelectorType +from commandset import registerAndAllowCommandSet +from pprovider import ParamProvider +from plugin import registerPlugin + +def registerEventType(_context, name, jsfile=None): + 'Directive that registers an event type' + + # check to see if the file exists + if jsfile is not None: + file(jsfile, 'rb').close() + + _context.action( + discriminator = ('registerKssEventType', name, jsfile), + callable = registerPlugin, + args = (EventType, IEventType, name, jsfile), + ) + +def registerAction(_context, name, jsfile=None, command_factory='none', + params_mandatory=[], params_optional=[], deprecated=None): + 'Directive that registers an action.' + + # check to see if the file exists + if jsfile is not None: + file(jsfile, 'rb').close() + + _context.action( + discriminator = ('registerKssAction', name, jsfile), + callable = registerPlugin, + args = (Action, IAction, name, jsfile, command_factory, params_mandatory, params_optional, deprecated), + ) + +def registerSelectorType(_context, name, jsfile=None): + 'Directive that registers a selector type' + + # check to see if the file exists + if jsfile is not None: + file(jsfile, 'rb').close() + + _context.action( + discriminator = ('registerKssSelectorType', name, jsfile), + callable = registerPlugin, + args = (SelectorType, ISelectorType, name, jsfile), + ) + +def registerCommandSet(_context, for_, class_, name, provides): + 'Directive that registers a command set' + + adapter(_context, [class_], provides, [for_]) + _context.action( + discriminator = ('registerKssCommandSet', name), + callable = registerAndAllowCommandSet, + args = (class_, name, provides), + ) + +def registerParamProvider(_context, name, jsfile=None): + 'Directive that registers a parameter provider' + + # check to see if the file exists + if jsfile is not None: + file(jsfile, 'rb').close() + + _context.action( + discriminator = ('registerKssParamProvider', name), + callable = registerPlugin, + args = (ParamProvider, IParamProvider, name, jsfile), + ) Added: kukit/kss.zope/trunk/kss/core/pluginregistry/configure.zcml ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/configure.zcml Tue Nov 6 21:31:55 2007 @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/__init__.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,4 @@ +'''\ +Module init +''' + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/configure.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/configure.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,26 @@ + +import os.path +from kss.core.pluginregistry.interfaces import ICommand +from kss.core.pluginregistry.command import Command +from kss.core.pluginregistry.plugin import registerPlugin +from kss.core.deprecated import deprecated_directive +from kss.core.pluginregistry import configure as _configure + +def registerCommand(_context, name, jsfile=None): + 'Directive that registers a command' + # check to see if the file exists + if jsfile is not None: + file(jsfile, 'rb').close() + + _context.action( + discriminator = ('registerKssCommand', name, jsfile), + callable = registerPlugin, + args = (Command, ICommand, name, jsfile), + ) +registerCommand = deprecated_directive(registerCommand, 'azax:registerCommand', + 'use kss:registerAction with command_factory="selector" or "global"') + +registerEventType = deprecated_directive(_configure.registerEventType, 'azax:registerEventType', 'use kss:registerEventType instead') +registerAction = deprecated_directive(_configure.registerAction, 'azax:registerAction', 'use kss:registerAction instead') +registerSelectorType = deprecated_directive(_configure.registerSelectorType, 'azax:registerSelectorType', 'use kss:registerSelectorType instead') +registerCommandSet = deprecated_directive(_configure.registerCommandSet, 'azax:registerCommandSet', 'use kss:registerCommandSet instead') Added: kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/directives.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/directives.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,23 @@ +from zope.interface import Interface +from zope.schema import TextLine, Choice +from zope.configuration.fields import Path, Tokens, PythonIdentifier, \ + GlobalInterface + +class IRegisterCommandDirective(Interface): + 'Register a KSS command plugin' + + name = TextLine( + title=u"Name", + description=u"The name of the command plugin.", + required=True, + ) + + jsfile = Path( + title=u"Javascript file", + description=u"The path of the javascript file that defines the plugin", + required=False, + ) + +from kss.core.pluginregistry.directives import IRegisterEventTypeDirective, \ + IRegisterActionDirective, IRegisterSelectorTypeDirective, \ + IRegisterCommandSetDirective Added: kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/meta.zcml ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/meta.zcml Tue Nov 6 21:31:55 2007 @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/directives.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/directives.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,118 @@ +from zope.interface import Interface +from zope.schema import TextLine, Choice +from zope.configuration.fields import Path, Tokens, PythonIdentifier, \ + GlobalInterface, GlobalObject + +class IRegisterEventTypeDirective(Interface): + 'Register a KSS event type' + + name = TextLine( + title=u"Name", + description=u"The name of the event type plugin.", + required=True, + ) + + jsfile = Path( + title=u"Javascript file", + description=u"The path of the javascript file that defines the plugin", + required=False, + ) + +class IRegisterActionDirective(Interface): + 'Register a KSS action' + + name = TextLine( + title=u"Name", + description=u"The name of the action plugin.", + required=True, + ) + + jsfile = Path( + title=u"Javascript file", + description=u"The path of the javascript file that defines the plugin", + required=False, + ) + + command_factory = Choice( + title=u"Command factory type", + description=u"Command factory type, by default 'none'.", + values=(u'none', u'global', u'selector'), + required=False, + ) + + params_mandatory = Tokens( + title=u"Mandatory parameters", + description=u"Space separated list of mandatory parameter names", + value_type=PythonIdentifier(), + required=False, + ) + + params_optional = Tokens( + title=u"Optional parameters", + description=u"Comma separated list of optional parameter names", + value_type=PythonIdentifier(), + required=False, + ) + + deprecated = TextLine( + title=u"Deprecated", + description=u"The hint that we should give as warning about deprecation", + required=False, + ) + +class IRegisterSelectorTypeDirective(Interface): + 'Register a KSS selector type' + + name = TextLine( + title=u"Name", + description=u"The name of the selector type plugin.", + required=True, + ) + + jsfile = Path( + title=u"Javascript file", + description=u"The path of the javascript file that defines the plugin", + required=False, + ) + +class IRegisterCommandSetDirective(Interface): + 'Register a KSS command set' + + for_ = GlobalInterface( + title=u"For", + description=u"The interface of view that can be adapted to this commandset", + required=True, + ) + + class_ = GlobalObject( + title=u"Class", + description=u"The class that implements the commandset", + required=True, + ) + + name = TextLine( + title=u"Name", + description=u"The name of the command set component.", + required=True, + ) + + provides = GlobalInterface( + title=u"Provides", + description=u"The interface that does the adaptation on the view for this set", + required=True, + ) + +class IRegisterParamProviderDirective(Interface): + 'Register a KSS parameter provider' + + name = TextLine( + title=u"Name", + description=u"The name of the parameter provider plugin.", + required=True, + ) + + jsfile = Path( + title=u"Javascript file", + description=u"The path of the javascript file that defines the plugin", + required=False, + ) Added: kukit/kss.zope/trunk/kss/core/pluginregistry/event_type.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/event_type.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,31 @@ +# Copyright (c) 2005-2007 +# Authors: KSS Project Contributors (see docs/CREDITS.txt) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +from plugin import KSSPlugin +from interfaces import IEventType +from zope.interface import implements + +class EventType(KSSPlugin): + '''The event type plugin + + ''' + + implements(IEventType) + + def __init__(self, name, jsfile): + KSSPlugin.__init__(self, name, jsfile) + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/interfaces.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/interfaces.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,42 @@ +# Copyright (c) 2005-2007 +# Authors: KSS Project Contributors (see docs/CREDITS.txt) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +from zope.interface import Interface + +class IKSSPlugin(Interface): + '''Base for KSS plugins + + this represents an entity implemented in a javascript file + ''' + +class ICommand(IKSSPlugin): + '''Command plugin''' + +class IAction(IKSSPlugin): + '''Action plugin''' + +class IEventType(IKSSPlugin): + '''Event type plugin''' + +class ISelectorType(IKSSPlugin): + '''Selector type plugin''' + +class ICommandSet(Interface): + '''Command set plugin''' + +class IParamProvider(IKSSPlugin): + '''Parameter provider plugin''' Added: kukit/kss.zope/trunk/kss/core/pluginregistry/json/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/json/__init__.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,5 @@ +'''\ +Module init +''' + +from utils import getJsonAddonFiles Added: kukit/kss.zope/trunk/kss/core/pluginregistry/json/browser/jsonkukit.js ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/json/browser/jsonkukit.js Tue Nov 6 21:31:55 2007 @@ -0,0 +1,95 @@ + +/* +* Copyright (c) 2005-2006 +* Authors: +* Bal?zs Re? +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as published +* by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +* 02111-1307, USA. +*/ + +/* +* Supplemental script for json +* +* This gets included when json plugins are registered. +* +* This transparently replaces the normal transport with JSON. +* To do this, we overwrite notifyServer and at one point we +* return to the normal execution chain (after results are received). +* (We need to do this because even an old style event plugin may +* invoke new style command plugins as a response.) +* +* To manually call the server from an event plugin, the +* makeJSONKukitMethod function should be used to create a +* proxy method. +*/ + +kukit.makeJSONKukitMethod = function(url, methodName, supplement) { + // url and methodName can be used, + // or methodName can be set to null and url will be used as a full url. + if (typeof(supplement) == 'undefined') { + // default timeout is 4 sec... a sane choice + supplement = null; + } + // XXX RequestManager of json is not compatible with kukit's at the moment. + return new JSONRPCMethod(url, methodName, kukit.jsonCallback, kukit.jsonError, + null, supplement, null, null); +} + +// OVERWRITE kukit.js +kukit.notifyServer = function(url, params, oper) { + var f = function(queueItem) { + // store the queue reception on the oper + oper.queueItem = queueItem; + // sending form, with standard form parameters. + var method = kukit.makeJSONKukitMethod(url, null, oper); + method(params); + }; + kukit.requestManager.notifyServer(f, url); +} + +kukit.jsonCallback = function(result, oper) { + // notify the queue that we are done + var success = oper.queueItem.receivedResult() + // We only process if the response has not been timed + // out by the queue in the meantime. + if (success) { + try { + var command_processor = new kukit.CommandProcessor(); + // Transport parm is same as result (although we don't use it) + command_processor.parseCommands(result, result); + command_processor.executeCommands(oper); + } catch(e) { + kukit.logError('Error during command execution: ' + e); + throw e; + } + } +} + +kukit.jsonError = function(result, oper) { + // XXX at the moment timeouts don't arrive here... + // notify the queue that we are done + var success = oper.queueItem.receivedResult() + kukit.logError('JSON call failed: ' + result); +} + +/* Command execution */ + +// OVERWRITE kukit.js +kukit.CommandProcessor.prototype.parseCommand = function(command, transport) { + // Add the command. + var command = new kukit.cr.makeCommand(command.selector, command.name, command.selectorType, command.params, transport); + this.addCommand(command); +} + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/json/config.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/json/config.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,16 @@ + +try: + import jsonserver + from jsonserver.interfaces import IJSONRPCRequest + from jsonserver.minjson.interfaces import IJSONStreamWriteable, IJSONWriter +except ImportError: + try: + import Products.jsonserver + from Products.jsonserver.interfaces import IJSONRPCRequest + from Products.jsonserver.minjson.interfaces import IJSONStreamWriteable, IJSONWriter + except ImportError: + HAS_JSON = False + else: + HAS_JSON = True +else: + HAS_JSON = True Added: kukit/kss.zope/trunk/kss/core/pluginregistry/json/configure.zcml ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/json/configure.zcml Tue Nov 6 21:31:55 2007 @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/json/interfaces.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/json/interfaces.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,40 @@ +# -*- coding: ISO-8859-15 -*- +# Copyright (c) 2005-2007 +# Authors: KSS Project Contributors (see docs/CREDITS.txt) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +import config +from zope.interface import Interface + +if config.HAS_JSON: + IJSONRPCRequest = config.IJSONRPCRequest + IJSONStreamWriteable = config.IJSONStreamWriteable + IJSONWriter = config.IJSONWriter +else: + # If jsonserver is not present, we just define interfaces + # that noone implements so the adapters will never be looked up. + # This is because the zcml will try to import these. + # XXX occasionally this should be done from the zcml, + # via features/conditionals! + + class IJSONRPCRequest(Interface): + 'Interface never to be implemented' + + class IJSONStreamWriteable(Interface): + 'Interface never to be implemented' + + class IJSONWriter(Interface): + 'Interface never to be implemented' Added: kukit/kss.zope/trunk/kss/core/pluginregistry/json/utils.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/json/utils.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,62 @@ +'''\ +Supplemental support for json plugins +''' + +import os.path, logging +import zope.component as capi +from zope.interface import implements, Interface +from zope.publisher.browser import TestRequest +from interfaces import IJSONStreamWriteable + +logger = logging.getLogger('kss.core') + +def getJsonAddonFiles(): + 'Gets the addon javascript files for json' + files = [] + # Try adding the jsonserver files + request = TestRequest() + try: + # use the files already registered to that concat resource + jsonrpc = capi.getAdapter(request, Interface, 'jsonrpc.js') + except capi.ComponentLookupError: + pass # JSON not present. + else: + # JSON present. + files.extend(jsonrpc.context.context.getPathList()) + # add the json kukit support file + plugins_dir = os.path.split(globals()['__file__'])[0] + files.append(os.path.join(plugins_dir, 'browser', 'jsonkukit.js')) + logger.info('Lazy plugin construction: Installed support for JSON-RPC transport.') + return files + +class JsonCommandView(object): + '''View of a command for JSON requests. + + We siply return the commands since they + will be transparently rendered for JSON, + via the writer adapter hooks. + ''' + + def __init__(self, context, request): + self.context = context + self.request = request + + def render(self): + return self.context + +class KSSCommandWriter(object): + 'Writes a command to JSON' + implements(IJSONStreamWriteable) + + def __init__(self, context, writer): + self.context = context + self.writer = writer + + def __jsonwrite__(self): + writer = self.writer + # All is written as a dict + d = dict(self.context.__dict__) + # params are converted to a dict from a list. + # Also get rid of "none" params that were only a hack for xml + d['params'] = dict([(param.name, param.content) for param in d['params'] if param.name != 'none']) + writer.write_repr(d) Added: kukit/kss.zope/trunk/kss/core/pluginregistry/meta.zcml ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/meta.zcml Tue Nov 6 21:31:55 2007 @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + Added: kukit/kss.zope/trunk/kss/core/pluginregistry/plugin.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/plugin.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,45 @@ +# Copyright (c) 2005-2007 +# Authors: KSS Project Contributors (see docs/CREDITS.txt) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +from interfaces import IKSSPlugin +import zope.component as capi +from zope.interface import implements + +class KSSPluginError(Exception): + pass + +def registerPlugin(cls, interface, name, *arg, **kw): + 'Convenience method to help registration' + plugin = cls(name, *arg, **kw) + # check if it's registered: do not allow registration for the second name + try: + capi.getUtility(interface, name=name) + except capi.ComponentLookupError: + pass + else: + raise KSSPluginError, 'Duplicate registration attempt for plugin "%s" of type %s' % (plugin.name, interface) + # provide the utility. + capi.provideUtility(plugin, interface, name=name) + +class KSSPlugin(object): + 'The base plugin class' + + implements(IKSSPlugin) + + def __init__(self, name, jsfile): + self.name = name + self.jsfile = jsfile Added: kukit/kss.zope/trunk/kss/core/pluginregistry/pprovider.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/pprovider.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,30 @@ +# Copyright (c) 2005-2007 +# Authors: KSS Project Contributors (see docs/CREDITS.txt) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +from plugin import KSSPlugin +from interfaces import IParamProvider +import zope.component as capi +from zope.interface import implements + +class ParamProvider(KSSPlugin): + '''The parameter provider plugin + ''' + + implements(IParamProvider) + + def __init__(self, name, jsfile): + KSSPlugin.__init__(self, name, jsfile) Added: kukit/kss.zope/trunk/kss/core/pluginregistry/registry.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/registry.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,43 @@ +# Copyright (c) 2005-2007 +# Authors: KSS Project Contributors (see docs/CREDITS.txt) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +import zope.component as capi +from interfaces import IKSSPlugin +from zope.interface import implements +# concatresource is an embedded product +import _concatresource +from concatresource.interfaces import IConcatResourceAddon +from json import getJsonAddonFiles +import zope.component as capi + +class KSSConcatResourceAddon(object): + implements(IConcatResourceAddon) + + def getAddonFiles(self): + try: + files = self._addon_files + except AttributeError: + # Lazy setup of addon files + self._addon_files = files = getJsonAddonFiles() + # Lookup all utilities and add up the files from it + plugins = capi.getAllUtilitiesRegisteredFor(IKSSPlugin) + for plugin in plugins: + if plugin.jsfile and plugin.jsfile not in files: + files.append(plugin.jsfile) + return files + +kssConcatResourceAddon = KSSConcatResourceAddon() Added: kukit/kss.zope/trunk/kss/core/pluginregistry/selector_type.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/selector_type.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,39 @@ +# Copyright (c) 2005-2007 +# Authors: KSS Project Contributors (see docs/CREDITS.txt) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +from plugin import KSSPlugin +from plugin import KSSPluginError +from interfaces import ISelectorType +import zope.component as capi +from zope.interface import implements + +def checkRegisteredSelector(name): + 'Check if it is a registered selector.' + try: + command = capi.getUtility(ISelectorType, name) + except capi.ComponentLookupError: + raise KSSPluginError, '"%s" is not a registered kss selector' % (name, ) + +class SelectorType(KSSPlugin): + '''The selectortype plugin + + ''' + + implements(ISelectorType) + + def __init__(self, name, jsfile): + KSSPlugin.__init__(self, name, jsfile) Added: kukit/kss.zope/trunk/kss/zope/__init__.py ============================================================================== Added: kukit/kss.zope/trunk/kss/zope/configure.zcml ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/zope/configure.zcml Tue Nov 6 21:31:55 2007 @@ -0,0 +1,2 @@ + + Copied: kukit/kss.zope/trunk/kss/zope/view.py (from r48341, kukit/kss.core/trunk/kss/core/kssview.py) ============================================================================== --- kukit/kss.core/trunk/kss/core/kssview.py (original) +++ kukit/kss.zope/trunk/kss/zope/view.py Tue Nov 6 21:31:55 2007 @@ -35,8 +35,9 @@ except ImportError: from zope.publisher.browser import BrowserView -from kss.core.commands import KSSCommands -from kss.core.interfaces import IKSSView, ICommandSet +from kss.base import KSSCommands +# from kss.core.commands import KSSCommands +from kss.zope.interfaces import IKSSView, ICommandSet from kss.core.pluginregistry.commandset import getRegisteredCommandSet from zope import component, interface, event Added: kukit/kss.zope/trunk/setup.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/setup.py Tue Nov 6 21:31:55 2007 @@ -0,0 +1,33 @@ +from setuptools import setup, find_packages +import sys, os + +version = '1.4' + +setup(name='kss.zope', + version=version, + description="KSS (Kinetic Style Sheets) core framework", + long_description="""\ +""", + # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[ + "Framework :: Zope2", + "Framework :: Zope3", + "Programming Language :: Python", + "Topic :: Software Development :: Libraries :: Python Modules", + ], + keywords='', + author='KSS Project', + author_email='kss-devel at codespeak.net', + url='http://kssproject.org', + license='GPL', + packages=find_packages(exclude=['ez_setup']), + namespace_packages=['kss'], + include_package_data=True, + zip_safe=False, + install_requires=[ + 'setuptools', + ], + entry_points=""" + # -*- Entry points: -*- + """, + ) From kukit-checkins at codespeak.net Wed Nov 7 14:36:41 2007 From: kukit-checkins at codespeak.net (VIAGRA ® Official Site) Date: Wed, 7 Nov 2007 14:36:41 +0100 (CET) Subject: [KSS-checkins] November 75% OFF Message-ID: <20071107033635.5906.qmail@host92-74-dynamic.1-79-r.retail.telecomitalia.it> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20071107/97abd3f2/attachment.htm From jvloothuis at codespeak.net Thu Nov 8 11:13:28 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Thu, 8 Nov 2007 11:13:28 +0100 (CET) Subject: [KSS-checkins] r48400 - kukit/kss.base/trunk/kss/base Message-ID: <20071108101328.97CB18175@code0.codespeak.net> Author: jvloothuis Date: Thu Nov 8 11:13:26 2007 New Revision: 48400 Modified: kukit/kss.base/trunk/kss/base/commands.py kukit/kss.base/trunk/kss/base/commands.txt kukit/kss.base/trunk/kss/base/corecommands.txt Log: Fixed a problem with Firefox splitting text nodes at 4096 bytes. All values are now packed into CDATA sections instead of XML escaped which makes them a different node type. Modified: kukit/kss.base/trunk/kss/base/commands.py ============================================================================== --- kukit/kss.base/trunk/kss/base/commands.py (original) +++ kukit/kss.base/trunk/kss/base/commands.py Thu Nov 8 11:13:26 2007 @@ -1,4 +1,4 @@ -from xml.sax.saxutils import quoteattr, escape +from xml.sax.saxutils import quoteattr from kss.base.registry import command_set_registry from kss.base.selectors import Selector from kss.base.coreselectors import css @@ -12,7 +12,7 @@ kss_command_end = '' -kss_param = '%(value)s' +kss_param = '' class KSSCommands(object): '''Command renderer for creating KSS responses''' @@ -41,7 +41,7 @@ action=quoteattr(action))) for name, value in options.items(): output.append(kss_param % dict( - name=quoteattr(name), value=escape(value))) + name=quoteattr(name), value=value)) output.append(kss_command_end) output.append(kss_response_footer) return ''.join(output) Modified: kukit/kss.base/trunk/kss/base/commands.txt ============================================================================== --- kukit/kss.base/trunk/kss/base/commands.txt (original) +++ kukit/kss.base/trunk/kss/base/commands.txt Thu Nov 8 11:13:26 2007 @@ -38,6 +38,15 @@ >>> commands.render() '...some value...some arg...' +The response is an XML document where each parameter value is put +within CDATA blocks. + + >>> commands.render() + '......' + +We are using CDATA because Firefox chops text nodes at 4KB blocks +(which makes the client side handling more difficult). + It is also possible to get a string representation of the commandset. This can be used in doctests like this. Modified: kukit/kss.base/trunk/kss/base/corecommands.txt ============================================================================== --- kukit/kss.base/trunk/kss/base/corecommands.txt (original) +++ kukit/kss.base/trunk/kss/base/corecommands.txt Thu Nov 8 11:13:26 2007 @@ -18,7 +18,7 @@ >>> core.replaceInnerHTML(css('div'), 'some <h1>html</h1>') >>> commands.render() - '...replaceInnerHTML...some &lt;h1&gt;html&lt;/h1&gt;...' + '...replaceInnerHTML......' ----------------- Node modification From gotcha at codespeak.net Thu Nov 8 20:31:47 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 20:31:47 +0100 (CET) Subject: [KSS-checkins] r48429 - kukit/kukit.js/tag/1.2.3 Message-ID: <20071108193147.5EB16810B@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 20:31:45 2007 New Revision: 48429 Added: kukit/kukit.js/tag/1.2.3/ - copied from r48428, kukit/kukit.js/branch/1.2/ Log: prepare for release From gotcha at codespeak.net Thu Nov 8 20:41:10 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 20:41:10 +0100 (CET) Subject: [KSS-checkins] r48430 - kukit/kukit.js/branch/1.2/doc Message-ID: <20071108194110.590478141@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 20:41:10 2007 New Revision: 48430 Modified: kukit/kukit.js/branch/1.2/doc/HISTORY.txt Log: release 1.2.3 Modified: kukit/kukit.js/branch/1.2/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/branch/1.2/doc/HISTORY.txt (original) +++ kukit/kukit.js/branch/1.2/doc/HISTORY.txt Thu Nov 8 20:41:10 2007 @@ -6,6 +6,13 @@ - ... +kukit.js - 1.2.3 Released 2007-11-08 + +kukit.js - 1.2.2 Released 2007-10-05 + + - Some code for FireKiss + [gotcha] + kukit.js - 1.2.1 Released 2007-09-10 - Fixed an issue that caused document:load fail From gotcha at codespeak.net Thu Nov 8 20:41:25 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 20:41:25 +0100 (CET) Subject: [KSS-checkins] r48431 - in kukit/kukit.js/tag/1.2.3: . doc Message-ID: <20071108194125.319E08144@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 20:41:24 2007 New Revision: 48431 Modified: kukit/kukit.js/tag/1.2.3/doc/HISTORY.txt kukit/kukit.js/tag/1.2.3/version.txt Log: release 1.2.3 Modified: kukit/kukit.js/tag/1.2.3/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/tag/1.2.3/doc/HISTORY.txt (original) +++ kukit/kukit.js/tag/1.2.3/doc/HISTORY.txt Thu Nov 8 20:41:24 2007 @@ -2,9 +2,12 @@ (name of developer listed in brackets) -kukit.js - 1.2dev Unreleased +kukit.js - 1.2.3 Released 2007-11-08 - - ... +kukit.js - 1.2.2 Released 2007-10-05 + + - Some code for FireKiss + [gotcha] kukit.js - 1.2.1 Released 2007-09-10 Modified: kukit/kukit.js/tag/1.2.3/version.txt ============================================================================== --- kukit/kukit.js/tag/1.2.3/version.txt (original) +++ kukit/kukit.js/tag/1.2.3/version.txt Thu Nov 8 20:41:24 2007 @@ -1 +1 @@ -1.2dev unreleased +1.2.3 released 2007-11-08 From gotcha at codespeak.net Thu Nov 8 20:41:40 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 20:41:40 +0100 (CET) Subject: [KSS-checkins] r48432 - kukit/kukit.js/tag/1.2.2 Message-ID: <20071108194140.E0A2B8142@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 20:41:40 2007 New Revision: 48432 Modified: kukit/kukit.js/tag/1.2.2/version.txt Log: fix 1.2.2 Modified: kukit/kukit.js/tag/1.2.2/version.txt ============================================================================== --- kukit/kukit.js/tag/1.2.2/version.txt (original) +++ kukit/kukit.js/tag/1.2.2/version.txt Thu Nov 8 20:41:40 2007 @@ -1 +1 @@ -1.2.1 released 2007-10-05 +1.2.2 released 2007-10-05 From gotcha at codespeak.net Thu Nov 8 20:44:50 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 20:44:50 +0100 (CET) Subject: [KSS-checkins] r48434 - kukit/kss.concatresource/tag/1.2.3 Message-ID: <20071108194450.A2C418141@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 20:44:50 2007 New Revision: 48434 Added: kukit/kss.concatresource/tag/1.2.3/ - copied from r48433, kukit/kss.concatresource/branch/1.2/ Log: prepare for release From gotcha at codespeak.net Thu Nov 8 20:51:04 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 20:51:04 +0100 (CET) Subject: [KSS-checkins] r48436 - in kukit/kss.concatresource/tag/1.2.3: . docs Message-ID: <20071108195104.BAE158142@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 20:51:04 2007 New Revision: 48436 Removed: kukit/kss.concatresource/tag/1.2.3/setup.cfg Modified: kukit/kss.concatresource/tag/1.2.3/docs/HISTORY.txt kukit/kss.concatresource/tag/1.2.3/setup.py Log: release 1.2.3 Modified: kukit/kss.concatresource/tag/1.2.3/docs/HISTORY.txt ============================================================================== --- kukit/kss.concatresource/tag/1.2.3/docs/HISTORY.txt (original) +++ kukit/kss.concatresource/tag/1.2.3/docs/HISTORY.txt Thu Nov 8 20:51:04 2007 @@ -2,9 +2,9 @@ (name of developer listed in brackets) -kss.concatresource - 1.2dev Unreleased +kss.concatresource - 1.2.3 Released 2007-11-08 - - ... +kss.concatresource - 1.2.2 Released 2007-10-05 kss.concatresource - 1.2.1 Released 2007-09-10 Deleted: /kukit/kss.concatresource/tag/1.2.3/setup.cfg ============================================================================== --- /kukit/kss.concatresource/tag/1.2.3/setup.cfg Thu Nov 8 20:51:04 2007 +++ (empty file) @@ -1,3 +0,0 @@ -[egg_info] -tag_build = dev -tag_svn_revision = true Modified: kukit/kss.concatresource/tag/1.2.3/setup.py ============================================================================== --- kukit/kss.concatresource/tag/1.2.3/setup.py (original) +++ kukit/kss.concatresource/tag/1.2.3/setup.py Thu Nov 8 20:51:04 2007 @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '1.2' +version = '1.2.3' setup(name='concatresource', version=version, From gotcha at codespeak.net Thu Nov 8 20:51:11 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 20:51:11 +0100 (CET) Subject: [KSS-checkins] r48437 - in kukit/kss.concatresource/branch/1.2: . docs Message-ID: <20071108195111.CED4C8146@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 20:51:11 2007 New Revision: 48437 Modified: kukit/kss.concatresource/branch/1.2/docs/HISTORY.txt kukit/kss.concatresource/branch/1.2/setup.py Log: release 1.2.3 Modified: kukit/kss.concatresource/branch/1.2/docs/HISTORY.txt ============================================================================== --- kukit/kss.concatresource/branch/1.2/docs/HISTORY.txt (original) +++ kukit/kss.concatresource/branch/1.2/docs/HISTORY.txt Thu Nov 8 20:51:11 2007 @@ -6,6 +6,10 @@ - ... +kss.concatresource - 1.2.3 Released 2007-11-08 + +kss.concatresource - 1.2.2 Released 2007-10-05 + kss.concatresource - 1.2.1 Released 2007-09-10 - Prepare for release Modified: kukit/kss.concatresource/branch/1.2/setup.py ============================================================================== --- kukit/kss.concatresource/branch/1.2/setup.py (original) +++ kukit/kss.concatresource/branch/1.2/setup.py Thu Nov 8 20:51:11 2007 @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '1.2' +version = '1.2-dev' setup(name='concatresource', version=version, From gotcha at codespeak.net Thu Nov 8 20:52:09 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 20:52:09 +0100 (CET) Subject: [KSS-checkins] r48438 - kukit/kss.core/tag/1.2.3 Message-ID: <20071108195209.E1B3080D8@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 20:52:09 2007 New Revision: 48438 Added: kukit/kss.core/tag/1.2.3/ - copied from r48437, kukit/kss.core/branch/1.2/ Log: prepare for release From gotcha at codespeak.net Thu Nov 8 21:01:54 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 21:01:54 +0100 (CET) Subject: [KSS-checkins] r48440 - in kukit/kss.core/branch/1.2: . docs Message-ID: <20071108200154.5AA0C814B@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 21:01:53 2007 New Revision: 48440 Modified: kukit/kss.core/branch/1.2/docs/HISTORY.txt kukit/kss.core/branch/1.2/setup.py Log: release 1.2.3 Modified: kukit/kss.core/branch/1.2/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/branch/1.2/docs/HISTORY.txt (original) +++ kukit/kss.core/branch/1.2/docs/HISTORY.txt Thu Nov 8 21:01:53 2007 @@ -6,6 +6,13 @@ - ... +kss.core - 1.2.3 Released 2007-11-08 + +kss.core - 1.2.2 Released 2007-10-05 + + - some code for firekiss + [gotcha] + kss.core - 1.2.1 Released 2007-09-10 - Prepare for release. Modified: kukit/kss.core/branch/1.2/setup.py ============================================================================== --- kukit/kss.core/branch/1.2/setup.py (original) +++ kukit/kss.core/branch/1.2/setup.py Thu Nov 8 21:01:53 2007 @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import sys, os -version = '1.2' +version = '1.2-dev' setup(name='kss.core', version=version, From gotcha at codespeak.net Thu Nov 8 21:02:05 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 21:02:05 +0100 (CET) Subject: [KSS-checkins] r48441 - in kukit/kss.core/tag/1.2.3: . docs kss/core kss/core/pluginregistry Message-ID: <20071108200205.0D566814B@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 21:02:04 2007 New Revision: 48441 Removed: kukit/kss.core/tag/1.2.3/setup.cfg Modified: kukit/kss.core/tag/1.2.3/docs/HISTORY.txt kukit/kss.core/tag/1.2.3/kss/core/ (props changed) kukit/kss.core/tag/1.2.3/kss/core/EXTERNALS.TXT kukit/kss.core/tag/1.2.3/kss/core/pluginregistry/ (props changed) kukit/kss.core/tag/1.2.3/kss/core/pluginregistry/EXTERNALS.TXT kukit/kss.core/tag/1.2.3/setup.py Log: release 1.2.3 Modified: kukit/kss.core/tag/1.2.3/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/tag/1.2.3/docs/HISTORY.txt (original) +++ kukit/kss.core/tag/1.2.3/docs/HISTORY.txt Thu Nov 8 21:02:04 2007 @@ -2,9 +2,12 @@ (name of developer listed in brackets) -kss.core - 1.2dev Unreleased +kss.core - 1.2.3 Released 2007-11-08 - - ... +kss.core - 1.2.2 Released 2007-10-05 + + - some code for firekiss + [gotcha] kss.core - 1.2.1 Released 2007-09-10 Modified: kukit/kss.core/tag/1.2.3/kss/core/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/tag/1.2.3/kss/core/EXTERNALS.TXT (original) +++ kukit/kss.core/tag/1.2.3/kss/core/EXTERNALS.TXT Thu Nov 8 21:02:04 2007 @@ -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.2 +kukit http://codespeak.net/svn/kukit/kukit.js/tag/1.2.3 Modified: kukit/kss.core/tag/1.2.3/kss/core/pluginregistry/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/tag/1.2.3/kss/core/pluginregistry/EXTERNALS.TXT (original) +++ kukit/kss.core/tag/1.2.3/kss/core/pluginregistry/EXTERNALS.TXT Thu Nov 8 21:02:04 2007 @@ -7,4 +7,4 @@ # # concatresource is now included like as batteries -_concatresource https://codespeak.net/svn/kukit/kss.concatresource/branch/1.2/kss/concatresource +_concatresource https://codespeak.net/svn/kukit/kss.concatresource/tag/1.2.3/kss/concatresource Deleted: /kukit/kss.core/tag/1.2.3/setup.cfg ============================================================================== --- /kukit/kss.core/tag/1.2.3/setup.cfg Thu Nov 8 21:02:04 2007 +++ (empty file) @@ -1,3 +0,0 @@ -[egg_info] -tag_build = dev -tag_svn_revision = true Modified: kukit/kss.core/tag/1.2.3/setup.py ============================================================================== --- kukit/kss.core/tag/1.2.3/setup.py (original) +++ kukit/kss.core/tag/1.2.3/setup.py Thu Nov 8 21:02:04 2007 @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import sys, os -version = '1.2' +version = '1.2.3' setup(name='kss.core', version=version, From gotcha at codespeak.net Thu Nov 8 21:18:35 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 21:18:35 +0100 (CET) Subject: [KSS-checkins] r48442 - kukit/kss.core/tag/1.2.3/kss/core Message-ID: <20071108201835.96E9D8135@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 21:18:33 2007 New Revision: 48442 Modified: kukit/kss.core/tag/1.2.3/kss/core/version.txt Log: finish 1.2.3 Modified: kukit/kss.core/tag/1.2.3/kss/core/version.txt ============================================================================== --- kukit/kss.core/tag/1.2.3/kss/core/version.txt (original) +++ kukit/kss.core/tag/1.2.3/kss/core/version.txt Thu Nov 8 21:18:33 2007 @@ -1 +1 @@ -1.2dev unreleased +1.2.3 released 2007-11-08 From gotcha at codespeak.net Thu Nov 8 21:19:28 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 21:19:28 +0100 (CET) Subject: [KSS-checkins] r48443 - kukit/kss.concatresource/branch/1.2/kss/concatresource Message-ID: <20071108201928.0FEAF8135@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 21:19:28 2007 New Revision: 48443 Modified: kukit/kss.concatresource/branch/1.2/kss/concatresource/version.txt Log: fix 1.2 Modified: kukit/kss.concatresource/branch/1.2/kss/concatresource/version.txt ============================================================================== --- kukit/kss.concatresource/branch/1.2/kss/concatresource/version.txt (original) +++ kukit/kss.concatresource/branch/1.2/kss/concatresource/version.txt Thu Nov 8 21:19:28 2007 @@ -1 +1 @@ -1.2.2 released 2007-10-05 +1.2dev Unreleased From gotcha at codespeak.net Thu Nov 8 21:19:55 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 21:19:55 +0100 (CET) Subject: [KSS-checkins] r48445 - kukit/kss.concatresource/tag/1.2.2/kss/concatresource Message-ID: <20071108201955.1D67E8141@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 21:19:54 2007 New Revision: 48445 Modified: kukit/kss.concatresource/tag/1.2.2/kss/concatresource/version.txt Log: fix 1.2.2 Modified: kukit/kss.concatresource/tag/1.2.2/kss/concatresource/version.txt ============================================================================== --- kukit/kss.concatresource/tag/1.2.2/kss/concatresource/version.txt (original) +++ kukit/kss.concatresource/tag/1.2.2/kss/concatresource/version.txt Thu Nov 8 21:19:54 2007 @@ -1 +1 @@ -1.2dev Unreleased +1.2.2 released 2007-10-05 From gotcha at codespeak.net Thu Nov 8 21:22:24 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 8 Nov 2007 21:22:24 +0100 (CET) Subject: [KSS-checkins] r48446 - kukit/kss.concatresource/tag/1.2.3/kss/concatresource Message-ID: <20071108202224.D4A138141@code0.codespeak.net> Author: gotcha Date: Thu Nov 8 21:22:24 2007 New Revision: 48446 Modified: kukit/kss.concatresource/tag/1.2.3/kss/concatresource/version.txt Log: finish 1.2.3 Modified: kukit/kss.concatresource/tag/1.2.3/kss/concatresource/version.txt ============================================================================== --- kukit/kss.concatresource/tag/1.2.3/kss/concatresource/version.txt (original) +++ kukit/kss.concatresource/tag/1.2.3/kss/concatresource/version.txt Thu Nov 8 21:22:24 2007 @@ -1 +1 @@ -1.2.2 released 2007-10-05 +1.2.3 released 2007-11-08 From jvloothuis at codespeak.net Sat Nov 10 01:32:47 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 10 Nov 2007 01:32:47 +0100 (CET) Subject: [KSS-checkins] r48487 - kukit/kss.base/branches Message-ID: <20071110003247.31FAD815E@code0.codespeak.net> Author: jvloothuis Date: Sat Nov 10 01:32:46 2007 New Revision: 48487 Added: kukit/kss.base/branches/ Log: new branches folder From jvloothuis at codespeak.net Sat Nov 10 01:34:11 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 10 Nov 2007 01:34:11 +0100 (CET) Subject: [KSS-checkins] r48488 - kukit/kss.base/branches/basehttpserver-functional-testing Message-ID: <20071110003411.5457B815E@code0.codespeak.net> Author: jvloothuis Date: Sat Nov 10 01:34:11 2007 New Revision: 48488 Added: kukit/kss.base/branches/basehttpserver-functional-testing/ - copied from r48487, kukit/kss.base/trunk/ Log: New branch for creating a kss demo/testing system based on BaseHTTPServer From jvloothuis at codespeak.net Sat Nov 10 01:36:25 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 10 Nov 2007 01:36:25 +0100 (CET) Subject: [KSS-checkins] r48489 - kukit/kss.base/branches/basehttpserver-functional-testing/kss/base Message-ID: <20071110003625.B47CC815E@code0.codespeak.net> Author: jvloothuis Date: Sat Nov 10 01:36:25 2007 New Revision: 48489 Added: kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/testing.py Modified: kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/config.py Log: Added basic prototype (not working fully yet) Modified: kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/config.py ============================================================================== --- kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/config.py (original) +++ kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/config.py Sat Nov 10 01:36:25 2007 @@ -4,6 +4,8 @@ from kss.base.corecommands import KSSCoreCommands from kss.base.coreselectors import css, htmlid, samenode, parentnode +from kss.base.testing import Section, Test + kukit_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'kukit') # Define the Javascripts by hand to ensure the order @@ -48,3 +50,9 @@ selectors = [css, htmlid, samenode, parentnode] + functional_tests = [Test( + name='Focus', + html='/tmp/kss_demo.html', + css='/tmp/demo.css', + kss='blah.kss', + handler=lambda request: 'ok')] Added: kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/testing.py ============================================================================== --- (empty file) +++ kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/testing.py Sat Nov 10 01:36:25 2007 @@ -0,0 +1,147 @@ +import string +from kss.base.plugin import activated_plugins +from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler + +front_page = ''' + + +

Tests for the activated plugins

+ +$plugins + + + +''' + +plugin_html = ''' +

$id

+
    +$tests +
+''' + +test_html = ''' +
  • $name
  • +''' + +test_page_html = ''' + + + + + + + $html + + +''' + +class PluginTestsuiteRequestHandler(BaseHTTPRequestHandler): + + def do_GET(self): + path = self.path + if path == '/': + return self.do_index() + elif path.endswith('.html'): + return self.do_test_html() + else: + return self.do_test_css() + + def send_html_headers(self): + self.send_response(200) + self.send_header('Content-type', 'text/html') + self.end_headers() + + def name_to_url_safe(self, name): + return name.replace(' ', '-') + + def css_url(self, plugin_id, test): + return self.test_base_url(plugin_id, test) + '.css' + + def kss_url(self, plugin_id, test): + return self.test_base_url(plugin_id, test) + '.kss' + + def html_url(self, plugin_id, test): + return self.test_base_url(plugin_id, test) + '.html' + + def test_base_url(self, plugin_id, test): + return '/%s/%s' % (self.name_to_url_safe(plugin_id), + self.name_to_url_safe(test.name)) + + def load_from_path(self, extension): + parts = self.path[:-len(extension)].split('/') + print parts + for id, plugin in activated_plugins(): + if parts[1] == id: + for test in plugin.functional_tests: + if self.name_to_url_safe(test.name) == parts[2]: + return (id, plugin, test) + + def do_test_css(self): + self.send_response(200) + self.send_header('Content-Type', 'text/css') + self.end_headers() + + id, plugin, test = self.load_from_path('.css') + + self.wfile.write(open(test.css).read()) + self.wfile.close() + + def do_test_html(self): + self.send_html_headers() + + html = string.Template(test_page_html) + id, plugin, test = self.load_from_path('.html') + self.wfile.write(html.substitute( + css_url=self.css_url(id, test), + kss_url=self.kss_url(id, test), + html=open(test.html).read())) + self.wfile.close() + + def do_index(self): + self.send_html_headers() + + html = string.Template(front_page) + plugins_html = [] + for id, plugin in activated_plugins(): + plugins_html.append(self.plugin_section(id, plugin)) + + phtml = ''.join(plugins_html) + self.wfile.write(html.substitute(plugins=phtml)) + self.wfile.close() + + def plugin_section(self, id, plugin): + html = string.Template(plugin_html) + tests_html = [] + for test in plugin.functional_tests: + tests_html.append(self.test_section(id, plugin, test)) + return html.substitute(id=id, tests=''.join(tests_html)) + + def test_section(self, plugin_id, plugin, test): + html = string.Template(test_html) + url = self.html_url(plugin_id, test) + return html.substitute(name=test.name, url=url) + + +def create_test_server(port=8000): + return HTTPServer(('', port), PluginTestsuiteRequestHandler) + + +class Section(object): + def __init__(self, name, tests): + self.name = name + self.tests = tests + +class Test(object): + def __init__(self, name, html, css, kss, handler): + self.name = name + self.html = html + self.css = css + self.kss = kss + self.handler = handler + + +if __name__ == '__main__': + from kss.base import load_plugins + load_plugins('kss-core') + create_test_server().serve_forever() From jvloothuis at codespeak.net Sat Nov 10 14:04:08 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 10 Nov 2007 14:04:08 +0100 (CET) Subject: [KSS-checkins] r48504 - in kukit/kss.zope/trunk/kss/zope: . tests Message-ID: <20071110130408.75CB6816A@code0.codespeak.net> Author: jvloothuis Date: Sat Nov 10 14:04:07 2007 New Revision: 48504 Added: kukit/kss.zope/trunk/kss/zope/registry.py kukit/kss.zope/trunk/kss/zope/registry.txt kukit/kss.zope/trunk/kss/zope/tests/ kukit/kss.zope/trunk/kss/zope/tests/__init__.py kukit/kss.zope/trunk/kss/zope/tests/test_globalregistry.py Modified: kukit/kss.zope/trunk/kss/zope/configure.zcml kukit/kss.zope/trunk/kss/zope/interfaces.py Log: Added a global utility which provides a way for querying the available plugins and their resources. Modified: kukit/kss.zope/trunk/kss/zope/configure.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/zope/configure.zcml (original) +++ kukit/kss.zope/trunk/kss/zope/configure.zcml Sat Nov 10 14:04:07 2007 @@ -1,2 +1,6 @@ + + + Modified: kukit/kss.zope/trunk/kss/zope/interfaces.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/interfaces.py (original) +++ kukit/kss.zope/trunk/kss/zope/interfaces.py Sat Nov 10 14:04:07 2007 @@ -17,6 +17,32 @@ from zope.interface import Interface, Attribute + +class IKSSPluginRegistry(Interface): + '''This registry can query the activate plugins and their + resources. + ''' + + def plugins(): + '''Returns an iterator with all activate plugins. + + Each item from the iterator is a tuple with (id, plugin_config).''' + + def javascripts(): + '''Return an iterable of filenames for all Javascripts. + + The Javascripts are loaded from the registrations of activate plugins.''' + + def extra_javascripts(): + '''Return an iterable of filenames for all extra Javascripts. + + The extra Javascripts are loaded from the registrations of activate plugins.''' + + def lookup_commandset(id): + '''Return a commandset class for the given id''' + + +# from kss.core class IKSSCommands(Interface): 'KSS commands' Added: kukit/kss.zope/trunk/kss/zope/registry.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/zope/registry.py Sat Nov 10 14:04:07 2007 @@ -0,0 +1,24 @@ +from zope import interface +from kss.base.plugin import activated_plugins + +from kss.zope.interfaces import IKSSPluginRegistry + +class GlobalPluginRegistry(object): + interface.implements(IKSSPluginRegistry) + + def plugins(self): + return activated_plugins() + + def javascripts(self): + for id, config in self.plugins(): + for javascript in config.javascripts: + yield javascript + + def extra_javascripts(self): + for id, config in self.plugins(): + for extra_javascript in config.extra_javascripts: + yield extra_javascript + + + def lookup_commandset(self, id): + pass Added: kukit/kss.zope/trunk/kss/zope/registry.txt ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/zope/registry.txt Sat Nov 10 14:04:07 2007 @@ -0,0 +1,61 @@ +Plugin registries +================= + +The plugin registries keep track of all available plugins. They also +have a few methods for getting resources from the plugins. + + +Global registry +=============== + +We ship with a default global registry. + + >>> from kss.zope.registry import GlobalPluginRegistry + +All registries should implement the IKSSPluginRegistry interface. + + >>> from kss.zope.interfaces import IKSSPluginRegistry + >>> IKSSPluginRegistry.implementedBy(GlobalPluginRegistry) + True + +No arguments are need to create the registry. + + >>> registry = GlobalPluginRegistry() + +When we set it up all its methods should return the appropriate empty +values. The examples below demonstrate the basic querying methods +available. + + >>> list(registry.plugins()) + [] + + >>> list(registry.javascripts()) + [] + + >>> list(registry.extra_javascripts()) + [] + +Since we depend on `kss.base` which has a plugin called `kss-core` we +can use this to setup a more interesting registry. + + >>> from kss.base import load_plugins + >>> load_plugins('kss-core') + +This should have activated the core plugin. Now let's look at the +results. + + >>> list(registry.plugins()) + [('kss-core', )] + + >>> list(registry.javascripts()) + ['.../kukit/utils.js', '.../kukit/errors.js', ...] + + + >>> list(registry.extra_javascripts()) + ['.../3rd_party/base2-dom-fp.js', '.../3rd_party/sarissa.js'] + +Now we will unload the plugin again to clean up. + + >>> from kss.base.plugin import unload_plugins + >>> unload_plugins('kss-core') + Added: kukit/kss.zope/trunk/kss/zope/tests/__init__.py ============================================================================== Added: kukit/kss.zope/trunk/kss/zope/tests/test_globalregistry.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/zope/tests/test_globalregistry.py Sat Nov 10 14:04:07 2007 @@ -0,0 +1,12 @@ +import unittest + +from zope.testing import doctest + +def test_suite(): + return unittest.TestSuite([ + doctest.DocFileSuite( + 'registry.txt', + package='kss.zope', + optionflags=doctest.ELLIPSIS|doctest.REPORT_ONLY_FIRST_FAILURE, +) + ]) From reebalazs at codespeak.net Sat Nov 10 16:44:16 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 10 Nov 2007 16:44:16 +0100 (CET) Subject: [KSS-checkins] r48509 - kukit/buildout/kss.zope/transition Message-ID: <20071110154416.B3A1481C3@code0.codespeak.net> Author: reebalazs Date: Sat Nov 10 16:44:15 2007 New Revision: 48509 Added: kukit/buildout/kss.zope/transition/ (props changed) kukit/buildout/kss.zope/transition/EXTERNALS.txt Log: Add dir Added: kukit/buildout/kss.zope/transition/EXTERNALS.txt ============================================================================== --- (empty file) +++ kukit/buildout/kss.zope/transition/EXTERNALS.txt Sat Nov 10 16:44:15 2007 @@ -0,0 +1,2 @@ +kss.demo https://codespeak.net/svn/kukit/kss.demo/trunk +kss.zope https://codespeak.net/svn/kukit/kss.zope/trunk From reebalazs at codespeak.net Sat Nov 10 17:59:38 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 10 Nov 2007 17:59:38 +0100 (CET) Subject: [KSS-checkins] r48516 - kukit/kss.demo/branch/kss-zope-transition Message-ID: <20071110165938.B7F4A817D@code0.codespeak.net> Author: reebalazs Date: Sat Nov 10 17:59:37 2007 New Revision: 48516 Added: kukit/kss.demo/branch/kss-zope-transition/ - copied from r48515, kukit/kss.demo/trunk/ Log: Branch off From reebalazs at codespeak.net Sat Nov 10 18:11:40 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 10 Nov 2007 18:11:40 +0100 (CET) Subject: [KSS-checkins] r48517 - kukit/kss.demo/branch/kss-zope-transition Message-ID: <20071110171140.396A481FC@code0.codespeak.net> Author: reebalazs Date: Sat Nov 10 18:11:39 2007 New Revision: 48517 Modified: kukit/kss.demo/branch/kss-zope-transition/setup.py Log: Remove egg dependancy to kss.core Modified: kukit/kss.demo/branch/kss-zope-transition/setup.py ============================================================================== --- kukit/kss.demo/branch/kss-zope-transition/setup.py (original) +++ kukit/kss.demo/branch/kss-zope-transition/setup.py Sat Nov 10 18:11:39 2007 @@ -26,12 +26,13 @@ zip_safe=False, install_requires=[ # -*- Extra requirements: -*- - 'kss.core>=dev', +# Do not depend on anything right now. +## 'kss.core>=dev', ], entry_points=""" # -*- Entry points: -*- """, dependency_links=[ - 'https://codespeak.net/svn/kukit/kss.core/trunk#egg=kss.core-dev', +## 'https://codespeak.net/svn/kukit/kss.core/trunk#egg=kss.core-dev', ], ) From reebalazs at codespeak.net Sat Nov 10 18:20:29 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 10 Nov 2007 18:20:29 +0100 (CET) Subject: [KSS-checkins] r48519 - kukit/kss.zope/trunk Message-ID: <20071110172029.9FCBC8202@code0.codespeak.net> Author: reebalazs Date: Sat Nov 10 18:20:29 2007 New Revision: 48519 Modified: kukit/kss.zope/trunk/setup.py Log: Add egg dependency to kss.base Modified: kukit/kss.zope/trunk/setup.py ============================================================================== --- kukit/kss.zope/trunk/setup.py (original) +++ kukit/kss.zope/trunk/setup.py Sat Nov 10 18:20:29 2007 @@ -25,6 +25,7 @@ include_package_data=True, zip_safe=False, install_requires=[ + 'kss.base>=dev', 'setuptools', ], entry_points=""" From reebalazs at codespeak.net Sat Nov 10 18:25:34 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 10 Nov 2007 18:25:34 +0100 (CET) Subject: [KSS-checkins] r48520 - in kukit/buildout/kss.zope: . src transition Message-ID: <20071110172534.6AA9380DF@code0.codespeak.net> Author: reebalazs Date: Sat Nov 10 18:25:33 2007 New Revision: 48520 Modified: kukit/buildout/kss.zope/base.cfg kukit/buildout/kss.zope/src/ (props changed) kukit/buildout/kss.zope/src/EXTERNALS.txt kukit/buildout/kss.zope/transition/ (props changed) kukit/buildout/kss.zope/transition/EXTERNALS.txt Log: Update config. Add transitional packages. Modified: kukit/buildout/kss.zope/base.cfg ============================================================================== --- kukit/buildout/kss.zope/base.cfg (original) +++ kukit/buildout/kss.zope/base.cfg Sat Nov 10 18:25:33 2007 @@ -21,7 +21,8 @@ src/Products.SecureMailHost src/Products.statusmessages src/archetypes.kss - src/kss.core +# this is disabled, we use transition package +## src/kss.core src/plone.app.contentmenu src/plone.app.content src/plone.app.contentrules @@ -53,7 +54,10 @@ src/wicked src/five.customerize src/five.localsitemanager - +# + transition/kss.base + transition/kss.zope + transition/kss.demo [zope2] recipe = plone.recipe.zope2install @@ -84,7 +88,7 @@ Products.SecureMailHost Products.statusmessages archetypes.kss - kss.core +# kss.core plone.app.contentmenu plone.app.content plone.app.contentrules @@ -116,7 +120,15 @@ wicked five.customerize five.localsitemanager - +# + kss.base + kss.zope + kss.demo + +zcml = + kss.zope +# XXX to be enabled if fixed. +# kss.demo [zopepy] recipe = zc.recipe.egg Modified: kukit/buildout/kss.zope/src/EXTERNALS.txt ============================================================================== --- kukit/buildout/kss.zope/src/EXTERNALS.txt (original) +++ kukit/buildout/kss.zope/src/EXTERNALS.txt Sat Nov 10 18:25:33 2007 @@ -17,7 +17,8 @@ # kss related packages archetypes.kss https://svn.plone.org/svn/archetypes/archetypes.kss/trunk -kss.core https://codespeak.net/svn/kukit/kss.core/trunk +# Disabled in favour of transition: +##kss.core https://codespeak.net/svn/kukit/kss.core/trunk # plone.* packages plone.contentrules https://svn.plone.org/svn/plone/plone.contentrules/trunk Modified: kukit/buildout/kss.zope/transition/EXTERNALS.txt ============================================================================== --- kukit/buildout/kss.zope/transition/EXTERNALS.txt (original) +++ kukit/buildout/kss.zope/transition/EXTERNALS.txt Sat Nov 10 18:25:33 2007 @@ -1,2 +1,4 @@ -kss.demo https://codespeak.net/svn/kukit/kss.demo/trunk kss.zope https://codespeak.net/svn/kukit/kss.zope/trunk +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 From reebalazs at codespeak.net Sat Nov 10 19:01:29 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 10 Nov 2007 19:01:29 +0100 (CET) Subject: [KSS-checkins] r48523 - kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser Message-ID: <20071110180129.41BE581E6@code0.codespeak.net> Author: reebalazs Date: Sat Nov 10 19:01:28 2007 New Revision: 48523 Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure.zcml Log: strange issue of complaining for lack of zope.View Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure.zcml ============================================================================== --- kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure.zcml (original) +++ kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure.zcml Sat Nov 10 19:01:28 2007 @@ -4,6 +4,20 @@ i18n_domain="kss" > + + + @@ -43,14 +57,14 @@ for="kss.demo.interfaces.ISimpleContent" template="header_macros.pt" name="header_macros" - permission="zope.View" + permission="zope.Public" /> From reebalazs at codespeak.net Sat Nov 10 19:02:10 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 10 Nov 2007 19:02:10 +0100 (CET) Subject: [KSS-checkins] r48524 - kukit/buildout/kss.zope Message-ID: <20071110180210.9571681FA@code0.codespeak.net> Author: reebalazs Date: Sat Nov 10 19:02:10 2007 New Revision: 48524 Modified: kukit/buildout/kss.zope/base.cfg Log: Adding kss.demo slug Modified: kukit/buildout/kss.zope/base.cfg ============================================================================== --- kukit/buildout/kss.zope/base.cfg (original) +++ kukit/buildout/kss.zope/base.cfg Sat Nov 10 19:02:10 2007 @@ -127,8 +127,7 @@ zcml = kss.zope -# XXX to be enabled if fixed. -# kss.demo + kss.demo [zopepy] recipe = zc.recipe.egg From reebalazs at codespeak.net Sun Nov 11 08:54:01 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 08:54:01 +0100 (CET) Subject: [KSS-checkins] r48535 - in kukit/kss.zope/trunk/kss: core core_future Message-ID: <20071111075401.7E3258173@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 08:54:00 2007 New Revision: 48535 Added: kukit/kss.zope/trunk/kss/core_future/ - copied from r48512, kukit/kss.zope/trunk/kss/core/ Removed: kukit/kss.zope/trunk/kss/core/ Log: Save the compatibility layer for the future From reebalazs at codespeak.net Sun Nov 11 08:55:30 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 08:55:30 +0100 (CET) Subject: [KSS-checkins] r48536 - kukit/kss.zope/trunk/kss/core Message-ID: <20071111075530.EF0588173@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 08:55:30 2007 New Revision: 48536 Added: kukit/kss.zope/trunk/kss/core/ - copied from r48535, kukit/kss.core/trunk/kss/core/ Log: Copy a full kss.core to trim over later From reebalazs at codespeak.net Sun Nov 11 08:59:44 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 08:59:44 +0100 (CET) Subject: [KSS-checkins] r48537 - kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser Message-ID: <20071111075944.EAD9D8173@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 08:59:44 2007 New Revision: 48537 Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure.zcml Log: Revert the previous change that was needed because missing bit from kss.core Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure.zcml ============================================================================== --- kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure.zcml (original) +++ kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure.zcml Sun Nov 11 08:59:44 2007 @@ -4,20 +4,6 @@ i18n_domain="kss" > - - - @@ -57,14 +43,14 @@ for="kss.demo.interfaces.ISimpleContent" template="header_macros.pt" name="header_macros" - permission="zope.Public" + permission="zope.View" /> From reebalazs at codespeak.net Sun Nov 11 09:06:04 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 09:06:04 +0100 (CET) Subject: [KSS-checkins] r48538 - kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource Message-ID: <20071111080604.C742D8173@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 09:06:04 2007 New Revision: 48538 Added: kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/ - copied from r48537, kukit/kss.concatresource/trunk/kss/concatresource/ Log: Smash concatresource into the dummy From reebalazs at codespeak.net Sun Nov 11 09:06:27 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 09:06:27 +0100 (CET) Subject: [KSS-checkins] r48539 - kukit/kss.zope/trunk/kss/core/pluginregistry Message-ID: <20071111080627.3D63D81FA@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 09:06:26 2007 New Revision: 48539 Removed: kukit/kss.zope/trunk/kss/core/pluginregistry/EXTERNALS.TXT Modified: kukit/kss.zope/trunk/kss/core/pluginregistry/ (props changed) Log: Remove externals Deleted: /kukit/kss.zope/trunk/kss/core/pluginregistry/EXTERNALS.TXT ============================================================================== --- /kukit/kss.zope/trunk/kss/core/pluginregistry/EXTERNALS.TXT Sun Nov 11 09:06:26 2007 +++ (empty file) @@ -1,10 +0,0 @@ -# -# results of svn propget svn:externals -# http://codespeak.net/svn/kukit/azax/trunk/plugins -# -# You can update your working dir by: -# svn propset svn:externals -F EXTERNALS.TXT . -# - -# concatresource is now included like as batteries -_concatresource https://codespeak.net/svn/kukit/kss.concatresource/trunk/kss/concatresource From jvloothuis at codespeak.net Sun Nov 11 09:15:20 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 11 Nov 2007 09:15:20 +0100 (CET) Subject: [KSS-checkins] r48540 - kukit/buildout/kss.zope Message-ID: <20071111081520.AA5D58242@code0.codespeak.net> Author: jvloothuis Date: Sun Nov 11 09:15:18 2007 New Revision: 48540 Modified: kukit/buildout/kss.zope/base.cfg Log: Minor cleanups Modified: kukit/buildout/kss.zope/base.cfg ============================================================================== --- kukit/buildout/kss.zope/base.cfg (original) +++ kukit/buildout/kss.zope/base.cfg Sun Nov 11 09:15:18 2007 @@ -21,8 +21,6 @@ src/Products.SecureMailHost src/Products.statusmessages src/archetypes.kss -# this is disabled, we use transition package -## src/kss.core src/plone.app.contentmenu src/plone.app.content src/plone.app.contentrules @@ -54,7 +52,6 @@ src/wicked src/five.customerize src/five.localsitemanager -# transition/kss.base transition/kss.zope transition/kss.demo @@ -88,7 +85,6 @@ Products.SecureMailHost Products.statusmessages archetypes.kss -# kss.core plone.app.contentmenu plone.app.content plone.app.contentrules @@ -120,10 +116,9 @@ wicked five.customerize five.localsitemanager -# - kss.base - kss.zope - kss.demo + kss.base + kss.zope + kss.demo zcml = kss.zope From jvloothuis at codespeak.net Sun Nov 11 09:24:06 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 11 Nov 2007 09:24:06 +0100 (CET) Subject: [KSS-checkins] r48541 - kukit/kss.demo/branch/kss-zope-transition/kss/demo Message-ID: <20071111082406.6A7588201@code0.codespeak.net> Author: jvloothuis Date: Sun Nov 11 09:24:05 2007 New Revision: 48541 Added: kukit/kss.demo/branch/kss-zope-transition/kss/demo/configure-z3.zcml Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/configure.zcml Log: Remove have_five etc. from the configure and made to seperate configures, one for Zope 3 and one for Zope 2. This avoids breakage on the Zope trunk. Added: kukit/kss.demo/branch/kss-zope-transition/kss/demo/configure-z3.zcml ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/kss-zope-transition/kss/demo/configure-z3.zcml Sun Nov 11 09:24:05 2007 @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/configure.zcml ============================================================================== --- kukit/kss.demo/branch/kss-zope-transition/kss/demo/configure.zcml (original) +++ kukit/kss.demo/branch/kss-zope-transition/kss/demo/configure.zcml Sun Nov 11 09:24:05 2007 @@ -8,9 +8,6 @@ - - - - - - - - - - - - - - - - - From jvloothuis at codespeak.net Sun Nov 11 09:34:19 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 11 Nov 2007 09:34:19 +0100 (CET) Subject: [KSS-checkins] r48542 - kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser Message-ID: <20071111083419.0672D8244@code0.codespeak.net> Author: jvloothuis Date: Sun Nov 11 09:34:19 2007 New Revision: 48542 Added: kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure-z3.zcml Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure.zcml Log: Remove have_five etc. from the configure and made to seperate configures, one for Zope 3 and one for Zope 2. This avoids breakage on the Zope trunk. Added: kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure-z3.zcml ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure-z3.zcml Sun Nov 11 09:34:19 2007 @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure.zcml ============================================================================== --- kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure.zcml (original) +++ kukit/kss.demo/branch/kss-zope-transition/kss/demo/browser/configure.zcml Sun Nov 11 09:34:19 2007 @@ -8,9 +8,6 @@ Define resources for the demo central --> - - - - - - - - - - - Author: reebalazs Date: Sun Nov 11 09:37:06 2007 New Revision: 48543 Removed: kukit/kss.demo/branch/kss-zope-transition/kss/demo/EXTERNALS.TXT Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/ (props changed) Log: Get rid of configfeature Deleted: /kukit/kss.demo/branch/kss-zope-transition/kss/demo/EXTERNALS.TXT ============================================================================== --- /kukit/kss.demo/branch/kss-zope-transition/kss/demo/EXTERNALS.TXT Sun Nov 11 09:37:06 2007 +++ (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 From jvloothuis at codespeak.net Sun Nov 11 09:57:04 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 11 Nov 2007 09:57:04 +0100 (CET) Subject: [KSS-checkins] r48544 - kukit/kss.base/trunk/kss/base Message-ID: <20071111085704.0DD4C8249@code0.codespeak.net> Author: jvloothuis Date: Sun Nov 11 09:57:03 2007 New Revision: 48544 Modified: kukit/kss.base/trunk/kss/base/plugin.py kukit/kss.base/trunk/kss/base/plugin.txt Log: Added a function to get all available plugins. This can be used to query them regardless of their activation state. Modified: kukit/kss.base/trunk/kss/base/plugin.py ============================================================================== --- kukit/kss.base/trunk/kss/base/plugin.py (original) +++ kukit/kss.base/trunk/kss/base/plugin.py Sun Nov 11 09:57:03 2007 @@ -47,7 +47,11 @@ def file_below_module(mod, subpath): return os.path.join(module_path(mod), *subpath.split('/')) - +def available_plugins(): + for entry_point in iter_entry_points('kss.plugin'): + plugin_factory = entry_point.load() + plugin = plugin_factory() + yield entry_point.name, plugin def load_plugins(*names): def load(name): Modified: kukit/kss.base/trunk/kss/base/plugin.txt ============================================================================== --- kukit/kss.base/trunk/kss/base/plugin.txt (original) +++ kukit/kss.base/trunk/kss/base/plugin.txt Sun Nov 11 09:57:03 2007 @@ -116,3 +116,19 @@ Traceback (most recent call last): ... ValueError: Path is not a directory: .../kss/base/__init__.py + + +All available plugins +--------------------- + +You might want to list all available plugins regardless of their +activation state. This can be done using the `available_plugins` +function. + + >>> 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. + + >>> list(available_plugins()) + [('kss-core', Author: jvloothuis Date: Sun Nov 11 09:58:21 2007 New Revision: 48545 Modified: kukit/kss.zope/trunk/kss/zope/registry.py kukit/kss.zope/trunk/kss/zope/registry.txt Log: Change the lookup of plugins to use the new kss.base available_plugins function. This will always list all available plugins (without regards for being activated or not). Modified: kukit/kss.zope/trunk/kss/zope/registry.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.py (original) +++ kukit/kss.zope/trunk/kss/zope/registry.py Sun Nov 11 09:58:21 2007 @@ -1,5 +1,5 @@ from zope import interface -from kss.base.plugin import activated_plugins +from kss.base.plugin import available_plugins from kss.zope.interfaces import IKSSPluginRegistry @@ -7,7 +7,7 @@ interface.implements(IKSSPluginRegistry) def plugins(self): - return activated_plugins() + return available_plugins() def javascripts(self): for id, config in self.plugins(): Modified: kukit/kss.zope/trunk/kss/zope/registry.txt ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.txt (original) +++ kukit/kss.zope/trunk/kss/zope/registry.txt Sun Nov 11 09:58:21 2007 @@ -22,27 +22,9 @@ >>> registry = GlobalPluginRegistry() -When we set it up all its methods should return the appropriate empty -values. The examples below demonstrate the basic querying methods -available. - - >>> list(registry.plugins()) - [] - - >>> list(registry.javascripts()) - [] - - >>> list(registry.extra_javascripts()) - [] - -Since we depend on `kss.base` which has a plugin called `kss-core` we -can use this to setup a more interesting registry. - - >>> from kss.base import load_plugins - >>> load_plugins('kss-core') - -This should have activated the core plugin. Now let's look at the -results. +When we set it up all its methods should direclty return all available +plugins. Since we depend on `kss.base` which has a plugin called +`kss-core` we will see this immediatly. >>> list(registry.plugins()) [('kss-core', )] @@ -53,9 +35,3 @@ >>> list(registry.extra_javascripts()) ['.../3rd_party/base2-dom-fp.js', '.../3rd_party/sarissa.js'] - -Now we will unload the plugin again to clean up. - - >>> from kss.base.plugin import unload_plugins - >>> unload_plugins('kss-core') - From reebalazs at codespeak.net Sun Nov 11 10:13:25 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 10:13:25 +0100 (CET) Subject: [KSS-checkins] r48546 - in kukit/kss.zope/trunk/kss/core: . pluginregistry pluginregistry/_concatresource Message-ID: <20071111091325.6E01E824B@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 10:13:23 2007 New Revision: 48546 Modified: kukit/kss.zope/trunk/kss/core/concatresource.zcml kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/meta.py kukit/kss.zope/trunk/kss/core/pluginregistry/registry.py Log: Hook up javascript files to new registry Modified: kukit/kss.zope/trunk/kss/core/concatresource.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/core/concatresource.zcml (original) +++ kukit/kss.zope/trunk/kss/core/concatresource.zcml Sun Nov 11 10:13:23 2007 @@ -24,77 +24,18 @@ - - - - Modified: kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/meta.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/meta.py (original) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/meta.py Sun Nov 11 10:13:23 2007 @@ -49,12 +49,12 @@ caching='default', lmt_check_period=60.0, layer=_layer, permission='zope.Public'): - if not files: - raise ConfigurationError( - "Must use a files" - " attribute for concatresource directives, with at least" - " one file contained." - ) + #if not files: + # raise ConfigurationError( + # "Must use a files" + # " attribute for concatresource directives, with at least" + # " one file contained." + # ) res = files res_type = 'files' Modified: kukit/kss.zope/trunk/kss/core/pluginregistry/registry.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/registry.py (original) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/registry.py Sun Nov 11 10:13:23 2007 @@ -16,28 +16,17 @@ # 02111-1307, USA. import zope.component as capi -from interfaces import IKSSPlugin from zope.interface import implements -# concatresource is an embedded product -import _concatresource from concatresource.interfaces import IConcatResourceAddon -from json import getJsonAddonFiles -import zope.component as capi +from kss.zope.interfaces import IKSSPluginRegistry class KSSConcatResourceAddon(object): implements(IConcatResourceAddon) def getAddonFiles(self): - try: - files = self._addon_files - except AttributeError: - # Lazy setup of addon files - self._addon_files = files = getJsonAddonFiles() - # Lookup all utilities and add up the files from it - plugins = capi.getAllUtilitiesRegisteredFor(IKSSPlugin) - for plugin in plugins: - if plugin.jsfile and plugin.jsfile not in files: - files.append(plugin.jsfile) + registry = capi.getUtility(IKSSPluginRegistry) + files = [] + files.extend(registry.javascripts()) return files kssConcatResourceAddon = KSSConcatResourceAddon() From reebalazs at codespeak.net Sun Nov 11 11:15:50 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 11:15:50 +0100 (CET) Subject: [KSS-checkins] r48547 - in kukit/kss.zope/trunk/kss: core zope zope/concatresource Message-ID: <20071111101550.878A3823D@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 11:15:48 2007 New Revision: 48547 Added: kukit/kss.zope/trunk/kss/zope/concatresource/ - copied from r48545, kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/ kukit/kss.zope/trunk/kss/zope/concatresource/meta.py - copied, changed from r48546, kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/meta.py Removed: kukit/kss.zope/trunk/kss/core/concatresource.zcml kukit/kss.zope/trunk/kss/zope/concatresource/fields.py kukit/kss.zope/trunk/kss/zope/concatresource/kss.concatresource-configure.zcml kukit/kss.zope/trunk/kss/zope/concatresource/kss.concatresource-meta.zcml kukit/kss.zope/trunk/kss/zope/concatresource/version.txt Modified: kukit/kss.zope/trunk/kss/core/configure.zcml kukit/kss.zope/trunk/kss/zope/concatresource/__init__.py kukit/kss.zope/trunk/kss/zope/concatresource/cachingadapter.py kukit/kss.zope/trunk/kss/zope/concatresource/concatfileresource.py kukit/kss.zope/trunk/kss/zope/concatresource/directives.py kukit/kss.zope/trunk/kss/zope/concatresource/fileresource.py kukit/kss.zope/trunk/kss/zope/concatresource/interfaces.py kukit/kss.zope/trunk/kss/zope/concatresource/meta.zcml kukit/kss.zope/trunk/kss/zope/concatresource/resource.py kukit/kss.zope/trunk/kss/zope/configure.zcml Log: Relocate concatresource zope part to kss.zope, and clean up a bit. (It does not yet reuse kss base.) Deleted: /kukit/kss.zope/trunk/kss/core/concatresource.zcml ============================================================================== --- /kukit/kss.zope/trunk/kss/core/concatresource.zcml Sun Nov 11 11:15:48 2007 +++ (empty file) @@ -1,41 +0,0 @@ - - - - - - - - - - - - - Modified: kukit/kss.zope/trunk/kss/core/configure.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/core/configure.zcml (original) +++ kukit/kss.zope/trunk/kss/core/configure.zcml Sun Nov 11 11:15:48 2007 @@ -9,10 +9,6 @@ - - - - Modified: kukit/kss.zope/trunk/kss/zope/concatresource/__init__.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/__init__.py (original) +++ kukit/kss.zope/trunk/kss/zope/concatresource/__init__.py Sun Nov 11 11:15:48 2007 @@ -1,11 +1 @@ -'''\ -Product init -''' -# alias myself to python import root, directly -try: - import sys - if not 'concatresource' in sys.modules: - # only 1st import is aliased. - sys.modules['concatresource'] = sys.modules[globals()['__name__']] -except ImportError: - pass +# Modified: kukit/kss.zope/trunk/kss/zope/concatresource/cachingadapter.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/cachingadapter.py (original) +++ kukit/kss.zope/trunk/kss/zope/concatresource/cachingadapter.py Sun Nov 11 11:15:48 2007 @@ -1,13 +1,7 @@ from time import time from interfaces import ICachedResource from zope.interface import implements - -try: - from zope.datetime import rfc1123_date -except ImportError: - # Zope < 2.10 - from zope.app.datetimeutils import rfc1123_date - +from zope.datetime import rfc1123_date class CachedResource(object): 'Adapts a ContextFile to a cached resource' Modified: kukit/kss.zope/trunk/kss/zope/concatresource/concatfileresource.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/concatfileresource.py (original) +++ kukit/kss.zope/trunk/kss/zope/concatresource/concatfileresource.py Sun Nov 11 11:15:48 2007 @@ -8,34 +8,21 @@ from zope.interface import implements from interfaces import IContextFile -# we are aliased to Products, hence the following absolute import -from concatresource.interfaces import IConcatResourceAddon from fileresource import File from compression import compress import time -import zope.component -try: - from zope.component.interfaces import ComponentLookupError -except ImportError: - # Zope < 2.10 - from zope.component.exceptions import ComponentLookupError +import zope.component as capi +from kss.zope.interfaces import IKSSPluginRegistry -class ConcatFiles(object): - '''A resource that concatenates files and compresses the result +class KSSConcatFiles(object): + '''A resource that concatenates KSS files and compresses the result It is also possible to extend the statically given list via a utility. ''' implements(IContextFile) - def __init__(self, pathlist, name, compress_level, caching, lmt_check_period): - # Path is now a list. - assert isinstance(pathlist, (list, tuple)) - # check all files, just to raise error if don't exist - for path in pathlist: - file(path, 'rb').close() - # - self.pathlist_base = pathlist + def __init__(self, name, compress_level, caching, lmt_check_period): self.__name__ = name self.compress_level = compress_level self.caching = caching @@ -45,31 +32,12 @@ self.fileslist_changed = None self.fileslist = [] - def getPathList(self): - 'Gets the extended pathlist' - # we allow the list to be extended via an utility - try: - registry = zope.component.getUtility(IConcatResourceAddon, self.__name__) - except ComponentLookupError: - extend = [] - else: - extend = registry.getAddonFiles() - pathlist = self.pathlist_base + extend - return pathlist - def getFilesList(self): 'Gets the list of files' - ## # XXX We have two choices: - ## # 1. We only calculate the list once, on startup - ## # that is, we suppose that the file resource is - ## # called up after the extension reg has been finished - ## # and that it never changes later. - ## # 2. but it also could be like this to allow changes later: - pathlist = self.getPathList() + # Use the kss plugin registry + registry = capi.getUtility(IKSSPluginRegistry) + pathlist = registry.javascripts() if pathlist != self.pathlist: - ##if not self.pathlist: - ##pathlist = self.getPathList() - # mark pathlist modification self.pathlist = pathlist self.fileslist_changed = time.time() fileslist = self.fileslist = [File(path, self.__name__) for path in pathlist] Modified: kukit/kss.zope/trunk/kss/zope/concatresource/directives.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/directives.py (original) +++ kukit/kss.zope/trunk/kss/zope/concatresource/directives.py Sun Nov 11 11:15:48 2007 @@ -1,21 +1,9 @@ -from zope.interface import Interface -from zope.configuration.fields import GlobalObject, Tokens, Path, \ - PythonIdentifier, MessageID -from zope.schema import TextLine, Text, Id, Choice, Float -from fields import PathList -from zope.app.component.metadirectives import IBasicViewInformation +from zope.schema import TextLine, Choice, Float from zope.app.publisher.browser.metadirectives import IBasicResourceInformation -try: - from zope.security.zcml import Permission -except ImportError: - # Zope < 2.10 - from zope.app.security.fields import Permission - - -class IConcatResourceDirective(IBasicResourceInformation): +class IKSSConcatResourceDirective(IBasicResourceInformation): """ - Defines a concatenated browser resource + Defines a concatenated browser resource for kss """ name = TextLine( @@ -30,12 +18,6 @@ required=True ) - files = PathList( - title=u"Files", - description=u"A space separated list of resource files", - required=True - ) - compress_level = Choice( title=u"Compress level", description=u"Level of compression applied, by default 'safe'.", @@ -58,5 +40,3 @@ to set this to 0, for production it can be left to the default 60.0""", required=False, ) - - Deleted: /kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/fields.py ============================================================================== --- /kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/fields.py Sun Nov 11 11:15:48 2007 +++ (empty file) @@ -1,19 +0,0 @@ - -from zope.schema import Text -from zope.schema.interfaces import IFromUnicode -from zope.interface import implements -import os.path - -class PathList(Text): - - implements(IFromUnicode) - - def fromUnicode(self, u): - result = [] - for u in u.split(): - if os.path.isabs(u): - path = os.path.normpath(u) - else: - path = self.context.path(u) - result.append(path) - return result Modified: kukit/kss.zope/trunk/kss/zope/concatresource/fileresource.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/fileresource.py (original) +++ kukit/kss.zope/trunk/kss/zope/concatresource/fileresource.py Sun Nov 11 11:15:48 2007 @@ -6,15 +6,7 @@ ''' from zope.interface import implements -try: - from zope.contenttype import guess_content_type -except ImportError: # BBB: Zope < 2.10 - try: - # XXX ??? What zope version needs this? - from zope.app.contenttypes import guess_content_type - except ImportError: - from zope.app.content_types import guess_content_type - +from zope.contenttype import guess_content_type import os from interfaces import IContextFile Modified: kukit/kss.zope/trunk/kss/zope/concatresource/interfaces.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/interfaces.py (original) +++ kukit/kss.zope/trunk/kss/zope/concatresource/interfaces.py Sun Nov 11 11:15:48 2007 @@ -22,20 +22,3 @@ def purgeData(self): 'Purges the cached data' - -class IConcatResourceAddon(Interface): - '''Utility to register addons - - This can be used to dynamically extend components for a given resource. - We don't provide implementation for this here, but other - components can implement this to provide dynamic add-ons. - - The name of the utility should be the name of the resource. - ''' - - def getAddonFiles(request): - '''Returns a list of addon files. - This will be concatenated to the end of the static list. - ''' - - Deleted: /kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/kss.concatresource-configure.zcml ============================================================================== --- /kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/kss.concatresource-configure.zcml Sun Nov 11 11:15:48 2007 +++ (empty file) @@ -1 +0,0 @@ - Deleted: /kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/kss.concatresource-meta.zcml ============================================================================== --- /kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/kss.concatresource-meta.zcml Sun Nov 11 11:15:48 2007 +++ (empty file) @@ -1 +0,0 @@ - Copied: kukit/kss.zope/trunk/kss/zope/concatresource/meta.py (from r48546, kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/meta.py) ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/meta.py (original) +++ kukit/kss.zope/trunk/kss/zope/concatresource/meta.py Sun Nov 11 11:15:48 2007 @@ -1,21 +1,19 @@ -import os from zope.security.checker import CheckerPublic, NamesChecker -from zope.configuration.exceptions import ConfigurationError from zope.publisher.interfaces.browser import IBrowserRequest from zope.app.component.metaconfigure import handler from zope.interface import Interface -from resource import ConcatResourceFactory +from resource import KSSConcatResourceFactory try: import Products.Five + Products.Five # satisfy pyflakes except ImportError: __five__ = False else: __five__ = True from Products.Five.metaclass import makeClass - from Products.Five.security import getSecurityInfo, protectClass, protectName,\ - initializeClass + from Products.Five.security import protectClass, initializeClass try: from zope.publisher.interfaces.browser import IDefaultBrowserLayer @@ -28,6 +26,7 @@ try: from zope.component import zcml + zcml # satisfy pyflakes __pre_3_3__ = False except: __pre_3_3__ = True @@ -39,24 +38,16 @@ # We keep this in order to allow an occasional merge to browser:resource _factory_map = { 'files': { - 'prefix': 'ConcatResource', + 'prefix': 'KSSConcatResource', 'count': 0, - 'factory': ConcatResourceFactory + 'factory': KSSConcatResourceFactory }, } -def concatresource(_context, name, files=None, compress_level='safe', +def concatresource(_context, name, compress_level='safe', caching='default', lmt_check_period=60.0, layer=_layer, permission='zope.Public'): - #if not files: - # raise ConfigurationError( - # "Must use a files" - # " attribute for concatresource directives, with at least" - # " one file contained." - # ) - - res = files res_type = 'files' factory_info = _factory_map.get(res_type) factory_info['count'] += 1 @@ -86,7 +77,7 @@ checker = NamesChecker(allowed_names, permission) - factory = res_factory(res, name, compress_level, caching, lmt_check_period, + factory = res_factory(name, compress_level, caching, lmt_check_period, resource_factory=new_class, checker=checker) if __pre_3_2__: Modified: kukit/kss.zope/trunk/kss/zope/concatresource/meta.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/meta.zcml (original) +++ kukit/kss.zope/trunk/kss/zope/concatresource/meta.zcml Sun Nov 11 11:15:48 2007 @@ -2,11 +2,11 @@ xmlns="http://namespaces.zope.org/zope" xmlns:meta="http://namespaces.zope.org/meta"> - + Modified: kukit/kss.zope/trunk/kss/zope/concatresource/resource.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/resource.py (original) +++ kukit/kss.zope/trunk/kss/zope/concatresource/resource.py Sun Nov 11 11:15:48 2007 @@ -1,32 +1,23 @@ from zope.publisher.interfaces.browser import IBrowserPublisher from zope.interface import implements -from concatfileresource import ConcatFiles +from concatfileresource import KSSConcatFiles from interfaces import ICachedResource import cachingadapter # force adapter registration - -try: - from zope.publisher.browser import BrowserView - from zope.datetime import time as timeFromDateTimeString -except ImportError: - # Zope < 2.10 - from zope.app.publisher.browser import BrowserView - from zope.app.datetimeutils import time as timeFromDateTimeString +cachingadapter # satisfy pyflakes +from zope.publisher.browser import BrowserView +from zope.datetime import time as timeFromDateTimeString try: import Products.Five + Products.Five # satisfy pyflakes except ImportError: __five__ = False from zope.app.publisher.browser.resource import Resource + Resource # satisfy pyflakes else: __five__ = True - try: - # Zope 2.8 / Five 1.0.2 - from Products.Five.resource import Resource - __five_pre_1_3_ = True - except ImportError: - # Zope 2.9 / Five 1.3 - from Products.Five.browser.resource import Resource - __five_pre_1_3__ = False + from Products.Five.browser.resource import Resource as _Resource + Resource = _Resource # satisfy pyflakes class GenericResource(BrowserView, Resource): """A publishable resource""" @@ -121,10 +112,9 @@ factory = None resource = None - def __init__(self, path, name, compress_level, caching, lmt_check_period, + def __init__(self, name, compress_level, caching, lmt_check_period, resource_factory=None, checker=None): self.__name = name - self.__path = path self.__compress_level = compress_level self.__caching = caching self.__lmt_check_period = lmt_check_period @@ -138,7 +128,7 @@ rsrc = self.__rsrc except AttributeError: # Delayed creation. That assures that registry is set up by this time. - rsrc = self.__rsrc = ICachedResource(self.factory(self.__path, self.__name, + rsrc = self.__rsrc = ICachedResource(self.factory(self.__name, self.__compress_level, self.__caching, self.__lmt_check_period)) resource = self.resource(rsrc, request) # z3 only @@ -148,8 +138,8 @@ resource.__Security_checker__ = self.__checker return resource -class ConcatResourceFactory(ResourceFactory): +class KSSConcatResourceFactory(ResourceFactory): """A factory for concat resources""" - factory = ConcatFiles + factory = KSSConcatFiles resource = GenericResource Deleted: /kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/version.txt ============================================================================== --- /kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/version.txt Sun Nov 11 11:15:48 2007 +++ (empty file) @@ -1 +0,0 @@ -1.4dev Unreleased Modified: kukit/kss.zope/trunk/kss/zope/configure.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/zope/configure.zcml (original) +++ kukit/kss.zope/trunk/kss/zope/configure.zcml Sun Nov 11 11:15:48 2007 @@ -1,6 +1,29 @@ - + + + + + + + + + + + + From reebalazs at codespeak.net Sun Nov 11 11:16:49 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 11:16:49 +0100 (CET) Subject: [KSS-checkins] r48548 - kukit/buildout/kss.zope Message-ID: <20071111101649.5DE4F823D@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 11:16:49 2007 New Revision: 48548 Modified: kukit/buildout/kss.zope/base.cfg Log: Adjust config Modified: kukit/buildout/kss.zope/base.cfg ============================================================================== --- kukit/buildout/kss.zope/base.cfg (original) +++ kukit/buildout/kss.zope/base.cfg Sun Nov 11 11:16:49 2007 @@ -122,6 +122,7 @@ zcml = kss.zope + kss.zope-meta kss.demo [zopepy] From reebalazs at codespeak.net Sun Nov 11 11:21:54 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 11:21:54 +0100 (CET) Subject: [KSS-checkins] r48549 - kukit/kss.zope/trunk/kss/zope Message-ID: <20071111102154.9125F823D@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 11:21:54 2007 New Revision: 48549 Added: kukit/kss.zope/trunk/kss/zope/meta.zcml Log: Forgot this Added: kukit/kss.zope/trunk/kss/zope/meta.zcml ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/zope/meta.zcml Sun Nov 11 11:21:54 2007 @@ -0,0 +1,5 @@ + + + + + From reebalazs at codespeak.net Sun Nov 11 12:08:36 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 12:08:36 +0100 (CET) Subject: [KSS-checkins] r48550 - kukit/kss.demo/branch/kss-zope-transition/kss/demo Message-ID: <20071111110836.E1AB4824C@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 12:08:36 2007 New Revision: 48550 Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/configure.zcml Log: Add remark for occasinally removing kss.core include Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/configure.zcml ============================================================================== --- kukit/kss.demo/branch/kss-zope-transition/kss/demo/configure.zcml (original) +++ kukit/kss.demo/branch/kss-zope-transition/kss/demo/configure.zcml Sun Nov 11 12:08:36 2007 @@ -6,6 +6,7 @@ i18n_domain="kss" > + Author: reebalazs Date: Sun Nov 11 12:09:31 2007 New Revision: 48551 Added: kukit/kss.zope/trunk/kss/zope/bbb/ - copied from r48549, kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/ kukit/kss.zope/trunk/kss/zope/bbb/deprecated.py - copied unchanged from r48549, kukit/kss.zope/trunk/kss/core/deprecated.py kukit/kss.zope/trunk/kss/zope/browser/ - copied from r48549, kukit/kss.zope/trunk/kss/core/pluginregistry/browser/ Removed: kukit/kss.zope/trunk/kss/core/pluginregistry/_concatresource/ kukit/kss.zope/trunk/kss/core/pluginregistry/action.py kukit/kss.zope/trunk/kss/core/pluginregistry/browser/ kukit/kss.zope/trunk/kss/core/pluginregistry/command.py kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/ kukit/kss.zope/trunk/kss/core/pluginregistry/event_type.py kukit/kss.zope/trunk/kss/core/pluginregistry/pprovider.py Modified: kukit/kss.zope/trunk/kss/core/commands.py kukit/kss.zope/trunk/kss/core/configure.zcml kukit/kss.zope/trunk/kss/core/pluginregistry/__init__.py kukit/kss.zope/trunk/kss/core/pluginregistry/configure.py kukit/kss.zope/trunk/kss/core/pluginregistry/configure.zcml kukit/kss.zope/trunk/kss/core/pluginregistry/directives.py kukit/kss.zope/trunk/kss/core/pluginregistry/interfaces.py kukit/kss.zope/trunk/kss/core/pluginregistry/meta.zcml kukit/kss.zope/trunk/kss/zope/bbb/__init__.py kukit/kss.zope/trunk/kss/zope/bbb/configure.py kukit/kss.zope/trunk/kss/zope/bbb/directives.py kukit/kss.zope/trunk/kss/zope/bbb/meta.zcml kukit/kss.zope/trunk/kss/zope/configure.zcml kukit/kss.zope/trunk/kss/zope/meta.zcml Log: BBB old kss:action kss:eventtype kss:paramprovider directives. Modified: kukit/kss.zope/trunk/kss/core/commands.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/commands.py (original) +++ kukit/kss.zope/trunk/kss/core/commands.py Sun Nov 11 12:09:31 2007 @@ -28,9 +28,8 @@ from unicode_quirks import force_unicode import zope.component from parsers import XmlParser, HtmlParser -from pluginregistry import checkRegisteredCommand_old -from pluginregistry import checkRegisteredCommand, checkRegisteredSelector, \ - KSSPluginError +##from pluginregistry import checkRegisteredSelector +from pluginregistry import checkRegisteredSelector class KSSCommands(list): implements(IKSSCommands) @@ -67,19 +66,11 @@ implements(IKSSCommand) def __init__(self, command_name, selector=None, **kw): - try: - checkRegisteredCommand_old(command_name) - except KSSPluginError: - # we expect this is not registered as command, anyway - # so check it as an action. - checkRegisteredCommand(command_name) - else: - # ok. XXX this will be deprecated - # All registerCommand commands are obsolete, by default - import warnings, textwrap - warnings.warn(textwrap.dedent('''\ - The usage of the kss command "%s" is deprecated''' - % (command_name, )), DeprecationWarning, 2) + # we expect this is not registered as command, anyway + # so check it as an action. +## XXX command checking temporarily disabled +## XXX TODO needs to work from new registry. +## checkRegisteredCommand(command_name) if selector is not None: if isinstance(selector, basestring): # the default selector - given just as a string Modified: kukit/kss.zope/trunk/kss/core/configure.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/core/configure.zcml (original) +++ kukit/kss.zope/trunk/kss/core/configure.zcml Sun Nov 11 12:09:31 2007 @@ -12,8 +12,10 @@ - - + + - - - - - - - - - - - - - Modified: kukit/kss.zope/trunk/kss/core/pluginregistry/directives.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/directives.py (original) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/directives.py Sun Nov 11 12:09:31 2007 @@ -1,65 +1,11 @@ from zope.interface import Interface -from zope.schema import TextLine, Choice -from zope.configuration.fields import Path, Tokens, PythonIdentifier, \ - GlobalInterface, GlobalObject +from zope.schema import TextLine +from zope.configuration.fields import ( + Path, + GlobalInterface, + GlobalObject, + ) -class IRegisterEventTypeDirective(Interface): - 'Register a KSS event type' - - name = TextLine( - title=u"Name", - description=u"The name of the event type plugin.", - required=True, - ) - - jsfile = Path( - title=u"Javascript file", - description=u"The path of the javascript file that defines the plugin", - required=False, - ) - -class IRegisterActionDirective(Interface): - 'Register a KSS action' - - name = TextLine( - title=u"Name", - description=u"The name of the action plugin.", - required=True, - ) - - jsfile = Path( - title=u"Javascript file", - description=u"The path of the javascript file that defines the plugin", - required=False, - ) - - command_factory = Choice( - title=u"Command factory type", - description=u"Command factory type, by default 'none'.", - values=(u'none', u'global', u'selector'), - required=False, - ) - - params_mandatory = Tokens( - title=u"Mandatory parameters", - description=u"Space separated list of mandatory parameter names", - value_type=PythonIdentifier(), - required=False, - ) - - params_optional = Tokens( - title=u"Optional parameters", - description=u"Comma separated list of optional parameter names", - value_type=PythonIdentifier(), - required=False, - ) - - deprecated = TextLine( - title=u"Deprecated", - description=u"The hint that we should give as warning about deprecation", - required=False, - ) - class IRegisterSelectorTypeDirective(Interface): 'Register a KSS selector type' @@ -101,18 +47,3 @@ description=u"The interface that does the adaptation on the view for this set", required=True, ) - -class IRegisterParamProviderDirective(Interface): - 'Register a KSS parameter provider' - - name = TextLine( - title=u"Name", - description=u"The name of the parameter provider plugin.", - required=True, - ) - - jsfile = Path( - title=u"Javascript file", - description=u"The path of the javascript file that defines the plugin", - required=False, - ) Deleted: /kukit/kss.zope/trunk/kss/core/pluginregistry/event_type.py ============================================================================== --- /kukit/kss.zope/trunk/kss/core/pluginregistry/event_type.py Sun Nov 11 12:09:31 2007 +++ (empty file) @@ -1,31 +0,0 @@ -# Copyright (c) 2005-2007 -# Authors: KSS Project Contributors (see docs/CREDITS.txt) -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -from plugin import KSSPlugin -from interfaces import IEventType -from zope.interface import implements - -class EventType(KSSPlugin): - '''The event type plugin - - ''' - - implements(IEventType) - - def __init__(self, name, jsfile): - KSSPlugin.__init__(self, name, jsfile) - Modified: kukit/kss.zope/trunk/kss/core/pluginregistry/interfaces.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/interfaces.py (original) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/interfaces.py Sun Nov 11 12:09:31 2007 @@ -23,20 +23,8 @@ this represents an entity implemented in a javascript file ''' -class ICommand(IKSSPlugin): - '''Command plugin''' - -class IAction(IKSSPlugin): - '''Action plugin''' - -class IEventType(IKSSPlugin): - '''Event type plugin''' - class ISelectorType(IKSSPlugin): '''Selector type plugin''' class ICommandSet(Interface): '''Command set plugin''' - -class IParamProvider(IKSSPlugin): - '''Parameter provider plugin''' Modified: kukit/kss.zope/trunk/kss/core/pluginregistry/meta.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/meta.zcml (original) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/meta.zcml Sun Nov 11 12:09:31 2007 @@ -1,26 +1,8 @@ - - - - - - - - - - - - Deleted: /kukit/kss.zope/trunk/kss/core/pluginregistry/pprovider.py ============================================================================== --- /kukit/kss.zope/trunk/kss/core/pluginregistry/pprovider.py Sun Nov 11 12:09:31 2007 +++ (empty file) @@ -1,30 +0,0 @@ -# Copyright (c) 2005-2007 -# Authors: KSS Project Contributors (see docs/CREDITS.txt) -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -from plugin import KSSPlugin -from interfaces import IParamProvider -import zope.component as capi -from zope.interface import implements - -class ParamProvider(KSSPlugin): - '''The parameter provider plugin - ''' - - implements(IParamProvider) - - def __init__(self, name, jsfile): - KSSPlugin.__init__(self, name, jsfile) Modified: kukit/kss.zope/trunk/kss/zope/bbb/__init__.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/__init__.py (original) +++ kukit/kss.zope/trunk/kss/zope/bbb/__init__.py Sun Nov 11 12:09:31 2007 @@ -1,4 +1,2 @@ -'''\ -Module init -''' +# Modified: kukit/kss.zope/trunk/kss/zope/bbb/configure.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/configure.py (original) +++ kukit/kss.zope/trunk/kss/zope/bbb/configure.py Sun Nov 11 12:09:31 2007 @@ -1,26 +1,10 @@ -import os.path -from kss.core.pluginregistry.interfaces import ICommand -from kss.core.pluginregistry.command import Command -from kss.core.pluginregistry.plugin import registerPlugin -from kss.core.deprecated import deprecated_directive -from kss.core.pluginregistry import configure as _configure +from deprecated import deprecated_directive -def registerCommand(_context, name, jsfile=None): - 'Directive that registers a command' - # check to see if the file exists - if jsfile is not None: - file(jsfile, 'rb').close() +def nothing(*arg, **ks): + pass - _context.action( - discriminator = ('registerKssCommand', name, jsfile), - callable = registerPlugin, - args = (Command, ICommand, name, jsfile), - ) -registerCommand = deprecated_directive(registerCommand, 'azax:registerCommand', - 'use kss:registerAction with command_factory="selector" or "global"') - -registerEventType = deprecated_directive(_configure.registerEventType, 'azax:registerEventType', 'use kss:registerEventType instead') -registerAction = deprecated_directive(_configure.registerAction, 'azax:registerAction', 'use kss:registerAction instead') -registerSelectorType = deprecated_directive(_configure.registerSelectorType, 'azax:registerSelectorType', 'use kss:registerSelectorType instead') -registerCommandSet = deprecated_directive(_configure.registerCommandSet, 'azax:registerCommandSet', 'use kss:registerCommandSet instead') +# XXX TODO more meaningful messages here? +registerEventType = deprecated_directive(nothing, 'kss:eventtype', 'use python level registry instead') +registerAction = deprecated_directive(nothing, 'kss:action', 'use python level registry instead') +registerParamProvider = deprecated_directive(nothing, 'kss:paramprovider', 'use python level registry instead') Modified: kukit/kss.zope/trunk/kss/zope/bbb/directives.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/directives.py (original) +++ kukit/kss.zope/trunk/kss/zope/bbb/directives.py Sun Nov 11 12:09:31 2007 @@ -1,14 +1,13 @@ from zope.interface import Interface from zope.schema import TextLine, Choice -from zope.configuration.fields import Path, Tokens, PythonIdentifier, \ - GlobalInterface +from zope.configuration.fields import Path, Tokens, PythonIdentifier -class IRegisterCommandDirective(Interface): - 'Register a KSS command plugin' +class IRegisterEventTypeDirective(Interface): + 'Register a KSS event type' name = TextLine( title=u"Name", - description=u"The name of the command plugin.", + description=u"The name of the event type plugin.", required=True, ) @@ -18,6 +17,59 @@ required=False, ) -from kss.core.pluginregistry.directives import IRegisterEventTypeDirective, \ - IRegisterActionDirective, IRegisterSelectorTypeDirective, \ - IRegisterCommandSetDirective +class IRegisterActionDirective(Interface): + 'Register a KSS action' + + name = TextLine( + title=u"Name", + description=u"The name of the action plugin.", + required=True, + ) + + jsfile = Path( + title=u"Javascript file", + description=u"The path of the javascript file that defines the plugin", + required=False, + ) + + command_factory = Choice( + title=u"Command factory type", + description=u"Command factory type, by default 'none'.", + values=(u'none', u'global', u'selector'), + required=False, + ) + + params_mandatory = Tokens( + title=u"Mandatory parameters", + description=u"Space separated list of mandatory parameter names", + value_type=PythonIdentifier(), + required=False, + ) + + params_optional = Tokens( + title=u"Optional parameters", + description=u"Comma separated list of optional parameter names", + value_type=PythonIdentifier(), + required=False, + ) + + deprecated = TextLine( + title=u"Deprecated", + description=u"The hint that we should give as warning about deprecation", + required=False, + ) + +class IRegisterParamProviderDirective(Interface): + 'Register a KSS parameter provider' + + name = TextLine( + title=u"Name", + description=u"The name of the parameter provider plugin.", + required=True, + ) + + jsfile = Path( + title=u"Javascript file", + description=u"The path of the javascript file that defines the plugin", + required=False, + ) Modified: kukit/kss.zope/trunk/kss/zope/bbb/meta.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/deprecated/meta.zcml (original) +++ kukit/kss.zope/trunk/kss/zope/bbb/meta.zcml Sun Nov 11 12:09:31 2007 @@ -1,38 +1,26 @@ - + - - - - Modified: kukit/kss.zope/trunk/kss/zope/configure.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/zope/configure.zcml (original) +++ kukit/kss.zope/trunk/kss/zope/configure.zcml Sun Nov 11 12:09:31 2007 @@ -2,6 +2,7 @@ xmlns:kss="http://namespaces.zope.org/kss" > + + From reebalazs at codespeak.net Sun Nov 11 12:10:54 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 12:10:54 +0100 (CET) Subject: [KSS-checkins] r48552 - kukit/kss.zope/trunk/kss/core/pluginregistry/json Message-ID: <20071111111054.56D9A824F@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 12:10:53 2007 New Revision: 48552 Removed: kukit/kss.zope/trunk/kss/core/pluginregistry/json/ Log: Also remove now unused json extension From jvloothuis at codespeak.net Sun Nov 11 12:28:41 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 11 Nov 2007 12:28:41 +0100 (CET) Subject: [KSS-checkins] r48553 - in kukit/kss.zope/trunk/kss: core zope Message-ID: <20071111112841.4CE1B824D@code0.codespeak.net> Author: jvloothuis Date: Sun Nov 11 12:28:39 2007 New Revision: 48553 Added: kukit/kss.zope/trunk/kss/zope/commands.py kukit/kss.zope/trunk/kss/zope/commandset.py Modified: kukit/kss.zope/trunk/kss/core/__init__.py kukit/kss.zope/trunk/kss/core/commands.py kukit/kss.zope/trunk/kss/core/configure.zcml kukit/kss.zope/trunk/kss/core/kssview.py kukit/kss.zope/trunk/kss/zope/__init__.py kukit/kss.zope/trunk/kss/zope/configure.zcml kukit/kss.zope/trunk/kss/zope/interfaces.py kukit/kss.zope/trunk/kss/zope/registry.py kukit/kss.zope/trunk/kss/zope/registry.txt kukit/kss.zope/trunk/kss/zope/view.py Log: Added the start of a commandset system for the new infrastructure. Modified: kukit/kss.zope/trunk/kss/core/__init__.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/__init__.py (original) +++ kukit/kss.zope/trunk/kss/core/__init__.py Sun Nov 11 12:28:39 2007 @@ -27,7 +27,10 @@ mimetypes.types_map['.kkt'] = 'text/xml' # BBB legacy! mimetypes.types_map['.kukit'] = 'text/xml' -from kss.core.kssview import KSSView, CommandSet +from kss.core.kssview import KSSView + +from kss.zope.commandset import ZopeCommandSet as CommandSet + from kss.core.actionwrapper import KSSExplicitError, kssaction from kss.core.unicode_quirks import force_unicode, KSSUnicodeError from kss.core.interfaces import ICommandSet Modified: kukit/kss.zope/trunk/kss/core/commands.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/commands.py (original) +++ kukit/kss.zope/trunk/kss/core/commands.py Sun Nov 11 12:28:39 2007 @@ -1,27 +1,6 @@ -# Copyright (c) 2005-2007 -# Authors: KSS Project Contributors (see docs/CREDITS.txt) -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -'''\ -Marshal objects - -These build up the response and get marshalled to the client -in the defined format -''' +from kss.zope.commands import KSSZopeCommands as KSSCommands +# Old cruft from zope.interface import implements from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile from interfaces import IKSSCommands, IKSSCommand, IKSSParam, IKSSCommandView @@ -31,20 +10,6 @@ ##from pluginregistry import checkRegisteredSelector from pluginregistry import checkRegisteredSelector -class KSSCommands(list): - implements(IKSSCommands) - - def addCommand(self, command_name, selector=None, **kw): - command = KSSCommand(command_name, selector=selector, **kw) - self.append(command) - return command - - def render(self, request): - '''All methods must use this to return their command set - ''' - adapter = zope.component.getMultiAdapter((self, request), IKSSCommandView) - return adapter.render() - class KSSParam: implements(IKSSParam) @@ -61,7 +26,7 @@ def getContent(self): return self.content - + class KSSCommand: implements(IKSSCommand) Modified: kukit/kss.zope/trunk/kss/core/configure.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/core/configure.zcml (original) +++ kukit/kss.zope/trunk/kss/core/configure.zcml Sun Nov 11 12:28:39 2007 @@ -8,9 +8,7 @@ - - - + - - Modified: kukit/kss.zope/trunk/kss/zope/interfaces.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/interfaces.py (original) +++ kukit/kss.zope/trunk/kss/zope/interfaces.py Sun Nov 11 12:28:39 2007 @@ -41,6 +41,21 @@ def lookup_commandset(id): '''Return a commandset class for the given id''' +class ICommandSet(Interface): + 'Methods of this class implement a command set' + + def __init__(self, commands): + '''Initialize a commandset''' + + def getCommandSet(self, name): # TODO: Is this API used at all? + 'Returns the command set for a given name' + +class IZopeCommandSet(ICommandSet): + '''A Zope version of the commandset, has more stuff''' + + def __init__(self, commands, view, context, request): + '''Initialize a commandset''' + # from kss.core class IKSSCommands(Interface): @@ -136,11 +151,3 @@ """Return the commandset called ``name`` bound to the current view.""" -# BBB deprecated -IAzaxView = IKSSView - -class ICommandSet(Interface): - 'Methods of this class implement a command set' - - def getCommandSet(self, name): - 'Returns the command set for a given name' Modified: kukit/kss.zope/trunk/kss/zope/registry.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.py (original) +++ kukit/kss.zope/trunk/kss/zope/registry.py Sun Nov 11 12:28:39 2007 @@ -6,6 +6,12 @@ class GlobalPluginRegistry(object): interface.implements(IKSSPluginRegistry) + def __init__(self): + self._commandsets = {} + + for plugin_id, config in available_plugins(): + self._commandsets.update(config.commandsets) + def plugins(self): return available_plugins() @@ -21,4 +27,8 @@ def lookup_commandset(self, id): - pass + return self._commandsets[id] + + + def register_commandset(self, id, factory): + self._commandsets[id] = factory Modified: kukit/kss.zope/trunk/kss/zope/registry.txt ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.txt (original) +++ kukit/kss.zope/trunk/kss/zope/registry.txt Sun Nov 11 12:28:39 2007 @@ -1,3 +1,4 @@ +================= Plugin registries ================= @@ -35,3 +36,31 @@ >>> list(registry.extra_javascripts()) ['.../3rd_party/base2-dom-fp.js', '.../3rd_party/sarissa.js'] + +The registry can also be used to lookup a commandset. If a commandset +is requested which is not available we will get a KeyError. + + >>> registry.lookup_commandset('cheese') + Traceback (most recent call last): + ... + KeyError: 'cheese' + +Loading the commandset for the core should be possible. + + >>> registry.lookup_commandset('core') + + +As you can see it returns a factory (in this case the class) for the +commandset. + +Next to automatically discovering commandsets (using the plugin +system) there is support for registering a specific set. The +registration is a simple call to the registry with a commandset +factory. + + >>> from kss.base.commands import KSSCommandSet + >>> class CheeseCommandSet(KSSCommandSet): + ... pass + >>> registry.register_commandset('cheese', CheeseCommandSet) + >>> registry.lookup_commandset('cheese') + \ No newline at end of file Modified: kukit/kss.zope/trunk/kss/zope/view.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/view.py (original) +++ kukit/kss.zope/trunk/kss/zope/view.py Sun Nov 11 12:28:39 2007 @@ -28,17 +28,13 @@ as well. ''' -import warnings - try: from Products.Five import BrowserView except ImportError: from zope.publisher.browser import BrowserView -from kss.base import KSSCommands -# from kss.core.commands import KSSCommands -from kss.zope.interfaces import IKSSView, ICommandSet -from kss.core.pluginregistry.commandset import getRegisteredCommandSet +from kss.zope.commands import KSSZopeCommands +from kss.zope.interfaces import IKSSView from zope import component, interface, event from zope.interface.adapter import VerifyingAdapterRegistry @@ -139,10 +135,7 @@ def __init__(self, context, request): super(KSSView, self).__init__(context, request) - self._initcommands() - - def _initcommands(self): - self.commands = KSSCommands() + self.commands = KSSZopeCommands(self, context, request) # XXX avoid weird acquisition behaviour in Zope 2... this should # go away when Five views aren't Acquisition objects anymore. @@ -154,7 +147,9 @@ def render(self): """Views can use this to return their command set.""" - return self.commands.render(self.request) + self.request.response.setHeader('Content-type', + 'text/xml;charset=utf-8') + return self.commands.render() def cancelRedirect(self): if self.request.response.getStatus() in (302, 303): @@ -165,34 +160,4 @@ return self.commands def getCommandSet(self, name): - commandset = getRegisteredCommandSet(name) - # return the adapted view - return commandset.provides(self) - -class CommandSet: - interface.implements(ICommandSet) - - def __init__(self, view): - self.view = view - self.context = self.view.context - self.request = self.view.request - self.commands = self.view.commands - - def getCommandSet(self, name): - return self.view.getCommandSet(name) - -# BBB deprecated -class AzaxBaseView(KSSView): - def __init__(self, *args, **kw): - message = "'AzaxBaseView' is deprecated," \ - "use 'KSSView' instead." - warnings.warn(message, DeprecationWarning, 2) - KSSView.__init__(self, *args, **kw) - -class AzaxViewAdapter(CommandSet): - def __init__(self, *args, **kw): - message = "'AzaxViewAdapter' is deprecated," \ - "use 'CommandSet' instead." - warnings.warn(message, DeprecationWarning, 2) - CommandSet.__init__(self, *args, **kw) - + return getattr(self.commands, name) From reebalazs at codespeak.net Sun Nov 11 12:32:34 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 12:32:34 +0100 (CET) Subject: [KSS-checkins] r48554 - kukit/kss.zope/trunk/kss/core/kukit_3rd_party Message-ID: <20071111113234.AB1508230@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 12:32:34 2007 New Revision: 48554 Added: kukit/kss.zope/trunk/kss/core/kukit_3rd_party/ - copied from r48553, kukit/kukit.js/trunk/3rd_party/ Log: Temporarily duplicate kukit 3rd_party javascript From reebalazs at codespeak.net Sun Nov 11 12:35:34 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 12:35:34 +0100 (CET) Subject: [KSS-checkins] r48555 - kukit/kss.zope/trunk/kss/core Message-ID: <20071111113534.E6B018237@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 12:35:34 2007 New Revision: 48555 Modified: kukit/kss.zope/trunk/kss/core/ (props changed) kukit/kss.zope/trunk/kss/core/EXTERNALS.TXT kukit/kss.zope/trunk/kss/core/configure.zcml Log: Remove kukit from kss core Modified: kukit/kss.zope/trunk/kss/core/EXTERNALS.TXT ============================================================================== --- kukit/kss.zope/trunk/kss/core/EXTERNALS.TXT (original) +++ kukit/kss.zope/trunk/kss/core/EXTERNALS.TXT Sun Nov 11 12:35:34 2007 @@ -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 +#kukit http://codespeak.net/svn/kukit/kukit.js/trunk Modified: kukit/kss.zope/trunk/kss/core/configure.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/core/configure.zcml (original) +++ kukit/kss.zope/trunk/kss/core/configure.zcml Sun Nov 11 12:35:34 2007 @@ -20,32 +20,32 @@ --> From jvloothuis at codespeak.net Sun Nov 11 13:33:37 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 11 Nov 2007 13:33:37 +0100 (CET) Subject: [KSS-checkins] r48556 - kukit/kss.base/trunk/kss/base Message-ID: <20071111123337.95A89824F@code0.codespeak.net> Author: jvloothuis Date: Sun Nov 11 13:33:35 2007 New Revision: 48556 Modified: kukit/kss.base/trunk/kss/base/plugin.py kukit/kss.base/trunk/kss/base/plugin.txt Log: Made the order of available_plugins depend on the plugin priority. This is usefull when depending on the order for Javascript concatination etc. Modified: kukit/kss.base/trunk/kss/base/plugin.py ============================================================================== --- kukit/kss.base/trunk/kss/base/plugin.py (original) +++ kukit/kss.base/trunk/kss/base/plugin.py Sun Nov 11 13:33:35 2007 @@ -48,10 +48,15 @@ return os.path.join(module_path(mod), *subpath.split('/')) def available_plugins(): + plugins = [] + for entry_point in iter_entry_points('kss.plugin'): plugin_factory = entry_point.load() plugin = plugin_factory() - yield entry_point.name, plugin + plugins.append((entry_point.name, plugin)) + + return sorted(plugins, + key=lambda item: item[1].priority) def load_plugins(*names): def load(name): Modified: kukit/kss.base/trunk/kss/base/plugin.txt ============================================================================== --- kukit/kss.base/trunk/kss/base/plugin.txt (original) +++ kukit/kss.base/trunk/kss/base/plugin.txt Sun Nov 11 13:33:35 2007 @@ -132,3 +132,10 @@ >>> list(available_plugins()) [('kss-core', >> ExamplePlugin.priority = -99999 + >>> list(available_plugins()) + [('testing', ), ('kss-core', )] From jvloothuis at codespeak.net Sun Nov 11 13:34:12 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 11 Nov 2007 13:34:12 +0100 (CET) Subject: [KSS-checkins] r48557 - kukit/kss.zope/trunk/kss/zope Message-ID: <20071111123412.B3CBA8254@code0.codespeak.net> Author: jvloothuis Date: Sun Nov 11 13:34:12 2007 New Revision: 48557 Modified: kukit/kss.zope/trunk/kss/zope/registry.py kukit/kss.zope/trunk/kss/zope/registry.txt Log: Added BBB methods for registering specific stuff (will be used for ZCML BBB with old plugins) Modified: kukit/kss.zope/trunk/kss/zope/registry.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.py (original) +++ kukit/kss.zope/trunk/kss/zope/registry.py Sun Nov 11 13:34:12 2007 @@ -8,27 +8,47 @@ def __init__(self): self._commandsets = {} - for plugin_id, config in available_plugins(): self._commandsets.update(config.commandsets) - def plugins(self): - return available_plugins() - - def javascripts(self): + self._javascripts = [] for id, config in self.plugins(): for javascript in config.javascripts: - yield javascript + self._javascripts.append(javascript) - def extra_javascripts(self): + self._extra_javascripts = [] for id, config in self.plugins(): for extra_javascript in config.extra_javascripts: - yield extra_javascript + self._extra_javascripts.append(extra_javascript) + def plugins(self): + return available_plugins() + + def javascripts(self): + return self._javascripts + + def extra_javascripts(self): + return self._extra_javascripts def lookup_commandset(self, id): return self._commandsets[id] + #============================================= + # Stuff needed for compatibility features + #============================================= + def bbb_register_commandset(self, id, factory): + # make sure we only register when we do not have a better + # (new-style plugin) commandset + if not id in self._commandsets: + self._commandsets[id] = factory + + def bbb_register_javascript(self, filename): + if filename not in self._javascripts: + self._javascripts.append(filename) + + def bbb_register_extra_javascript(self, filename): + if filename not in self._extra_javascripts: + self._extra_javascripts.append(filename) + - def register_commandset(self, id, factory): - self._commandsets[id] = factory + Modified: kukit/kss.zope/trunk/kss/zope/registry.txt ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.txt (original) +++ kukit/kss.zope/trunk/kss/zope/registry.txt Sun Nov 11 13:34:12 2007 @@ -53,6 +53,13 @@ As you can see it returns a factory (in this case the class) for the commandset. + +BBB +=== + +The code below is only used for backwards compatibility. It will be +removed in a future release. + Next to automatically discovering commandsets (using the plugin system) there is support for registering a specific set. The registration is a simple call to the registry with a commandset @@ -61,6 +68,25 @@ >>> from kss.base.commands import KSSCommandSet >>> class CheeseCommandSet(KSSCommandSet): ... pass - >>> registry.register_commandset('cheese', CheeseCommandSet) + >>> registry.bbb_register_commandset('cheese', CheeseCommandSet) >>> registry.lookup_commandset('cheese') - \ No newline at end of file + + +If we register an already available one it will silently ignore the +request. It will also keep the existing one. + + >>> registry.bbb_register_commandset('core', CheeseCommandSet) + >>> registry.lookup_commandset('core') + + +We can also add Javascript files. + + >>> registry.bbb_register_javascript('/some/path.js') + >>> list(registry.javascripts()) + [..., '/some/path.js'] + + + >>> registry.bbb_register_extra_javascript('/some_other/path.js') + >>> list(registry.extra_javascripts()) + [..., '/some_other/path.js'] + From jvloothuis at codespeak.net Sun Nov 11 13:56:10 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 11 Nov 2007 13:56:10 +0100 (CET) Subject: [KSS-checkins] r48561 - kukit/kss.zope/trunk/kss/zope Message-ID: <20071111125610.CD8CC822F@code0.codespeak.net> Author: jvloothuis Date: Sun Nov 11 13:56:10 2007 New Revision: 48561 Modified: kukit/kss.zope/trunk/kss/zope/registry.py kukit/kss.zope/trunk/kss/zope/registry.txt Log: Moved BBB code to module level registries so the utility does not need to be active during ZCML setup. Modified: kukit/kss.zope/trunk/kss/zope/registry.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.py (original) +++ kukit/kss.zope/trunk/kss/zope/registry.py Sun Nov 11 13:56:10 2007 @@ -3,6 +3,11 @@ from kss.zope.interfaces import IKSSPluginRegistry +# BBB registries for configuration of plugins through ZCML +bbb_commandsets = {} +bbb_javascripts = [] +bbb_extra_javascripts = [] + class GlobalPluginRegistry(object): interface.implements(IKSSPluginRegistry) @@ -25,30 +30,32 @@ return available_plugins() def javascripts(self): - return self._javascripts + return self._javascripts + bbb_javascripts def extra_javascripts(self): - return self._extra_javascripts + return self._extra_javascripts + bbb_extra_javascripts def lookup_commandset(self, id): - return self._commandsets[id] - - #============================================= - # Stuff needed for compatibility features - #============================================= - def bbb_register_commandset(self, id, factory): - # make sure we only register when we do not have a better - # (new-style plugin) commandset - if not id in self._commandsets: - self._commandsets[id] = factory - - def bbb_register_javascript(self, filename): - if filename not in self._javascripts: - self._javascripts.append(filename) - - def bbb_register_extra_javascript(self, filename): - if filename not in self._extra_javascripts: - self._extra_javascripts.append(filename) + commandsets = bbb_commandsets.copy() + commandsets.update(self._commandsets) + return commandsets[id] + +#============================================= +# Stuff needed for compatibility features +#============================================= +def bbb_register_commandset(id, factory): + # make sure we only register when we do not have a better + # (new-style plugin) commandset + if not id in bbb_commandsets: + bbb_commandsets[id] = factory + +def bbb_register_javascript(filename): + if filename not in bbb_javascripts: + bbb_javascripts.append(filename) + +def bbb_register_extra_javascript(filename): + if filename not in bbb_extra_javascripts: + bbb_extra_javascripts.append(filename) Modified: kukit/kss.zope/trunk/kss/zope/registry.txt ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.txt (original) +++ kukit/kss.zope/trunk/kss/zope/registry.txt Sun Nov 11 13:56:10 2007 @@ -60,6 +60,10 @@ The code below is only used for backwards compatibility. It will be removed in a future release. + >>> from kss.zope.registry import bbb_register_commandset + >>> from kss.zope.registry import bbb_register_javascript + >>> from kss.zope.registry import bbb_register_extra_javascript + Next to automatically discovering commandsets (using the plugin system) there is support for registering a specific set. The registration is a simple call to the registry with a commandset @@ -68,25 +72,25 @@ >>> from kss.base.commands import KSSCommandSet >>> class CheeseCommandSet(KSSCommandSet): ... pass - >>> registry.bbb_register_commandset('cheese', CheeseCommandSet) + >>> bbb_register_commandset('cheese', CheeseCommandSet) >>> registry.lookup_commandset('cheese') If we register an already available one it will silently ignore the request. It will also keep the existing one. - >>> registry.bbb_register_commandset('core', CheeseCommandSet) + >>> bbb_register_commandset('core', CheeseCommandSet) >>> registry.lookup_commandset('core') We can also add Javascript files. - >>> registry.bbb_register_javascript('/some/path.js') + >>> bbb_register_javascript('/some/path.js') >>> list(registry.javascripts()) [..., '/some/path.js'] - >>> registry.bbb_register_extra_javascript('/some_other/path.js') + >>> bbb_register_extra_javascript('/some_other/path.js') >>> list(registry.extra_javascripts()) [..., '/some_other/path.js'] From jvloothuis at codespeak.net Sun Nov 11 14:00:53 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 11 Nov 2007 14:00:53 +0100 (CET) Subject: [KSS-checkins] r48562 - kukit/kss.zope/trunk/kss/zope Message-ID: <20071111130053.AABCE8245@code0.codespeak.net> Author: jvloothuis Date: Sun Nov 11 14:00:53 2007 New Revision: 48562 Modified: kukit/kss.zope/trunk/kss/zope/registry.py kukit/kss.zope/trunk/kss/zope/registry.txt Log: Added reset code for BBB registries (usefull for tests) Modified: kukit/kss.zope/trunk/kss/zope/registry.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.py (original) +++ kukit/kss.zope/trunk/kss/zope/registry.py Sun Nov 11 14:00:53 2007 @@ -57,5 +57,12 @@ if filename not in bbb_extra_javascripts: bbb_extra_javascripts.append(filename) - +def bbb_clear_out(): + global bbb_commandsets + bbb_commandsets = {} + global bbb_javascripts + bbb_javascripts = [] + global bbb_extra_javascripts + bbb_extra_javascripts = [] + Modified: kukit/kss.zope/trunk/kss/zope/registry.txt ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.txt (original) +++ kukit/kss.zope/trunk/kss/zope/registry.txt Sun Nov 11 14:00:53 2007 @@ -94,3 +94,18 @@ >>> list(registry.extra_javascripts()) [..., '/some_other/path.js'] +Now we can reset the bbb registry to be empty again. + + >>> from kss.zope.registry import bbb_clear_out + >>> bbb_clear_out() + + >>> 'some/path.js' in list(registry.javascripts()) + False + + >>> 'some_other/path.js' in list(registry.extra_javascripts()) + False + + >>> registry.lookup_commandset('cheese') + Traceback (most recent call last): + ... + KeyError: 'cheese' From reebalazs at codespeak.net Sun Nov 11 14:29:30 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 14:29:30 +0100 (CET) Subject: [KSS-checkins] r48563 - in kukit/kss.zope/trunk/kss: core/pluginregistry zope zope/bbb Message-ID: <20071111132930.4261A8230@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 14:29:27 2007 New Revision: 48563 Added: kukit/kss.zope/trunk/kss/zope/ttw.py Removed: kukit/kss.zope/trunk/kss/core/pluginregistry/commandset.py kukit/kss.zope/trunk/kss/core/pluginregistry/registry.py Modified: kukit/kss.zope/trunk/kss/core/pluginregistry/configure.py kukit/kss.zope/trunk/kss/core/pluginregistry/directives.py kukit/kss.zope/trunk/kss/core/pluginregistry/interfaces.py kukit/kss.zope/trunk/kss/core/pluginregistry/meta.zcml kukit/kss.zope/trunk/kss/zope/bbb/configure.py kukit/kss.zope/trunk/kss/zope/bbb/deprecated.py kukit/kss.zope/trunk/kss/zope/bbb/directives.py kukit/kss.zope/trunk/kss/zope/bbb/meta.zcml kukit/kss.zope/trunk/kss/zope/registry.py kukit/kss.zope/trunk/kss/zope/registry.txt Log: Add BBB for commandsets, and fix BBB for javascripts Deleted: /kukit/kss.zope/trunk/kss/core/pluginregistry/commandset.py ============================================================================== --- /kukit/kss.zope/trunk/kss/core/pluginregistry/commandset.py Sun Nov 11 14:29:27 2007 +++ (empty file) @@ -1,57 +0,0 @@ -# Copyright (c) 2005-2007 -# Authors: KSS Project Contributors (see docs/CREDITS.txt) -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -from zope.interface import implements -import zope.component as capi - -from plugin import KSSPluginError -from plugin import registerPlugin -from interfaces import ICommandSet - -def getRegisteredCommandSet(name): - 'Get the command set' - try: - commandset = capi.getUtility(ICommandSet, name) - except capi.ComponentLookupError: - raise KSSPluginError, '"%s" is not a registered kss command set' % (name, ) - return commandset - -class CommandSet(object): - '''The command set plugin - - registers the command adapter interface - (like IKssCoreCommands), this makes possible - to look them up by name instead of by interface - ''' - - implements(ICommandSet) - - def __init__(self, name, provides): - self.name = name - self.provides = provides - -def registerAndAllowCommandSet(class_, name, provides, *arg, **kw): - registerPlugin(CommandSet, ICommandSet, name, provides, *arg, **kw) - try: - import Products.Five - except ImportError: - pass - else: - # Allow TTW to use commandsets - from AccessControl import allow_class - allow_class(class_) - Modified: kukit/kss.zope/trunk/kss/core/pluginregistry/configure.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/configure.py (original) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/configure.py Sun Nov 11 14:29:27 2007 @@ -18,7 +18,6 @@ from zope.component.zcml import adapter from interfaces import ISelectorType from selector_type import SelectorType -from commandset import registerAndAllowCommandSet from plugin import registerPlugin def registerSelectorType(_context, name, jsfile=None): @@ -33,13 +32,3 @@ callable = registerPlugin, args = (SelectorType, ISelectorType, name, jsfile), ) - -def registerCommandSet(_context, for_, class_, name, provides): - 'Directive that registers a command set' - - adapter(_context, [class_], provides, [for_]) - _context.action( - discriminator = ('registerKssCommandSet', name), - callable = registerAndAllowCommandSet, - args = (class_, name, provides), - ) Modified: kukit/kss.zope/trunk/kss/core/pluginregistry/directives.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/directives.py (original) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/directives.py Sun Nov 11 14:29:27 2007 @@ -1,10 +1,6 @@ from zope.interface import Interface from zope.schema import TextLine -from zope.configuration.fields import ( - Path, - GlobalInterface, - GlobalObject, - ) +from zope.configuration.fields import Path class IRegisterSelectorTypeDirective(Interface): 'Register a KSS selector type' @@ -20,30 +16,3 @@ description=u"The path of the javascript file that defines the plugin", required=False, ) - -class IRegisterCommandSetDirective(Interface): - 'Register a KSS command set' - - for_ = GlobalInterface( - title=u"For", - description=u"The interface of view that can be adapted to this commandset", - required=True, - ) - - class_ = GlobalObject( - title=u"Class", - description=u"The class that implements the commandset", - required=True, - ) - - name = TextLine( - title=u"Name", - description=u"The name of the command set component.", - required=True, - ) - - provides = GlobalInterface( - title=u"Provides", - description=u"The interface that does the adaptation on the view for this set", - required=True, - ) Modified: kukit/kss.zope/trunk/kss/core/pluginregistry/interfaces.py ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/interfaces.py (original) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/interfaces.py Sun Nov 11 14:29:27 2007 @@ -25,6 +25,3 @@ class ISelectorType(IKSSPlugin): '''Selector type plugin''' - -class ICommandSet(Interface): - '''Command set plugin''' Modified: kukit/kss.zope/trunk/kss/core/pluginregistry/meta.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/core/pluginregistry/meta.zcml (original) +++ kukit/kss.zope/trunk/kss/core/pluginregistry/meta.zcml Sun Nov 11 14:29:27 2007 @@ -9,12 +9,6 @@ handler=".configure.registerSelectorType" /> - - Deleted: /kukit/kss.zope/trunk/kss/core/pluginregistry/registry.py ============================================================================== --- /kukit/kss.zope/trunk/kss/core/pluginregistry/registry.py Sun Nov 11 14:29:27 2007 +++ (empty file) @@ -1,32 +0,0 @@ -# Copyright (c) 2005-2007 -# Authors: KSS Project Contributors (see docs/CREDITS.txt) -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -import zope.component as capi -from zope.interface import implements -from concatresource.interfaces import IConcatResourceAddon -from kss.zope.interfaces import IKSSPluginRegistry - -class KSSConcatResourceAddon(object): - implements(IConcatResourceAddon) - - def getAddonFiles(self): - registry = capi.getUtility(IKSSPluginRegistry) - files = [] - files.extend(registry.javascripts()) - return files - -kssConcatResourceAddon = KSSConcatResourceAddon() Modified: kukit/kss.zope/trunk/kss/zope/bbb/configure.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/bbb/configure.py (original) +++ kukit/kss.zope/trunk/kss/zope/bbb/configure.py Sun Nov 11 14:29:27 2007 @@ -1,10 +1,43 @@ from deprecated import deprecated_directive +from kss.zope.ttw import allowCommandset +from kss.zope.registry import BBB_register_javascript, BBB_register_commandset -def nothing(*arg, **ks): - pass +when = 'after 2008-08-01' + +def doRegisterJavascript(jsfile): + if jsfile: + BBB_register_javascript(jsfile) + +def registerFor(directive): + def registerJavascript(_context, name, jsfile=None, **kwargs): + 'Directive that registers a javascript' + _context.action( + discriminator = ('registerKssJavascript', directive, name), + callable = doRegisterJavascript, + args = (jsfile, ), + ) + return registerJavascript # XXX TODO more meaningful messages here? -registerEventType = deprecated_directive(nothing, 'kss:eventtype', 'use python level registry instead') -registerAction = deprecated_directive(nothing, 'kss:action', 'use python level registry instead') -registerParamProvider = deprecated_directive(nothing, 'kss:paramprovider', 'use python level registry instead') +registerEventType = deprecated_directive('kss:eventtype', 'use python level registry instead', when)(registerFor('eventtype')) +registerAction = deprecated_directive('kss:action', 'use python level registry instead', when)(registerFor('action')) +registerParamProvider = deprecated_directive('kss:paramprovider', 'use python level registry instead', when)(registerFor('paramprovider')) + +def doRegisterCommandSet(class_, name, provides, *arg, **kw): + # provides is ignored + provides # to satisfy pyflakes + # register the commandset on python level + BBB_register_commandset(name, class_) + # Allow the commandset for ttw + allowCommandset(class_) + +# XXX TODO more meaningful message here? + at deprecated_directive('kss:commandset', 'use python level registry instead', when) +def registerCommandSet(_context, for_, class_, name, provides): + 'Directive that registers a command set' + _context.action( + discriminator = ('registerKssCommandSet', name), + callable = doRegisterCommandSet, + args = (class_, name, provides), + ) Modified: kukit/kss.zope/trunk/kss/zope/bbb/deprecated.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/bbb/deprecated.py (original) +++ kukit/kss.zope/trunk/kss/zope/bbb/deprecated.py Sun Nov 11 14:29:27 2007 @@ -27,17 +27,19 @@ return method(self, *args, **kw) return deprecated_method -def deprecated_directive(method, directive, message): - def deprecated_method(_context, *args, **kw): - warnings.warn(message, DeprecationWarning, 2) - warnings.warn(textwrap.dedent('''\ +def deprecated_directive(directive, message, when='any time'): + def f(method): + def deprecated_method(_context, *args, **kw): + warnings.warn(message, DeprecationWarning, 2) + warnings.warn(textwrap.dedent('''\ - %s - The directive %s is deprecated and will be removed any time, - %s - ''' - % (_context.info, directive, message)), - DeprecationWarning, 2) - return method(_context, *args, **kw) - return deprecated_method + %s + The directive %s is deprecated and will be removed %s, + %s + ''' + % (_context.info, directive, when, message)), + DeprecationWarning, 2) + return method(_context, *args, **kw) + return deprecated_method + return f Modified: kukit/kss.zope/trunk/kss/zope/bbb/directives.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/bbb/directives.py (original) +++ kukit/kss.zope/trunk/kss/zope/bbb/directives.py Sun Nov 11 14:29:27 2007 @@ -1,6 +1,12 @@ from zope.interface import Interface from zope.schema import TextLine, Choice -from zope.configuration.fields import Path, Tokens, PythonIdentifier +from zope.configuration.fields import ( + Path, + Tokens, + PythonIdentifier, + GlobalInterface, + GlobalObject, + ) class IRegisterEventTypeDirective(Interface): 'Register a KSS event type' @@ -73,3 +79,30 @@ description=u"The path of the javascript file that defines the plugin", required=False, ) + +class IRegisterCommandSetDirective(Interface): + 'Register a KSS command set' + + for_ = GlobalInterface( + title=u"For", + description=u"The interface of view that can be adapted to this commandset", + required=True, + ) + + class_ = GlobalObject( + title=u"Class", + description=u"The class that implements the commandset", + required=True, + ) + + name = TextLine( + title=u"Name", + description=u"The name of the command set component.", + required=True, + ) + + provides = GlobalInterface( + title=u"Provides", + description=u"The interface that does the adaptation on the view for this set", + required=True, + ) Modified: kukit/kss.zope/trunk/kss/zope/bbb/meta.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/zope/bbb/meta.zcml (original) +++ kukit/kss.zope/trunk/kss/zope/bbb/meta.zcml Sun Nov 11 14:29:27 2007 @@ -21,6 +21,12 @@ handler=".configure.registerParamProvider" /> + + Modified: kukit/kss.zope/trunk/kss/zope/registry.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.py (original) +++ kukit/kss.zope/trunk/kss/zope/registry.py Sun Nov 11 14:29:27 2007 @@ -4,9 +4,8 @@ from kss.zope.interfaces import IKSSPluginRegistry # BBB registries for configuration of plugins through ZCML -bbb_commandsets = {} -bbb_javascripts = [] -bbb_extra_javascripts = [] +BBB_commandsets = {} +BBB_javascripts = [] class GlobalPluginRegistry(object): interface.implements(IKSSPluginRegistry) @@ -30,39 +29,33 @@ return available_plugins() def javascripts(self): - return self._javascripts + bbb_javascripts + return self._javascripts + BBB_javascripts def extra_javascripts(self): - return self._extra_javascripts + bbb_extra_javascripts + return self._extra_javascripts def lookup_commandset(self, id): - commandsets = bbb_commandsets.copy() + commandsets = BBB_commandsets.copy() commandsets.update(self._commandsets) return commandsets[id] #============================================= # Stuff needed for compatibility features #============================================= -def bbb_register_commandset(id, factory): +def BBB_register_commandset(id, factory): # make sure we only register when we do not have a better # (new-style plugin) commandset - if not id in bbb_commandsets: - bbb_commandsets[id] = factory + if not id in BBB_commandsets: + BBB_commandsets[id] = factory -def bbb_register_javascript(filename): - if filename not in bbb_javascripts: - bbb_javascripts.append(filename) - -def bbb_register_extra_javascript(filename): - if filename not in bbb_extra_javascripts: - bbb_extra_javascripts.append(filename) - -def bbb_clear_out(): - global bbb_commandsets - bbb_commandsets = {} - global bbb_javascripts - bbb_javascripts = [] - global bbb_extra_javascripts - bbb_extra_javascripts = [] - - +def BBB_register_javascript(filename): + if filename not in BBB_javascripts: + BBB_javascripts.append(filename) + +def BBB_clear_out(): + global BBB_commandsets + BBB_commandsets = {} + global BBB_javascripts + BBB_javascripts = [] + global BBB_extra_javascripts + BBB_extra_javascripts = [] Modified: kukit/kss.zope/trunk/kss/zope/registry.txt ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.txt (original) +++ kukit/kss.zope/trunk/kss/zope/registry.txt Sun Nov 11 14:29:27 2007 @@ -60,9 +60,9 @@ The code below is only used for backwards compatibility. It will be removed in a future release. - >>> from kss.zope.registry import bbb_register_commandset - >>> from kss.zope.registry import bbb_register_javascript - >>> from kss.zope.registry import bbb_register_extra_javascript + >>> from kss.zope.registry import BBB_register_commandset + >>> from kss.zope.registry import BBB_register_javascript + >>> from kss.zope.registry import BBB_register_extra_javascript Next to automatically discovering commandsets (using the plugin system) there is support for registering a specific set. The @@ -72,39 +72,32 @@ >>> from kss.base.commands import KSSCommandSet >>> class CheeseCommandSet(KSSCommandSet): ... pass - >>> bbb_register_commandset('cheese', CheeseCommandSet) + >>> BBB_register_commandset('cheese', CheeseCommandSet) >>> registry.lookup_commandset('cheese') If we register an already available one it will silently ignore the request. It will also keep the existing one. - >>> bbb_register_commandset('core', CheeseCommandSet) + >>> BBB_register_commandset('core', CheeseCommandSet) >>> registry.lookup_commandset('core') We can also add Javascript files. - >>> bbb_register_javascript('/some/path.js') + >>> BBB_register_javascript('/some/path.js') >>> list(registry.javascripts()) [..., '/some/path.js'] - >>> bbb_register_extra_javascript('/some_other/path.js') - >>> list(registry.extra_javascripts()) - [..., '/some_other/path.js'] +Now we can reset the BBB registry to be empty again. -Now we can reset the bbb registry to be empty again. - - >>> from kss.zope.registry import bbb_clear_out - >>> bbb_clear_out() + >>> from kss.zope.registry import BBB_clear_out + >>> BBB_clear_out() >>> 'some/path.js' in list(registry.javascripts()) False - >>> 'some_other/path.js' in list(registry.extra_javascripts()) - False - >>> registry.lookup_commandset('cheese') Traceback (most recent call last): ... Added: kukit/kss.zope/trunk/kss/zope/ttw.py ============================================================================== --- (empty file) +++ kukit/kss.zope/trunk/kss/zope/ttw.py Sun Nov 11 14:29:27 2007 @@ -0,0 +1,17 @@ + +try: + import Products.Five + Products.Five # satisfy pyflakes + __have_five__ = True + from AccessControl import allow_class +except ImportError: + __have_five__ = False + +if __have_five__: + def allowCommandset(klass): + "Allow restricted execution for the commandset class" + # Allow TTW to use commandsets + allow_class(klass) +else: + def allowCommandset(klass): + pass From jvloothuis at codespeak.net Sun Nov 11 14:43:00 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 11 Nov 2007 14:43:00 +0100 (CET) Subject: [KSS-checkins] r48566 - kukit/kss.zope/trunk/kss/zope Message-ID: <20071111134300.21D4A8143@code0.codespeak.net> Author: jvloothuis Date: Sun Nov 11 14:42:59 2007 New Revision: 48566 Modified: kukit/kss.zope/trunk/kss/zope/commands.py Log: Implemented creation of Zope based commandsets Modified: kukit/kss.zope/trunk/kss/zope/commands.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/commands.py (original) +++ kukit/kss.zope/trunk/kss/zope/commands.py Sun Nov 11 14:42:59 2007 @@ -14,7 +14,7 @@ registry = component.getUtility(IKSSPluginRegistry) commandset_factory = registry.lookup_commandset(name) if IZopeCommandSet.implementedBy(commandset_factory): - return + return commandset_factory(self.view) else: return commandset_factory(self) From jvloothuis at codespeak.net Sun Nov 11 15:15:07 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 11 Nov 2007 15:15:07 +0100 (CET) Subject: [KSS-checkins] r48568 - kukit/kss.base/trunk/kss/base Message-ID: <20071111141507.A67C2824D@code0.codespeak.net> Author: jvloothuis Date: Sun Nov 11 15:15:05 2007 New Revision: 48568 Modified: kukit/kss.base/trunk/kss/base/corecommands.py kukit/kss.base/trunk/kss/base/corecommands.txt Log: Added withKssSetup for the HTML replacement commands. This can be used for faster operation at the cost of reduced functionality. Modified: kukit/kss.base/trunk/kss/base/corecommands.py ============================================================================== --- kukit/kss.base/trunk/kss/base/corecommands.py (original) +++ kukit/kss.base/trunk/kss/base/corecommands.py Sun Nov 11 15:15:05 2007 @@ -22,13 +22,20 @@ def focus(self, selector): self.commands.add('focus', selector) - def replaceInnerHTML(self, selector, value): + def replaceInnerHTML(self, selector, value, withKssSetup=True): """Replace the contents of a node (selector) with the new `value`""" - self.commands.add('replaceInnerHTML', selector, html=value) - - def replaceHTML(self, selector, value): - self.commands.add('replaceHTML', selector, html=value) - + extra_args = {} + if not withKssSetup: + extra_args['withKssSetup'] = 'False' + self.commands.add('replaceInnerHTML', selector, html=value, + **extra_args) + + def replaceHTML(self, selector, value, withKssSetup=True): + extra_args = {} + if not withKssSetup: + extra_args['withKssSetup'] = 'False' + self.commands.add('replaceHTML', selector, html=value, + **extra_args) def insertHTMLBefore(self, selector, value): self.commands.add('insertHTMLBefore', selector, html=value) Modified: kukit/kss.base/trunk/kss/base/corecommands.txt ============================================================================== --- kukit/kss.base/trunk/kss/base/corecommands.txt (original) +++ kukit/kss.base/trunk/kss/base/corecommands.txt Sun Nov 11 15:15:05 2007 @@ -97,6 +97,15 @@ >>> print commands replaceInnerHTML(css('div'), html='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. + + >>> core.replaceInnerHTML(css('div'), 'some html', withKssSetup=False) + >>> print commands + replaceInnerHTML(css('div'), html='some html') + replaceInnerHTML(css('div'), html='some html', withKssSetup='False') + + Replace HTML ------------ @@ -105,6 +114,13 @@ >>> print commands replaceHTML(css('div'), html='some html') +You can also pass withKssSetup here (see replace inner HTML). + + >>> core.replaceHTML(css('div'), 'some html', withKssSetup=False) + >>> print commands + replaceHTML(css('div'), html='some html') + replaceHTML(css('div'), html='some html', withKssSetup='False') + -------------- HTML insertion From jvloothuis at codespeak.net Sun Nov 11 15:16:10 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 11 Nov 2007 15:16:10 +0100 (CET) Subject: [KSS-checkins] r48569 - kukit/kss.zope/trunk/kss/zope Message-ID: <20071111141610.521848226@code0.codespeak.net> Author: jvloothuis Date: Sun Nov 11 15:16:10 2007 New Revision: 48569 Modified: kukit/kss.zope/trunk/kss/zope/commands.py kukit/kss.zope/trunk/kss/zope/commandset.py Log: Lookup of Zope specific commandsets now works. Added a compat wrapper for the `core` commandset to include selectors. Modified: kukit/kss.zope/trunk/kss/zope/commands.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/commands.py (original) +++ kukit/kss.zope/trunk/kss/zope/commands.py Sun Nov 11 15:16:10 2007 @@ -2,6 +2,8 @@ from kss.base import KSSCommands from kss.zope.interfaces import IKSSPluginRegistry, IZopeCommandSet +from kss.zope.commandset import CompatCommandSet + class KSSZopeCommands(KSSCommands): def __init__(self, view, context, request): @@ -13,7 +15,12 @@ def __getattr__(self, name): registry = component.getUtility(IKSSPluginRegistry) commandset_factory = registry.lookup_commandset(name) - if IZopeCommandSet.implementedBy(commandset_factory): + + # BBB hack for adding more stuff to the core + if name == 'core': + return CompatCommandSet(self.view) + # end of BBB + elif IZopeCommandSet.implementedBy(commandset_factory): return commandset_factory(self.view) else: return commandset_factory(self) Modified: kukit/kss.zope/trunk/kss/zope/commandset.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/commandset.py (original) +++ kukit/kss.zope/trunk/kss/zope/commandset.py Sun Nov 11 15:16:10 2007 @@ -1,8 +1,10 @@ from zope import interface +from kss.base.coreselectors import htmlid, css +from kss.base.corecommands import KSSCoreCommands from kss.zope.interfaces import IZopeCommandSet -class ZopeCommandSet: +class ZopeCommandSet(object): interface.implements(IZopeCommandSet) def __init__(self, view): @@ -14,3 +16,11 @@ def getCommandSet(self, name): return self.view.getCommandSet(name) +# BBB selector compat wrapper +class CompatCommandSet(ZopeCommandSet, KSSCoreCommands): + + def getHtmlIdSelector(self, value): + return htmlid(value) + + def getCssSelector(self, value): + return css(value) From reebalazs at codespeak.net Sun Nov 11 16:00:23 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 16:00:23 +0100 (CET) Subject: [KSS-checkins] r48570 - in kukit/kss.zope/trunk/kss: core/plugins/core zope zope/bbb Message-ID: <20071111150023.31CF68277@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 16:00:20 2007 New Revision: 48570 Modified: kukit/kss.zope/trunk/kss/core/plugins/core/configure.zcml kukit/kss.zope/trunk/kss/zope/bbb/configure.py kukit/kss.zope/trunk/kss/zope/registry.py kukit/kss.zope/trunk/kss/zope/registry.txt Log: Fix BBB for comandsets, javascript Modified: kukit/kss.zope/trunk/kss/core/plugins/core/configure.zcml ============================================================================== --- kukit/kss.zope/trunk/kss/core/plugins/core/configure.zcml (original) +++ kukit/kss.zope/trunk/kss/core/plugins/core/configure.zcml Sun Nov 11 16:00:20 2007 @@ -416,11 +416,13 @@ + Modified: kukit/kss.zope/trunk/kss/zope/bbb/configure.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/bbb/configure.py (original) +++ kukit/kss.zope/trunk/kss/zope/bbb/configure.py Sun Nov 11 16:00:20 2007 @@ -1,7 +1,11 @@ from deprecated import deprecated_directive from kss.zope.ttw import allowCommandset -from kss.zope.registry import BBB_register_javascript, BBB_register_commandset +from kss.zope.registry import ( + BBB_register_javascript, + BBB_get_commandsets, + BBB_register_commandset, + ) when = 'after 2008-08-01' @@ -24,6 +28,9 @@ registerAction = deprecated_directive('kss:action', 'use python level registry instead', when)(registerFor('action')) registerParamProvider = deprecated_directive('kss:paramprovider', 'use python level registry instead', when)(registerFor('paramprovider')) +class BBBKSSRegistrationError(Exception): + pass + def doRegisterCommandSet(class_, name, provides, *arg, **kw): # provides is ignored provides # to satisfy pyflakes @@ -36,6 +43,18 @@ @deprecated_directive('kss:commandset', 'use python level registry instead', when) def registerCommandSet(_context, for_, class_, name, provides): 'Directive that registers a command set' + # check the commandset on python level + python_commandsets = BBB_get_commandsets() + if name in python_commandsets: + # duplicate name + klass = python_commandsets[name] + classname = klass.__module__ + '.' + klass.__name__ + if classname != class_: + raise BBBKSSRegistrationError, \ + 'The commandset "%s" is already registered on the python level, ' \ + 'and classes differ %s != %s' % \ + (name, classname, class_) + _context.action( discriminator = ('registerKssCommandSet', name), callable = doRegisterCommandSet, Modified: kukit/kss.zope/trunk/kss/zope/registry.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.py (original) +++ kukit/kss.zope/trunk/kss/zope/registry.py Sun Nov 11 16:00:20 2007 @@ -42,14 +42,28 @@ #============================================= # Stuff needed for compatibility features #============================================= + +def BBB_get_commandsets(): + '''Returns python level registered commandsets + allows to avoid double registration''' + # XXX a direct method for returninf the dict would be better + commandsets = {} + for plugin_id, config in available_plugins(): + commandsets.update(config.commandsets) + return commandsets + def BBB_register_commandset(id, factory): - # make sure we only register when we do not have a better - # (new-style plugin) commandset - if not id in BBB_commandsets: - BBB_commandsets[id] = factory + # Caller should check for duplicates. + BBB_commandsets[id] = factory def BBB_register_javascript(filename): - if filename not in BBB_javascripts: + # XXX a direct call to get them would be better. + javascripts = [] + for id, config in available_plugins(): + for javascript in config.javascripts: + javascripts.append(javascript) + # + if filename not in javascripts: BBB_javascripts.append(filename) def BBB_clear_out(): Modified: kukit/kss.zope/trunk/kss/zope/registry.txt ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.txt (original) +++ kukit/kss.zope/trunk/kss/zope/registry.txt Sun Nov 11 16:00:20 2007 @@ -62,7 +62,6 @@ >>> from kss.zope.registry import BBB_register_commandset >>> from kss.zope.registry import BBB_register_javascript - >>> from kss.zope.registry import BBB_register_extra_javascript Next to automatically discovering commandsets (using the plugin system) there is support for registering a specific set. The @@ -76,19 +75,18 @@ >>> registry.lookup_commandset('cheese') -If we register an already available one it will silently ignore the -request. It will also keep the existing one. - - >>> BBB_register_commandset('core', CheeseCommandSet) - >>> registry.lookup_commandset('core') - - We can also add Javascript files. >>> BBB_register_javascript('/some/path.js') >>> list(registry.javascripts()) [..., '/some/path.js'] +A duplicate file does not appear again. + + >>> saved = list(registry.javascripts()) + >>> BBB_register_javascript(saved[0]) + >>> registry.javascripts() == saved + True Now we can reset the BBB registry to be empty again. From reebalazs at codespeak.net Sun Nov 11 16:28:06 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 16:28:06 +0100 (CET) Subject: [KSS-checkins] r48571 - kukit/kss.zope/trunk/kss/zope Message-ID: <20071111152806.97A918259@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 16:28:04 2007 New Revision: 48571 Modified: kukit/kss.zope/trunk/kss/zope/registry.py kukit/kss.zope/trunk/kss/zope/registry.txt Log: Fix BBB of javascripts, now duplicates are correctly handled Modified: kukit/kss.zope/trunk/kss/zope/registry.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.py (original) +++ kukit/kss.zope/trunk/kss/zope/registry.py Sun Nov 11 16:28:04 2007 @@ -60,10 +60,10 @@ # XXX a direct call to get them would be better. javascripts = [] for id, config in available_plugins(): - for javascript in config.javascripts: - javascripts.append(javascript) + javascripts.extend(config.javascripts) # - if filename not in javascripts: + if (filename not in javascripts and + filename not in BBB_javascripts): BBB_javascripts.append(filename) def BBB_clear_out(): Modified: kukit/kss.zope/trunk/kss/zope/registry.txt ============================================================================== --- kukit/kss.zope/trunk/kss/zope/registry.txt (original) +++ kukit/kss.zope/trunk/kss/zope/registry.txt Sun Nov 11 16:28:04 2007 @@ -88,6 +88,13 @@ >>> registry.javascripts() == saved True +Not even, if it is added again from BBB. + + >>> BBB_register_javascript('/some/path.js') + >>> registry.javascripts() == saved + True + + Now we can reset the BBB registry to be empty again. >>> from kss.zope.registry import BBB_clear_out From reebalazs at codespeak.net Sun Nov 11 16:49:51 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 16:49:51 +0100 (CET) Subject: [KSS-checkins] r48576 - kukit/kss.zope/trunk/kss/zope/bbb Message-ID: <20071111154951.72C5F825D@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 16:49:51 2007 New Revision: 48576 Modified: kukit/kss.zope/trunk/kss/zope/bbb/configure.py Log: Improve BBB a bit Modified: kukit/kss.zope/trunk/kss/zope/bbb/configure.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/bbb/configure.py (original) +++ kukit/kss.zope/trunk/kss/zope/bbb/configure.py Sun Nov 11 16:49:51 2007 @@ -23,10 +23,13 @@ ) return registerJavascript +registerEventType = registerFor('eventtype') +registerAction = registerFor('action') +registerParamProvider = registerFor('paramprovider') # XXX TODO more meaningful messages here? -registerEventType = deprecated_directive('kss:eventtype', 'use python level registry instead', when)(registerFor('eventtype')) -registerAction = deprecated_directive('kss:action', 'use python level registry instead', when)(registerFor('action')) -registerParamProvider = deprecated_directive('kss:paramprovider', 'use python level registry instead', when)(registerFor('paramprovider')) +registerEventType = deprecated_directive('kss:eventtype', 'use python level registry instead', when)(registerEventType) +registerAction = deprecated_directive('kss:action', 'use python level registry instead', when)(registerAction) +registerParamProvider = deprecated_directive('kss:paramprovider', 'use python level registry instead', when)(registerParamProvider) class BBBKSSRegistrationError(Exception): pass From reebalazs at codespeak.net Sun Nov 11 16:52:50 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 11 Nov 2007 16:52:50 +0100 (CET) Subject: [KSS-checkins] r48577 - kukit/kss.zope/trunk/kss/zope/bbb Message-ID: <20071111155250.C776A8257@code0.codespeak.net> Author: reebalazs Date: Sun Nov 11 16:52:50 2007 New Revision: 48577 Modified: kukit/kss.zope/trunk/kss/zope/bbb/configure.py Log: Desctivate BBB messages, as this is too early yet. Better policy at the moment, is still allow the kss.core style zcml registration for plugins and commandsets. Modified: kukit/kss.zope/trunk/kss/zope/bbb/configure.py ============================================================================== --- kukit/kss.zope/trunk/kss/zope/bbb/configure.py (original) +++ kukit/kss.zope/trunk/kss/zope/bbb/configure.py Sun Nov 11 16:52:50 2007 @@ -27,9 +27,10 @@ registerAction = registerFor('action') registerParamProvider = registerFor('paramprovider') # XXX TODO more meaningful messages here? -registerEventType = deprecated_directive('kss:eventtype', 'use python level registry instead', when)(registerEventType) -registerAction = deprecated_directive('kss:action', 'use python level registry instead', when)(registerAction) -registerParamProvider = deprecated_directive('kss:paramprovider', 'use python level registry instead', when)(registerParamProvider) +## Don't BBB yet. Uncommenting the next three lines will activate BBB. +##registerEventType = deprecated_directive('kss:eventtype', 'use python level registry instead', when)(registerEventType) +##registerAction = deprecated_directive('kss:action', 'use python level registry instead', when)(registerAction) +##registerParamProvider = deprecated_directive('kss:paramprovider', 'use python level registry instead', when)(registerParamProvider) class BBBKSSRegistrationError(Exception): pass @@ -43,7 +44,8 @@ allowCommandset(class_) # XXX TODO more meaningful message here? - at deprecated_directive('kss:commandset', 'use python level registry instead', when) +## Don't BBB yet. Uncommenting the next line will activate BBB. +##@deprecated_directive('kss:commandset', 'use python level registry instead', when) def registerCommandSet(_context, for_, class_, name, provides): 'Directive that registers a command set' # check the commandset on python level From jvloothuis at codespeak.net Mon Nov 12 13:36:58 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Mon, 12 Nov 2007 13:36:58 +0100 (CET) Subject: [KSS-checkins] r48592 - kukit/kss.templates/trunk/kss/templates/plugin/+package+ Message-ID: <20071112123658.296CF82A1@code0.codespeak.net> Author: jvloothuis Date: Mon Nov 12 13:36:57 2007 New Revision: 48592 Modified: kukit/kss.templates/trunk/kss/templates/plugin/+package+/config.py_tmpl Log: Added an import for the Plugin class which was missing Modified: kukit/kss.templates/trunk/kss/templates/plugin/+package+/config.py_tmpl ============================================================================== --- kukit/kss.templates/trunk/kss/templates/plugin/+package+/config.py_tmpl (original) +++ kukit/kss.templates/trunk/kss/templates/plugin/+package+/config.py_tmpl Mon Nov 12 13:36:57 2007 @@ -1,5 +1,7 @@ import os +from kss.base.plugin import Plugin + from ${package}.commands import ${package.capitalize()}Commands package_dir = os.path.dirname(os.path.abspath(__file__)) From jvloothuis at codespeak.net Mon Nov 12 13:57:40 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Mon, 12 Nov 2007 13:57:40 +0100 (CET) Subject: [KSS-checkins] r48594 - kukit/kss.base/trunk/kss/base Message-ID: <20071112125740.077F1829A@code0.codespeak.net> Author: jvloothuis Date: Mon Nov 12 13:57:40 2007 New Revision: 48594 Modified: kukit/kss.base/trunk/kss/base/commands.py Log: Changed the protocol generation. It now uses the non HTML version for communicating with the browser. Modified: kukit/kss.base/trunk/kss/base/commands.py ============================================================================== --- kukit/kss.base/trunk/kss/base/commands.py (original) +++ kukit/kss.base/trunk/kss/base/commands.py Mon Nov 12 13:57:40 2007 @@ -3,16 +3,18 @@ from kss.base.selectors import Selector from kss.base.coreselectors import css -kss_response_header = ''' -''' +kss_response_header = ''' + +''' -kss_response_footer = '' +kss_response_footer = '' -kss_command_start = '' -kss_command_end = '' +kss_command_start = '' -kss_param = '' +kss_command_end = '' + +kss_param = '' class KSSCommands(object): '''Command renderer for creating KSS responses''' From jvloothuis at codespeak.net Mon Nov 12 18:31:11 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Mon, 12 Nov 2007 18:31:11 +0100 (CET) Subject: [KSS-checkins] r48605 - kukit/kss.base/trunk/kss/base Message-ID: <20071112173111.F142482A9@code0.codespeak.net> Author: jvloothuis Date: Mon Nov 12 18:31:11 2007 New Revision: 48605 Modified: kukit/kss.base/trunk/kss/base/commands.txt Log: Updated the test suite. It now has some validation for the response document. Modified: kukit/kss.base/trunk/kss/base/commands.txt ============================================================================== --- kukit/kss.base/trunk/kss/base/commands.txt (original) +++ kukit/kss.base/trunk/kss/base/commands.txt Mon Nov 12 18:31:11 2007 @@ -1,3 +1,4 @@ +============ KSS Commands ============ @@ -38,14 +39,44 @@ >>> commands.render() '...some value...some arg...' -The response is an XML document where each parameter value is put -within CDATA blocks. + +Response format +=============== + +The response is an XML document. + + >>> from xml.dom import minidom + >>> doc = minidom.parseString(commands.render()) + +In this case there are two commands in the response (because of 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 CDATA blocks. + + >>> replace_command = doc.getElementsByTagName('command')[0] + + >>> params = replace_command.getElementsByTagName('param') + >>> html_value = params[0] + >>> html_value.attributes['name'].nodeValue + u'html' + + >>> html_value.childNodes[0].nodeType == doc.CDATA_SECTION_NODE + True >>> commands.render() '......' We are using CDATA because Firefox chops text nodes at 4KB blocks -(which makes the client side handling more difficult). +(which makes the client side handling more difficult). Using CDATA +avoids the chopping. + + +String representation +===================== It is also possible to get a string representation of the commandset. This can be used in doctests like this. @@ -79,6 +110,10 @@ replaceHTML(css('#someid'), a_arg='cheese', b_arg='some data') otherCommand(css('#something')) + +Features for working with commands +================================== + If we add a parameter with a `None` value it will not be put into the response. From jvloothuis at codespeak.net Mon Nov 12 19:14:16 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Mon, 12 Nov 2007 19:14:16 +0100 (CET) Subject: [KSS-checkins] r48607 - kukit/kss.base/trunk Message-ID: <20071112181416.CB3AD82A9@code0.codespeak.net> Author: jvloothuis Date: Mon Nov 12 19:14:16 2007 New Revision: 48607 Modified: kukit/kss.base/trunk/setup.py Log: Prepare for release. Modified: kukit/kss.base/trunk/setup.py ============================================================================== --- kukit/kss.base/trunk/setup.py (original) +++ kukit/kss.base/trunk/setup.py Mon Nov 12 19:14:16 2007 @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.1' +version = '0.2' long_description = """ KSS enables you write rich Ajax applications without having to code From jvloothuis at codespeak.net Mon Nov 12 19:18:32 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Mon, 12 Nov 2007 19:18:32 +0100 (CET) Subject: [KSS-checkins] r48608 - kukit/kss.base/tags/0.2 Message-ID: <20071112181832.3CDEF82A9@code0.codespeak.net> Author: jvloothuis Date: Mon Nov 12 19:18:30 2007 New Revision: 48608 Added: kukit/kss.base/tags/0.2/ - copied from r48607, kukit/kss.base/trunk/ Log: Tagged for release From reebalazs at codespeak.net Tue Nov 13 09:32:07 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Tue, 13 Nov 2007 09:32:07 +0100 (CET) Subject: [KSS-checkins] r48628 - kukit/buildout/kss.zope Message-ID: <20071113083207.F27E382B3@code0.codespeak.net> Author: reebalazs Date: Tue Nov 13 09:32:06 2007 New Revision: 48628 Modified: kukit/buildout/kss.zope/ (props changed) kukit/buildout/kss.zope/EXTERNALS.txt kukit/buildout/kss.zope/base.cfg Log: Updated to ploneout's new config Also replaced the src directory, it is now including src of ploneout completely p.s. currently broken, as is ploneout trunk. Fix coming up... Modified: kukit/buildout/kss.zope/EXTERNALS.txt ============================================================================== --- kukit/buildout/kss.zope/EXTERNALS.txt (original) +++ kukit/buildout/kss.zope/EXTERNALS.txt Tue Nov 13 09:32:06 2007 @@ -3,3 +3,5 @@ # products https://svn.plone.org/svn/plone/bundles/trunk +# Use original src from ploneout. +src https://svn.plone.org/svn/plone/ploneout/trunk/src Modified: kukit/buildout/kss.zope/base.cfg ============================================================================== --- kukit/buildout/kss.zope/base.cfg (original) +++ kukit/buildout/kss.zope/base.cfg Tue Nov 13 09:32:06 2007 @@ -9,18 +9,30 @@ elementtree python-gettext >= 0.6 +# Section taken (and updated) from ploneout. +# with some packages clearly commented out, +# and extra packages added to the end. develop = src/Products.ATReferenceBrowserWidget src/Products.CMFDynamicViewFTI src/Products.CMFFormController + src/Products.CMFCore + src/Products.CMFPlone src/Products.CMFQuickInstallerTool + src/Products.GenericSetup + src/Products.PasswordResetTool src/Products.PlacelessTranslationService src/Products.PloneLanguageTool src/Products.PlonePAS + src/Products.PluggableAuthService + src/Products.PluginRegistry src/Products.ResourceRegistries src/Products.SecureMailHost src/Products.statusmessages src/archetypes.kss +# Disable kss.core, since now kss.zope egg +# provides the kss.core package stub. +# src/kss.core src/plone.app.contentmenu src/plone.app.content src/plone.app.contentrules @@ -52,6 +64,7 @@ src/wicked src/five.customerize src/five.localsitemanager +# Packages needed in addition to ploneout: transition/kss.base transition/kss.zope transition/kss.demo @@ -61,7 +74,6 @@ # url = http://www.zope.org/Products/Zope/2.10.4/Zope-2.10.4-final.tgz svn = svn://svn.zope.org/repos/main/Zope/trunk - [instance] recipe = plone.recipe.zope2instance zope2-location = ${zope2:location} @@ -74,53 +86,12 @@ eggs = ${buildout:eggs} - Products.ATReferenceBrowserWidget - Products.CMFDynamicViewFTI - Products.CMFFormController - Products.CMFQuickInstallerTool - Products.PlacelessTranslationService - Products.PloneLanguageTool - Products.PlonePAS - Products.ResourceRegistries - Products.SecureMailHost - Products.statusmessages - archetypes.kss - plone.app.contentmenu - plone.app.content - plone.app.contentrules - plone.app.controlpanel - plone.app.customerize - plone.app.form - plone.app.i18n - plone.app.iterate - plone.app.kss - plone.app.layout - plone.app.linkintegrity - plone.app.openid - plone.app.portlets - plone.app.redirector - plone.app.viewletmanager - plone.app.vocabularies - plone.app.workflow - plone.contentrules - plone.fieldsets - plone.i18n - plone.intelligenttext - plone.locking - plone.memoize - plone.openid - plone.portlets - plone.session - plone.theme - txtfilter - wicked - five.customerize - five.localsitemanager - kss.base - kss.zope - kss.demo + Products.CMFPlone zcml = + Products.CMFPlone + Products.CMFPlone-meta + Products.CMFPlone-overrides kss.zope kss.zope-meta kss.demo From reebalazs at codespeak.net Tue Nov 13 10:55:58 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Tue, 13 Nov 2007 10:55:58 +0100 (CET) Subject: [KSS-checkins] r48637 - kukit/buildout/kss.zope/src Message-ID: <20071113095558.5CC4E82D1@code0.codespeak.net> Author: reebalazs Date: Tue Nov 13 10:55:57 2007 New Revision: 48637 Removed: kukit/buildout/kss.zope/src/ Log: Dear svn. Delete src, please. Yours truly. From reebalazs at codespeak.net Tue Nov 13 11:35:01 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Tue, 13 Nov 2007 11:35:01 +0100 (CET) Subject: [KSS-checkins] r48640 - kukit/buildout/kss.zope Message-ID: <20071113103501.D3B2182E0@code0.codespeak.net> Author: reebalazs Date: Tue Nov 13 11:35:00 2007 New Revision: 48640 Modified: kukit/buildout/kss.zope/base.cfg Log: Fix config Modified: kukit/buildout/kss.zope/base.cfg ============================================================================== --- kukit/buildout/kss.zope/base.cfg (original) +++ kukit/buildout/kss.zope/base.cfg Tue Nov 13 11:35:00 2007 @@ -87,6 +87,9 @@ eggs = ${buildout:eggs} Products.CMFPlone + kss.base + kss.zope + kss.demo zcml = Products.CMFPlone From kukit-checkins at codespeak.net Tue Nov 13 12:10:29 2007 From: kukit-checkins at codespeak.net (VIAGRA ® Official Site) Date: Tue, 13 Nov 2007 12:10:29 +0100 (CET) Subject: [KSS-checkins] November 76% OFF Message-ID: <20071113171031.7031.qmail@p11038-ipadfx21sasajima.aichi.ocn.ne.jp> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20071113/0564d3f0/attachment.htm From jvloothuis at codespeak.net Wed Nov 14 23:32:08 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Wed, 14 Nov 2007 23:32:08 +0100 (CET) Subject: [KSS-checkins] r48693 - in kukit/kss.base/branches/basehttpserver-functional-testing/kss/base: . html Message-ID: <20071114223208.7C0B0811A@code0.codespeak.net> Author: jvloothuis Date: Wed Nov 14 23:32:07 2007 New Revision: 48693 Added: kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/html/ kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/html/basic_commands.kss kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/html/focus.html Modified: kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/config.py kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/corecommands.py kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/testing.py Log: The HTML template now generates links to the KSS Javascript and KSS resource for a test. Implemented the loading of the KSS Javascript. All Javascript include the extras is concatinatinated into one big file. Loading of KSS resources works. Server handlers now work. There is an example of this in the core plugin config. Together all this means that we have all the (primitive) ingredients for testing KSS without depending on a full webframework. Modified: kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/config.py ============================================================================== --- kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/config.py (original) +++ kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/config.py Wed Nov 14 23:32:07 2007 @@ -6,7 +6,9 @@ from kss.base.testing import Section, Test -kukit_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'kukit') +package_dir = os.path.dirname(os.path.abspath(__file__)) +kukit_dir = os.path.join(package_dir, 'kukit') +html_dir = os.path.join(package_dir, 'html') # Define the Javascripts by hand to ensure the order core_js = ['utils.js', @@ -34,6 +36,10 @@ 'sarissa.js', ] +def test_div_content(commands, request): + commands.core.replaceInnerHTML('#demo', 'KSS ROCKS!!!!!!!') + + class KSSCore(Plugin): '''The KSS core plugin has all the standard functionality''' @@ -51,8 +57,8 @@ selectors = [css, htmlid, samenode, parentnode] functional_tests = [Test( - name='Focus', - html='/tmp/kss_demo.html', + name='Basic commands', + html=os.path.join(html_dir, 'focus.html'), css='/tmp/demo.css', - kss='blah.kss', - handler=lambda request: 'ok')] + kss=os.path.join(html_dir, 'basic_commands.kss'), + handlers={'getDivContent': test_div_content})] Modified: kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/corecommands.py ============================================================================== --- kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/corecommands.py (original) +++ kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/corecommands.py Wed Nov 14 23:32:07 2007 @@ -78,6 +78,3 @@ def triggerEvent(self, name, **kwargs): self.commands.add('triggerEvent', None, name=name, **kwargs) - - - Added: kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/html/basic_commands.kss ============================================================================== --- (empty file) +++ kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/html/basic_commands.kss Wed Nov 14 23:32:07 2007 @@ -0,0 +1,20 @@ +button#copyFrom:click { + action-server: copyFromDivContent; +} + +button#copyTo:click { + action-server: copyToDivContent; +} + +button#moveTo:click { + action-server: moveToDivContent; +} + +button#clear:click { + action-server: clearDivContent; +} + +button#change:click { + action-server: getDivContent; +} + Added: kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/html/focus.html ============================================================================== --- (empty file) +++ kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/html/focus.html Wed Nov 14 23:32:07 2007 @@ -0,0 +1,104 @@ +

    Change tag content

    +

    Top div

    +
    + KSS +
    + +

    Bottom div

    +
    + copy here +
    +

    Javascript Styling

    +

    This page defines a link in the header which rel attribute points + to a .kss resource file on the server : + + + see the kss file here.

    +

    + This .kss file declares CSS selectors associated with events and server URLs called when the event occur. +

    +

    A javascript engine processes the XML content : it inserts javascript + events in the DOM.

    +

    + For instance, the click event of button with the id change will call asynchronously the getDivContent URL. + +

    +

    Server Asynchronous Call

    +

    + The events associated with Javascript just call the server asynchronously. +

    +

    + The response is a XML file. + The XML contains CSS selectors associated with commands. +

    +

    + The Javascript engine selects the DOM nodes to which it applies each command. +

    +

    + For instance, let's look at the moveToDivContent response. +

    +
    +  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    +  <html xmlns="http://www.w3.org/1999/xhtml"
    +  xmlns:kukit="http://www.kukit.org/commands/1.0"><body>
    +  <kukit:commands>
    +  <kukit:command selector="div#copy" name="copyChildNodesTo"
    +  selectorType="">
    +  <kukit:param name="html_id">demo</kukit:param>
    +  </kukit:command>
    +  <kukit:command selector="div#copy" name="clearChildNodes"
    +  selectorType="">
    +  </kukit:command>
    +  </kukit:commands>
    +  </body></html>
    +
    +

    + The XML specifies two commands to apply to the div#copy node : +

    +

    + copyChildNodesTo copies the children of the DOM node to the node with id demo. +

    +

    + clearChildNodes removes the children of the DOM node. +

    Modified: kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/testing.py ============================================================================== --- kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/testing.py (original) +++ kukit/kss.base/branches/basehttpserver-functional-testing/kss/base/testing.py Wed Nov 14 23:32:07 2007 @@ -1,7 +1,12 @@ import string -from kss.base.plugin import activated_plugins +import os from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler +from kss.base.plugin import activated_plugins +from kss.base.javascript import packed +from kss.base.javascript import extra_scripts +from kss.base import KSSCommands + front_page = ''' @@ -27,25 +32,52 @@ test_page_html = ''' + + - + - $html +

    $name

    + $html ''' +import re + class PluginTestsuiteRequestHandler(BaseHTTPRequestHandler): def do_GET(self): path = self.path if path == '/': return self.do_index() + elif path == '/kss.js': + return self.do_kss_js() elif path.endswith('.html'): return self.do_test_html() - else: - return self.do_test_css() + elif path.endswith('.kss'): + return self.do_test_kss() + + def do_POST(self): + plugin_id, test_id, handler_id = re.findall( + '^/([\w-]+)/([\w-]+)/([\w-]+)', self.path)[0] + + id, plugin, test = self.load_test(plugin_id, test_id) + + + handler = test.handlers[handler_id] + + commands = KSSCommands() + handler(commands, 'some request obj') + + self.send_response(200) + self.send_header('Content-type', 'text/xml') + self.end_headers() + + self.wfile.write(commands.render()) + self.wfile.close() + def send_html_headers(self): self.send_response(200) @@ -68,23 +100,53 @@ return '/%s/%s' % (self.name_to_url_safe(plugin_id), self.name_to_url_safe(test.name)) - def load_from_path(self, extension): - parts = self.path[:-len(extension)].split('/') - print parts + def load_from_path(self, extension=None): + if extension is None: + parts = self.path.split('/') + else: + parts = self.path[:-len(extension)].split('/') + return self.load_test(parts[1], parts[2]) + + def load_test(self, plugin_id, test_id): for id, plugin in activated_plugins(): - if parts[1] == id: + if plugin_id == id: for test in plugin.functional_tests: - if self.name_to_url_safe(test.name) == parts[2]: + if self.name_to_url_safe(test.name) == test_id: return (id, plugin, test) - def do_test_css(self): + + def do_kss_js(self): + self.send_response(200) + self.send_header('Content-Type', 'text/javascript') + self.end_headers() + + data = list(extra_scripts().values()) + data.append(packed()) + self.wfile.write('\n'.join(data)) + self.wfile.close() + + + def do_test_kss(self): + self.send_response(200) + self.send_header('Content-Type', 'text/kss') + self.end_headers() + + id, plugin, test = self.load_from_path('.kss') + self.wfile.write(open(test.kss).read()) + self.wfile.close() + + + def do_test_static(self): + filename = self.path.split('/')[-1] + extension = filename.split('.')[-1] + self.send_response(200) - self.send_header('Content-Type', 'text/css') + self.send_header('Content-Type', 'text/' + extension) self.end_headers() - id, plugin, test = self.load_from_path('.css') + id, plugin, test = self.load_from_path() - self.wfile.write(open(test.css).read()) + self.wfile.write(open(os.path.join(test.static_dir, filename)).read()) self.wfile.close() def do_test_html(self): @@ -93,8 +155,11 @@ html = string.Template(test_page_html) id, plugin, test = self.load_from_path('.html') self.wfile.write(html.substitute( + base_url=self.test_base_url(id, test), + server='http://localhost:8000', css_url=self.css_url(id, test), kss_url=self.kss_url(id, test), + name=test.name, html=open(test.html).read())) self.wfile.close() @@ -133,12 +198,12 @@ self.tests = tests class Test(object): - def __init__(self, name, html, css, kss, handler): + def __init__(self, name, html, css, kss, handlers): self.name = name self.html = html self.css = css self.kss = kss - self.handler = handler + self.handlers = handlers if __name__ == '__main__': From jvloothuis at codespeak.net Fri Nov 16 21:24:21 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Fri, 16 Nov 2007 21:24:21 +0100 (CET) Subject: [KSS-checkins] r48731 - kukit/kss.core/trunk/kss/core/plugins/core/demo Message-ID: <20071116202421.46EBA817A@code0.codespeak.net> Author: jvloothuis Date: Fri Nov 16 21:24:19 2007 New Revision: 48731 Added: kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.kss kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.pt Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/configure.zcml kukit/kss.core/trunk/kss/core/plugins/core/demo/demoview.py kukit/kss.core/trunk/kss/core/plugins/core/demo/zopeconfig.py Log: Added tests for the protocol implementation. Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/configure.zcml ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/configure.zcml (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/configure.zcml Fri Nov 16 21:24:19 2007 @@ -432,5 +432,82 @@ name="draganddrop.kss" /> + + + + + + + + + + + + + + + + + + + + + Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/demoview.py ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/demoview.py (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/demoview.py Fri Nov 16 21:24:19 2007 @@ -198,3 +198,52 @@ """html insert""" self.getCommandSet('core').insertHTMLAsLastChild('div#frame', '
    KSS for a life. %s
    ' % (str(datetime.datetime.now()), )) return self.render() + + + # protocol + def protocolSmallDataset(self): + self.getCommandSet('core').replaceInnerHTML( + '#dataset-output', 'Worked') + return self.render() + + def protocolLargeDataset(self): + text = 'really ' * 690 + self.getCommandSet('core').replaceInnerHTML( + '#dataset-output', '%s' % (text + 'large text')) + return self.render() + + def protocolAMP(self): + self.getCommandSet('core').replaceInnerHTML( + '#character-output', 'text & stuff') + return self.render() + + def protocolLT(self): + self.getCommandSet('core').replaceInnerHTML( + '#character-output', 'text < stuff') + return self.render() + + def protocolGT(self): + self.getCommandSet('core').replaceInnerHTML( + '#character-output', 'text > stuff') + return self.render() + + def protocolENDCDATA(self): + self.getCommandSet('core').replaceInnerHTML( + '#character-output', 'before ]]> after') + return self.render() + + + def protocolSmallAttribute(self): + self.getCommandSet('core').setAttribute( + '#attribute-output', 'class', 'some smallattr') + return self.render() + + def protocolLargeAttribute(self): + classes = ' '.join(['h' + hex(i)[2:] * i for i in range(70)]) + self.getCommandSet('core').setAttribute( + '#attribute-output', 'class', classes + ' largeattr') + return self.render() + + + + Added: kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.kss ============================================================================== --- (empty file) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.kss Fri Nov 16 21:24:19 2007 @@ -0,0 +1,39 @@ +#small-dataset:click { + evt-click-preventdefault: true; + action-server: protocolSmallDataset; +} + +#large-dataset:click { + evt-click-preventdefault: true; + action-server: protocolLargeDataset; +} + +#small-attribute:click { + evt-click-preventdefault: true; + action-server: protocolSmallAttribute; +} + +#large-attribute:click { + evt-click-preventdefault: true; + action-server: protocolLargeAttribute; +} + +#amp:click { + evt-click-preventdefault: true; + action-server: protocolAMP; +} + +#lt:click { + evt-click-preventdefault: true; + action-server: protocolLT; +} + +#gt:click { + evt-click-preventdefault: true; + action-server: protocolGT; +} + +#endcdata:click { + evt-click-preventdefault: true; + action-server: protocolENDCDATA; +} \ No newline at end of file Added: kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.pt ============================================================================== --- (empty file) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.pt Fri Nov 16 21:24:19 2007 @@ -0,0 +1,75 @@ + + + + + + + + + + + +

    header

    + +

    Client - Server Protocol

    +

    + This demo exercises the communication between the client and the + server. +

    + +

    Data size of parameters

    +

    Some browsers (Firefox in particular) had (or have) problems + with large text nodes in XML. The next examples show replacements + with large and small datasets.

    + +
      +
    1. Small dataset
    2. +
    3. Large dataset
    4. +
    + +

    Currently kss.core treats non-HTML commands differently from + others. The following examples show why I think this to be a + mistake.

    + +
      +
    1. Small attribute
    2. +
    3. Large attribute
    4. +
    + +
    + The parent node (div) will get an (in)sane amount of classes. +
    + +

    XML escaping

    +

    Since the response message is a XML document it should obey the + escaping rules of XML.

    + +
    + The ampersand character (&) and the left angle bracket (<) MUST + NOT appear in their literal form, except when used as markup + delimiters, or within a comment, a processing instruction, or a + CDATA section. If they are needed elsewhere, they MUST be escaped + using either numeric character references or the strings "&amp;" + and "&lt;" respectively. The right angle bracket (>) may be + represented using the string "&gt;", and MUST, for compatibility, + be escaped using either "&gt;" or a character reference when it + appears in the string "]]>" in content, when that string is not + marking the end of a CDATA section. +
    + +
      +
    1. Command with an &
    2. +
    3. Command with a <
    4. +
    5. Command with a >
    6. +
    7. Command with ]]> in a CDATA block
    8. +
    + +
    + test data will appear here +
    + + + Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/zopeconfig.py ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/zopeconfig.py (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/zopeconfig.py Fri Nov 16 21:24:19 2007 @@ -31,6 +31,7 @@ KSSDemo('', '', "error_handling.html", "Error handling"), KSSDemo('', '', "preventdefault.html", "Preventdefault (a.k.a. Safari workarounds)"), KSSDemo('', '', "html_inserts.html", "HTML insertions (Change tag content returns)"), + KSSDemo('', '', "client-server-protocol", "Client server protocol"), ## KSSDemo('', '', "draganddrop.html", "Scriptaculous drag and drop"), KSSDemo('', 'Parameter functions', 'pf_forms.html', 'Forms'), KSSDemo('', 'Selectors', 'selectors.html', 'Parent node selector'), From jvloothuis at codespeak.net Sat Nov 17 14:23:21 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 17 Nov 2007 14:23:21 +0100 (CET) Subject: [KSS-checkins] r48754 - kukit/kss.core/trunk/kss/core/plugins/core/demo Message-ID: <20071117132321.342DB8178@code0.codespeak.net> Author: jvloothuis Date: Sat Nov 17 14:23:20 2007 New Revision: 48754 Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/configure.zcml kukit/kss.core/trunk/kss/core/plugins/core/demo/demoview.py kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.kss kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.pt Log: Added tests for setting attributes with XML special chars Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/configure.zcml ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/configure.zcml (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/configure.zcml Sat Nov 17 14:23:20 2007 @@ -509,5 +509,37 @@ permission="zope.View" /> + + + + + + + + Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/demoview.py ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/demoview.py (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/demoview.py Sat Nov 17 14:23:20 2007 @@ -244,6 +244,23 @@ '#attribute-output', 'class', classes + ' largeattr') return self.render() + def protocolAttributeAMP(self): + self.getCommandSet('core').setAttribute( + '#character-attr-output', 'title', 'text & stuff') + return self.render() + def protocolAttributeLT(self): + self.getCommandSet('core').setAttribute( + '#character-attr-output', 'title', 'text < stuff') + return self.render() + def protocolAttributeGT(self): + self.getCommandSet('core').setAttribute( + '#character-attr-output', 'title', 'text > stuff') + return self.render() + + def protocolAttributeENDCDATA(self): + self.getCommandSet('core').setAttribute( + '#character-attr-output', 'title', 'before ]]> after') + return self.render() Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.kss ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.kss (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.kss Sat Nov 17 14:23:20 2007 @@ -36,4 +36,24 @@ #endcdata:click { evt-click-preventdefault: true; action-server: protocolENDCDATA; +} + +#attr-amp:click { + evt-click-preventdefault: true; + action-server: protocolAttributeAMP; +} + +#attr-lt:click { + evt-click-preventdefault: true; + action-server: protocolAttributeLT; +} + +#attr-gt:click { + evt-click-preventdefault: true; + action-server: protocolAttributeGT; +} + +#attr-endcdata:click { + evt-click-preventdefault: true; + action-server: protocolAttributeENDCDATA; } \ No newline at end of file Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.pt ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.pt (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/protocol.pt Sat Nov 17 14:23:20 2007 @@ -70,6 +70,19 @@
    test data will appear here
    + +

    Currently kss.core treats non-HTML commands differently from + others. These commands demonstrate if the system works ok with + attributes.

    + +
      +
    1. Command with an &
    2. +
    3. Command with a <
    4. +
    5. Command with a >
    6. +
    7. Command with ]]>
    8. +
    + + Link which get a title attribute From gotcha at codespeak.net Thu Nov 22 22:05:03 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 22 Nov 2007 22:05:03 +0100 (CET) Subject: [KSS-checkins] r48952 - kukit/kss.core/trunk/kss/core Message-ID: <20071122210503.B93B98236@code0.codespeak.net> Author: gotcha Date: Thu Nov 22 22:05:03 2007 New Revision: 48952 Modified: kukit/kss.core/trunk/kss/core/configure.zcml Log: fix cosmetics Modified: kukit/kss.core/trunk/kss/core/configure.zcml ============================================================================== --- kukit/kss.core/trunk/kss/core/configure.zcml (original) +++ kukit/kss.core/trunk/kss/core/configure.zcml Thu Nov 22 22:05:03 2007 @@ -63,16 +63,16 @@ From gotcha at codespeak.net Thu Nov 22 22:06:40 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 22 Nov 2007 22:06:40 +0100 (CET) Subject: [KSS-checkins] r48953 - kukit/kukit.js/branch/finish-closures Message-ID: <20071122210640.05D3A8229@code0.codespeak.net> Author: gotcha Date: Thu Nov 22 22:06:40 2007 New Revision: 48953 Added: kukit/kukit.js/branch/finish-closures/ - copied from r48952, kukit/kukit.js/trunk/ Log: to finish closures !!!! From gotcha at codespeak.net Thu Nov 22 22:57:49 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 22 Nov 2007 22:57:49 +0100 (CET) Subject: [KSS-checkins] r48954 - kukit/kss.core/branch/finish-closures Message-ID: <20071122215749.18666823E@code0.codespeak.net> Author: gotcha Date: Thu Nov 22 22:57:49 2007 New Revision: 48954 Added: kukit/kss.core/branch/finish-closures/ - copied from r48953, kukit/kss.core/trunk/ Log: finish closures From gotcha at codespeak.net Thu Nov 22 23:00:28 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 22 Nov 2007 23:00:28 +0100 (CET) Subject: [KSS-checkins] r48955 - kukit/kss.core/branch/finish-closures/kss/core Message-ID: <20071122220028.8CB62823F@code0.codespeak.net> Author: gotcha Date: Thu Nov 22 23:00:28 2007 New Revision: 48955 Modified: kukit/kss.core/branch/finish-closures/kss/core/concatresource.zcml Log: closure for kukit namespace imply change of order Modified: kukit/kss.core/branch/finish-closures/kss/core/concatresource.zcml ============================================================================== --- kukit/kss.core/branch/finish-closures/kss/core/concatresource.zcml (original) +++ kukit/kss.core/branch/finish-closures/kss/core/concatresource.zcml Thu Nov 22 23:00:28 2007 @@ -24,10 +24,11 @@ Author: gotcha Date: Thu Nov 22 23:12:38 2007 New Revision: 48957 Modified: kukit/kukit.js/branch/finish-closures/kukit/kukit.js kukit/kukit.js/branch/finish-closures/kukit/utils.js Log: closures for kukit and kukit.ut namespaces Modified: kukit/kukit.js/branch/finish-closures/kukit/kukit.js ============================================================================== --- kukit/kukit.js/branch/finish-closures/kukit/kukit.js (original) +++ kukit/kukit.js/branch/finish-closures/kukit/kukit.js Thu Nov 22 23:12:38 2007 @@ -17,14 +17,18 @@ * 02111-1307, USA. */ -kukit.isDevelMode = false; -;;; kukit.isDevelMode = true; +kukit = new function() { /// MODULE START + +var ku = this; + +ku.isDevelMode = false; +;;; ku.isDevelMode = true; /* * class Engine */ -kukit.Engine = function() { +ku.Engine = function() { this.baseUrl = this.calculateBase(); this.documentRules = new kukit.rd.MethodTable(); // table from res_type to rule processor @@ -47,7 +51,7 @@ }; -kukit.Engine.prototype.calculateBase = function() { +ku.Engine.prototype.calculateBase = function() { var base = ''; try { var _dummy = document; @@ -82,11 +86,11 @@ return base; }; -kukit.Engine.prototype.getRuleSheetLinks = function() { +ku.Engine.prototype.getRuleSheetLinks = function() { var nodes = document.getElementsByTagName("link"); var results = []; for (var i=0; i b) { @@ -206,11 +208,11 @@ } }; -kukit.ut.SortedQueue.prototype.reset = function() { +ut.SortedQueue.prototype.reset = function() { this.elements = new Array(); }; -kukit.ut.SortedQueue.prototype.push = function(obj) { +ut.SortedQueue.prototype.push = function(obj) { // Find the position of the object. var i = 0; var length = this.elements.length; @@ -221,33 +223,33 @@ this.elements.splice(i, 0, obj); }; -kukit.ut.SortedQueue.prototype.pop = function() { +ut.SortedQueue.prototype.pop = function() { // takes minimal element return this.elements.shift(); }; -kukit.ut.SortedQueue.prototype.popn = function(n) { +ut.SortedQueue.prototype.popn = function(n) { // takes first n minimal element return this.elements.splice(0, n); }; -kukit.ut.SortedQueue.prototype.empty = function() { +ut.SortedQueue.prototype.empty = function() { return ! this.elements.length; }; -kukit.ut.SortedQueue.prototype.size = function() { +ut.SortedQueue.prototype.size = function() { return this.elements.length; }; -kukit.ut.SortedQueue.prototype.get = function(n) { +ut.SortedQueue.prototype.get = function(n) { return this.elements[n]; }; -kukit.ut.SortedQueue.prototype.front = function() { +ut.SortedQueue.prototype.front = function() { return this.elements[0]; }; -kukit.ut.evalBool = function(value, errname) { +ut.evalBool = function(value, errname) { if (value == 'true' || value == 'True' || value == '1') { value = true; } else if (value == 'false' || value == 'False' || value == '0' @@ -259,7 +261,7 @@ return value; }; -kukit.ut.evalInt = function(value, errname) { +ut.evalInt = function(value, errname) { ;;; try { value = parseInt(value); ;;; } catch(e) { @@ -268,7 +270,7 @@ return value; }; -kukit.ut.evalList = function(value, errname) { +ut.evalList = function(value, errname) { ;;; try { // remove whitespace from beginning, end value = value.replace(/^ +/, ''); @@ -293,7 +295,7 @@ * * for repeating or one time timing */ -kukit.ut.TimerCounter = function(delay, func, restart) { +ut.TimerCounter = function(delay, func, restart) { this.delay = delay; this.func = func; if (typeof(restart) == 'undefined') { @@ -303,7 +305,7 @@ this.timer = null; }; -kukit.ut.TimerCounter.prototype.start = function() { +ut.TimerCounter.prototype.start = function() { if (this.timer) { ;;; kukit.E = 'Timer already started.'; @@ -316,7 +318,7 @@ this.timer = setTimeout(func, this.delay); }; -kukit.ut.TimerCounter.prototype.timeout = function() { +ut.TimerCounter.prototype.timeout = function() { // Call the event action this.func(); // Restart the timer @@ -326,7 +328,7 @@ } }; -kukit.ut.TimerCounter.prototype.clear = function() { +ut.TimerCounter.prototype.clear = function() { if (this.timer) { window.clearTimeout(this.timer); this.timer = null; @@ -337,13 +339,13 @@ /* * class Scheduler */ -kukit.ut.Scheduler = function(func) { +ut.Scheduler = function(func) { this.func = func; this.timer = null; this.nextWake = null; }; -kukit.ut.Scheduler.prototype.setNextWake = function(ts) { +ut.Scheduler.prototype.setNextWake = function(ts) { // Sets wakeup time, null clears if (this.nextWake) { this.clear(); @@ -365,7 +367,7 @@ } }; -kukit.ut.Scheduler.prototype.setNextWakeAtLeast = function(ts) { +ut.Scheduler.prototype.setNextWakeAtLeast = function(ts) { // Sets wakeup time, unless it would wake up later than the // currently set timeout. Null clears the timer. if (! ts || ! this.nextWake || ts < this.nextWake) { @@ -376,7 +378,7 @@ } }; -kukit.ut.Scheduler.prototype.timeout = function() { +ut.Scheduler.prototype.timeout = function() { // clear the timer this.timer = null; this.nextWake = null; @@ -385,7 +387,7 @@ }; -kukit.ut.Scheduler.prototype.clear = function() { +ut.Scheduler.prototype.clear = function() { if (this.nextWake) { window.clearTimeout(this.timer); this.timer = null; @@ -398,22 +400,22 @@ * * Scheduler for serializing bind and load procedures */ -kukit.ut.SerializeScheduler = function() { +ut.SerializeScheduler = function() { this.items = []; this.lock = false; }; -kukit.ut.SerializeScheduler.prototype.addPre = function(func, remark) { +ut.SerializeScheduler.prototype.addPre = function(func, remark) { this.items.push({func: func, remark: remark}); this.execute(); }; -kukit.ut.SerializeScheduler.prototype.addPost = function(func, remark) { +ut.SerializeScheduler.prototype.addPost = function(func, remark) { this.items.unshift({func: func, remark: remark}); this.execute(); }; -kukit.ut.SerializeScheduler.prototype.execute = function() { +ut.SerializeScheduler.prototype.execute = function() { if (! this.lock) { this.lock = true; while (true) { @@ -442,7 +444,7 @@ /* extracted from Plone */ // cross browser function for registering event handlers -kukit.ut.registerEventListener = function(elem, event, func) { +ut.registerEventListener = function(elem, event, func) { if (elem.addEventListener) { elem.addEventListener(event, func, false); return true; @@ -454,22 +456,27 @@ return false; }; +if (typeof(window) != 'undefined') { + ut.registerEventListener(window, "load", kukit.bootstrap); +} /* collecting keys-values into a dict or into a tuple list */ -kukit.ut.DictCollector = function() { +ut.DictCollector = function() { this.result = {}; }; -kukit.ut.DictCollector.prototype.add = function(key, value) { +ut.DictCollector.prototype.add = function(key, value) { this.result[key] = value; }; -kukit.ut.TupleCollector = function() { +ut.TupleCollector = function() { this.result = []; }; -kukit.ut.TupleCollector.prototype.add = function(key, value) { +ut.TupleCollector.prototype.add = function(key, value) { this.result.push([key, value]); }; +}(); /// MODULE END + From gotcha at codespeak.net Thu Nov 22 23:18:39 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 22 Nov 2007 23:18:39 +0100 (CET) Subject: [KSS-checkins] r48958 - kukit/kss.buildout/branch Message-ID: <20071122221839.B43B6823C@code0.codespeak.net> Author: gotcha Date: Thu Nov 22 23:18:38 2007 New Revision: 48958 Added: kukit/kss.buildout/branch/ Log: missing From gotcha at codespeak.net Thu Nov 22 23:18:59 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 22 Nov 2007 23:18:59 +0100 (CET) Subject: [KSS-checkins] r48959 - kukit/kss.buildout/branch/with-Zelenium-dev Message-ID: <20071122221859.91FB6823E@code0.codespeak.net> Author: gotcha Date: Thu Nov 22 23:18:59 2007 New Revision: 48959 Added: kukit/kss.buildout/branch/with-Zelenium-dev/ - copied from r48958, kukit/kss.buildout/trunk/ Log: finish Zelenium 0.8 From gotcha at codespeak.net Thu Nov 22 23:20:51 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 22 Nov 2007 23:20:51 +0100 (CET) Subject: [KSS-checkins] r48960 - in kukit/kss.buildout/branch/with-Zelenium-dev: . products Message-ID: <20071122222051.24A9B823C@code0.codespeak.net> Author: gotcha Date: Thu Nov 22 23:20:50 2007 New Revision: 48960 Added: kukit/kss.buildout/branch/with-Zelenium-dev/products/ (props changed) kukit/kss.buildout/branch/with-Zelenium-dev/products/EXTERNALS.txt Modified: kukit/kss.buildout/branch/with-Zelenium-dev/buildout.cfg Log: add Zelenium for its dev Modified: kukit/kss.buildout/branch/with-Zelenium-dev/buildout.cfg ============================================================================== --- kukit/kss.buildout/branch/with-Zelenium-dev/buildout.cfg (original) +++ kukit/kss.buildout/branch/with-Zelenium-dev/buildout.cfg Thu Nov 22 23:20:50 2007 @@ -12,6 +12,10 @@ src/kss.recipe.checkjavaversion src/kss.recipe.seleniumrc +eggs = + ipdb + elementtree + [javaversion] recipe = kss.recipe.checkjavaversion javaversion = 1.5 @@ -30,6 +34,7 @@ user = admin:admin debug-mode = on eggs = + ${buildout:eggs} kss.core kss.demo zcml = Added: kukit/kss.buildout/branch/with-Zelenium-dev/products/EXTERNALS.txt ============================================================================== --- (empty file) +++ kukit/kss.buildout/branch/with-Zelenium-dev/products/EXTERNALS.txt Thu Nov 22 23:20:50 2007 @@ -0,0 +1,4 @@ +# created by: svn propset svn:externals -F ./EXTERNALS.TXT . + +Zelenium svn+ssh://gotcha at svn.zope.org/repos/main/Zelenium/branches/gotcha-selenium-0.8.1 + From gotcha at codespeak.net Fri Nov 23 00:12:00 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Fri, 23 Nov 2007 00:12:00 +0100 (CET) Subject: [KSS-checkins] r48964 - in kukit/kss.core/branch/finish-closures/kss/core: . plugins/core/demo/selenium_tests Message-ID: <20071122231200.895E18248@code0.codespeak.net> Author: gotcha Date: Fri Nov 23 00:12:00 2007 New Revision: 48964 Modified: kukit/kss.core/branch/finish-closures/kss/core/configure.zcml kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/suite.html Log: suite for Zelenium Modified: kukit/kss.core/branch/finish-closures/kss/core/configure.zcml ============================================================================== --- kukit/kss.core/branch/finish-closures/kss/core/configure.zcml (original) +++ kukit/kss.core/branch/finish-closures/kss/core/configure.zcml Fri Nov 23 00:12:00 2007 @@ -53,6 +53,15 @@ name="base2-dom-fp.js" /> + + + ChangeTagContent + Two selects revisited + Forms From gotcha at codespeak.net Fri Nov 23 00:12:34 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Fri, 23 Nov 2007 00:12:34 +0100 (CET) Subject: [KSS-checkins] r48965 - kukit/kss.buildout/branch/with-Zelenium-dev Message-ID: <20071122231234.932B38249@code0.codespeak.net> Author: gotcha Date: Fri Nov 23 00:12:34 2007 New Revision: 48965 Modified: kukit/kss.buildout/branch/with-Zelenium-dev/buildout.cfg Log: added products Modified: kukit/kss.buildout/branch/with-Zelenium-dev/buildout.cfg ============================================================================== --- kukit/kss.buildout/branch/with-Zelenium-dev/buildout.cfg (original) +++ kukit/kss.buildout/branch/with-Zelenium-dev/buildout.cfg Fri Nov 23 00:12:34 2007 @@ -33,6 +33,8 @@ zope2-location = ${zope2:location} user = admin:admin debug-mode = on +products = + ${buildout:directory}/products eggs = ${buildout:eggs} kss.core From reebalazs at codespeak.net Sat Nov 24 13:04:28 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 24 Nov 2007 13:04:28 +0100 (CET) Subject: [KSS-checkins] r49026 - kukit/kukit.js/branch/ree-loglevels Message-ID: <20071124120428.F000981E0@code0.codespeak.net> Author: reebalazs Date: Sat Nov 24 13:04:27 2007 New Revision: 49026 Added: kukit/kukit.js/branch/ree-loglevels/ - copied from r49025, kukit/kukit.js/trunk/ Log: Branch off From reebalazs at codespeak.net Sat Nov 24 13:05:19 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 24 Nov 2007 13:05:19 +0100 (CET) Subject: [KSS-checkins] r49027 - kukit/kss.core/branch/ree-loglevels Message-ID: <20071124120519.EB07581F8@code0.codespeak.net> Author: reebalazs Date: Sat Nov 24 13:05:19 2007 New Revision: 49027 Added: kukit/kss.core/branch/ree-loglevels/ - copied from r49026, kukit/kss.core/trunk/ Log: Branch off From reebalazs at codespeak.net Sat Nov 24 13:08:28 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 24 Nov 2007 13:08:28 +0100 (CET) Subject: [KSS-checkins] r49028 - in kukit/kukit.js/branch/ree-loglevels: doc kukit Message-ID: <20071124120828.F27C481E0@code0.codespeak.net> Author: reebalazs Date: Sat Nov 24 13:08:28 2007 New Revision: 49028 Modified: kukit/kukit.js/branch/ree-loglevels/doc/HISTORY.txt kukit/kukit.js/branch/ree-loglevels/kukit/dom.js kukit/kukit.js/branch/ree-loglevels/kukit/utils.js Log: Implement loglevels based on cookies Modified: kukit/kukit.js/branch/ree-loglevels/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/branch/ree-loglevels/doc/HISTORY.txt (original) +++ kukit/kukit.js/branch/ree-loglevels/doc/HISTORY.txt Sat Nov 24 13:08:28 2007 @@ -6,6 +6,12 @@ - ... + - Implement loglevels based on cookies + Add cookie handling code to kss.dom + Change logging on FireBug to avoid line info in debug + level messages + [ree] + - Implement event binding based on the ids fetched dynamically from the dom, by value providers. [ree] Modified: kukit/kukit.js/branch/ree-loglevels/kukit/dom.js ============================================================================== --- kukit/kukit.js/branch/ree-loglevels/kukit/dom.js (original) +++ kukit/kukit.js/branch/ree-loglevels/kukit/dom.js Sat Nov 24 13:08:28 2007 @@ -432,5 +432,30 @@ } }; + +/* + * Cookie handling code taken from: + * http://www.quirksmode.org/js/cookies.html + */ + +this.createCookie = function(name, value, days) { + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + var expires = "; expires=" + date.toGMTString(); + } + else var expires = ""; + document.cookie = name + "=" + value + expires + "; path=/"; +} + +// we get this from kukit utils.js. We needed an early +// definition there, because logging is needed from the +// very beginning. +this.readCookie = kukit.readCookie; + +this.eraseCookie = function(name) { + createCookie(name, "", -1); +} + }(); /// MODULE END Modified: kukit/kukit.js/branch/ree-loglevels/kukit/utils.js ============================================================================== --- kukit/kukit.js/branch/ree-loglevels/kukit/utils.js (original) +++ kukit/kukit.js/branch/ree-loglevels/kukit/utils.js Sat Nov 24 13:08:28 2007 @@ -66,6 +66,56 @@ ;;; kukit.logWarning(msg); ;;; }; +/* + * Cookie handling code taken from: + * http://www.quirksmode.org/js/cookies.html + * Cookie handling is in dom.js, but this method + * is needed right here for log handling. + */ + +kukit.readCookie = function(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for(var i=0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) == ' ') c = c.substring(1, c.length); + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); + } + return null; +} + +// a null function that is used for logging +kukit._null = function() {}; + +;;; // Logging filter. This allows filtering log levels based on +;;; // a browser cookie. +;;; +;;; kukit._loglevel = function() { +;;; // set default level +;;; var loglevel = 0; +;;; // read the cookie +;;; var cookie = kukit.readCookie('__kss_loglevel'); +;;; if (cookie) { +;;; // decode it to a numeric level +;;; cookie = cookie.toLowerCase(); +;;; // Cookies are quoted in Zope, for some reason (???) +;;; // ie we get '"VALUE"' here. Let's compensate this. +;;; if (cookie.substr(0, 1) == '"') { +;;; cookie = cookie.substr(1, cookie.length - 2); +;;; } +;;; if (cookie == 'debug') loglevel = 0; +;;; if (cookie == 'info') loglevel = 1; +;;; if (cookie == 'warning') loglevel = 2; +;;; if (cookie == 'error') loglevel = 3; +;;; } +;;; // return the value +;;; return loglevel; +;;; }(); +;;; +;;; kukit._logFilter = function(f, currentlevel) { +;;; return (currentlevel >= kukit._loglevel) ? f : kukit._null; +;;; }; + // We want a way of knowing if Firebug is available : // it is very convenient to log a node in Firebug; // you get a clickable result that brings you to Firebug inspector. @@ -86,11 +136,13 @@ ;;; return result; ;;; } ;;; if (kukit.hasFirebug()) { -;;; kukit.log = console.log; -;;; kukit.logDebug = console.debug; -;;; kukit.logFatal = console.error; -;;; kukit.logError = console.error; -;;; kukit.logWarning = console.warn; +;;; // for debug level we also log as 'info', because we do +;;; // not want FireBug to display line information. +;;; kukit.logDebug = kukit._logFilter(console.log, 0); +;;; kukit.log = kukit._logFilter(console.log, 1); +;;; kukit.logWarning = kukit._logFilter(console.warn, 2); +;;; kukit.logError = kukit._logFilter(console.error, 3); +;;; kukit.logFatal = kukit._logFilter(console.error, 3); ;;; kukit.hasFirebug = true; ;;; } @@ -103,11 +155,11 @@ ;;; return result; ;;; } ;;; if (kukit.hasMochiKit()) { -;;; kukit.log = MochiKit.Logging.log; -;;; kukit.logError = MochiKit.Logging.logError; -;;; kukit.logDebug = MochiKit.Logging.logDebug; -;;; kukit.logFatal = MochiKit.Logging.logFatal; -;;; kukit.logWarning = MochiKit.Logging.logWarning; +;;; kukit.logDebug = kukit._logFilter(MochiKit.Logging.logDebug, 0); +;;; kukit.log = kukit._logFilter(MochiKit.Logging.log, 1); +;;; kukit.logWarning = kukit._logFilter(MochiKit.Logging.logWarning, 2); +;;; kukit.logError = kukit._logFilter(MochiKit.Logging.logError, 3); +;;; kukit.logFatal = kukit._logFilter(MochiKit.Logging.logFatal, 3); ;;; // make convenience url ;;; // javascript:kukit.showLog(); ;;; // instead of the need to say @@ -125,20 +177,20 @@ ;;; return result; ;;; } ;;; if (kukit.hasSafari()) { -;;; kukit.log = function(str) { console.log('INFO: '+str); }; -;;; kukit.logError = function(str) { console.log('ERROR: '+str); }; -;;; kukit.logDebug = function(str) { console.log('DEBUG: '+str); }; -;;; kukit.logFatal = function(str) { console.log('FATAL: '+str); }; -;;; kukit.logWarning = function(str) { console.log('WARNING: '+str); }; +;;; kukit.logDebug = kukit._logFilter(function(str) { console.log('DEBUG: '+str); }, 0); +;;; kukit.log = kukit._logFilter(function(str) { console.log('INFO: '+str); }, 1); +;;; kukit.logWarning = kukit._logFilter(function(str) { console.log('WARNING: '+str); }, 2); +;;; kukit.logError = kukit._logFilter(function(str) { console.log('ERROR: '+str); }, 3); +;;; kukit.logFatal = kukit._logFilter(function(str) { console.log('FATAL: '+str); }, 3); ;;; } /* no logging solution available */ ;;; if (typeof kukit.log == 'undefined') { - kukit.log = function(str){}; - kukit.logError = kukit.log; - kukit.logDebug = kukit.log; - kukit.logFatal = kukit.log; - kukit.logWarning = kukit.log; + kukit.logDebug = kukit._null; + kukit.log = kukit._null; + kukit.logWarning = kukit._null; + kukit.logError = kukit._null; + kukit.logFatal = kukit._null; ;;; } // log a startup message From reebalazs at codespeak.net Sat Nov 24 13:12:13 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 24 Nov 2007 13:12:13 +0100 (CET) Subject: [KSS-checkins] r49029 - in kukit/kss.core/branch/ree-loglevels: docs kss/core kss/core/pluginregistry/browser Message-ID: <20071124121213.5224781E0@code0.codespeak.net> Author: reebalazs Date: Sat Nov 24 13:12:12 2007 New Revision: 49029 Modified: kukit/kss.core/branch/ree-loglevels/docs/HISTORY.txt kukit/kss.core/branch/ree-loglevels/kss/core/ (props changed) kukit/kss.core/branch/ree-loglevels/kss/core/EXTERNALS.TXT kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.css kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develview.py Log: Implement loglevels based on cookies Modified: kukit/kss.core/branch/ree-loglevels/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/branch/ree-loglevels/docs/HISTORY.txt (original) +++ kukit/kss.core/branch/ree-loglevels/docs/HISTORY.txt Sat Nov 24 13:12:12 2007 @@ -6,6 +6,10 @@ - ... + - Implement loglevels based on cookies + Add handling of log levels to the kss mode view + [ree] + - Moved the core demos to this package from kss.demo. They are now located under the core plugin. [ree] Modified: kukit/kss.core/branch/ree-loglevels/kss/core/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/branch/ree-loglevels/kss/core/EXTERNALS.TXT (original) +++ kukit/kss.core/branch/ree-loglevels/kss/core/EXTERNALS.TXT Sat Nov 24 13:12:12 2007 @@ -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 +kukit http://codespeak.net/svn/kukit/kukit.js/branch/ree-loglevels Modified: kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.css ============================================================================== --- kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.css (original) +++ kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.css Sat Nov 24 13:12:12 2007 @@ -97,3 +97,7 @@ color: green; } +.cyan { + color: cyan; +} + Modified: kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt ============================================================================== --- kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt (original) +++ kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt Sat Nov 24 13:12:12 2007 @@ -54,7 +54,8 @@ + loglevel python: options.get('loglevel', view.getLogLevel()); + referer request/referer|request/HTTP_REFERER|nothing">

    Kss mode setup

    @@ -93,6 +94,45 @@ +

    KSS log level setup

    + +

    + Current KSS log level is + DEBUG. +

    + +
    + Logging is only effective in Development mode. +
    + +

    + Set KSS log level +

    +
    +
    + Click the button to set log level. +
    + +
    + + + + +
    +
    + +
    +

    The cookie is global to the site.

    + +
    +

    Back

    Modified: kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develview.py ============================================================================== --- kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develview.py (original) +++ kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develview.py Sat Nov 24 13:12:12 2007 @@ -11,7 +11,8 @@ from zope.traversing.interfaces import ITraverser from zope.publisher.interfaces import NotFound -COOKIE_NAME = '__kss_devel' +COOKIE_DEVELMODE = '__kss_devel' +COOKIE_LOGLEVEL = '__kss_loglevel' class DevelView(BrowserView): implements(IDevelView) @@ -37,7 +38,7 @@ return self, ('ui', ) # -- - # Accessable methods + # Methods for handling development/production mode # -- def ison(self): @@ -51,7 +52,7 @@ select development mode without the cookie ''' - ison = COOKIE_NAME in self.request.cookies + ison = COOKIE_DEVELMODE in self.request.cookies if not ison: # Check from javascript tool @@ -76,26 +77,51 @@ def set(self): 'Sets development mode cookie' - self.request.response.setCookie(COOKIE_NAME, '1', path='/') + self.request.response.setCookie(COOKIE_DEVELMODE, '1', path='/') def unset(self): 'Unsets development mode cookie' - self.request.response.expireCookie(COOKIE_NAME, path='/') + self.request.response.expireCookie(COOKIE_DEVELMODE, path='/') + + # -- + # Methods for handling loglevel + # -- + + def getLogLevel(self, REQUEST=None): + 'Gets current log level' + loglevel = self.request.cookies.get(COOKIE_LOGLEVEL, 'DEBUG').upper() + return loglevel + + def setLogLevel(self, loglevel): + 'Sets loglevel cookie' + self.request.response.setCookie(COOKIE_LOGLEVEL, loglevel, path='/') + + # -- + # User interface + # -- _ui = ViewPageTemplateFile('develui.pt', content_type='text/html;charset=utf-8') def ui(self): 'User interface for interactive switching' options = {} + # Handle development/production mode if 'devel' in self.request.form: self.set() # setting it also to have immediate effect in the page options['devel_mode'] = True if 'prod' in self.request.form: self.unset() - if COOKIE_NAME in self.request.cookies: + if COOKIE_DEVELMODE in self.request.cookies: # setting it also to have immediate effect in the page options['devel_mode'] = False + # Handle loglevel + if 'loglevel' in self.request.form: + loglevel = self.request.form['loglevel'] + self.setLogLevel(loglevel) + # setting it also to have immediate effect in the page + options['loglevel'] = loglevel + # Return the rendered template return self._ui(**options) def ui_js(self): From reebalazs at codespeak.net Sat Nov 24 21:17:49 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 24 Nov 2007 21:17:49 +0100 (CET) Subject: [KSS-checkins] r49058 - kukit/kukit.js/branch/ree-loglevels/kukit Message-ID: <20071124201749.D262F8193@code0.codespeak.net> Author: reebalazs Date: Sat Nov 24 21:17:47 2007 New Revision: 49058 Modified: kukit/kukit.js/branch/ree-loglevels/kukit/utils.js Log: Refactor, and allow a method to set the log level from javascript on the fly (for FireKiss) Modified: kukit/kukit.js/branch/ree-loglevels/kukit/utils.js ============================================================================== --- kukit/kukit.js/branch/ree-loglevels/kukit/utils.js (original) +++ kukit/kukit.js/branch/ree-loglevels/kukit/utils.js Sat Nov 24 21:17:47 2007 @@ -87,14 +87,16 @@ // a null function that is used for logging kukit._null = function() {}; -;;; // Logging filter. This allows filtering log levels based on -;;; // a browser cookie. -;;; -;;; kukit._loglevel = function() { +kukit._COOKIE_LOGLEVEL = '__kss_loglevel'; + +// an empty logger +kukit._logger = new function() { + + this.updateLogLevel = function() { ;;; // set default level -;;; var loglevel = 0; +;;; this.loglevel = 0; ;;; // read the cookie -;;; var cookie = kukit.readCookie('__kss_loglevel'); +;;; var cookie = kukit.readCookie(kukit._COOKIE_LOGLEVEL); ;;; if (cookie) { ;;; // decode it to a numeric level ;;; cookie = cookie.toLowerCase(); @@ -103,19 +105,47 @@ ;;; if (cookie.substr(0, 1) == '"') { ;;; cookie = cookie.substr(1, cookie.length - 2); ;;; } -;;; if (cookie == 'debug') loglevel = 0; -;;; if (cookie == 'info') loglevel = 1; -;;; if (cookie == 'warning') loglevel = 2; -;;; if (cookie == 'error') loglevel = 3; -;;; } -;;; // return the value -;;; return loglevel; -;;; }(); -;;; -;;; kukit._logFilter = function(f, currentlevel) { -;;; return (currentlevel >= kukit._loglevel) ? f : kukit._null; +;;; if (cookie == 'debug') this.loglevel = 0; +;;; if (cookie == 'info') this.loglevel = 1; +;;; if (cookie == 'warning') this.loglevel = 2; +;;; if (cookie == 'error') this.loglevel = 3; +;;; }; + // Call the function that sets up the handlers + this._setupHandlers(); + }; + + // Log filter, for use from the handlers. +;;; this._logFilter = function(f, currentlevel) { +;;; return (currentlevel >= this.loglevel) ? f : kukit._null; ;;; }; + // This sets up the handlers and allows to set them + // up again with a different cookie setting. + // Will be overwritten by different loggers. + this._setupHandlers = function() { + this.logDebug = kukit._null; + this.log = kukit._null; + this.logWarning = kukit._null; + this.logError = kukit._null; + this.logFatal = kukit._null; + }; +}(); + +// Stub functions that can be used for logging +kukit.logDebug = function(message) {kukit._logger.logDebug(message);}; +kukit.log = function(message) {kukit._logger.log(message);}; +kukit.logWarning = function(message) {kukit._logger.logWarning(message);}; +kukit.logError = function(message) {kukit._logger.logError(message);}; +kukit.logFatal = function(message) {kukit._logger.logFatal(message);}; + +// Function to change the log level from javascript +kukit.setLogLevel = function(level) { +;;; // Store it in the cookie so that it persists through requests. +;;; kukit.dom.writeCookie(kukit._COOKIE_LOGLEVEL, level); +;;; // re-establish the log handlers, based on this cookie setting +;;; kukit._logger.updateLogLevel(); +} + // We want a way of knowing if Firebug is available : // it is very convenient to log a node in Firebug; // you get a clickable result that brings you to Firebug inspector. @@ -123,76 +153,77 @@ // if (kukit.hasFirebug) { // kukit.log(node); // } -kukit.hasFirebug = false; ;;; // check whether the logging stuff of Firebug is available ;;; kukit.hasFirebug = function() { -;;; var result = typeof kukit.log == 'undefined'; -;;; result = result && typeof console != 'undefined'; +;;; var result = typeof console != 'undefined'; ;;; result = result && typeof console.log != 'undefined'; ;;; result = result && typeof console.debug != 'undefined'; ;;; result = result && typeof console.error != 'undefined'; ;;; result = result && typeof console.warn != 'undefined'; ;;; return result; -;;; } -;;; if (kukit.hasFirebug()) { +;;; }(); + +;;; // Set up logging for FireBug +;;; if (kukit.hasFirebug) { +;;; kukit._logger._setupHandlers = function() { ;;; // for debug level we also log as 'info', because we do ;;; // not want FireBug to display line information. -;;; kukit.logDebug = kukit._logFilter(console.log, 0); -;;; kukit.log = kukit._logFilter(console.log, 1); -;;; kukit.logWarning = kukit._logFilter(console.warn, 2); -;;; kukit.logError = kukit._logFilter(console.error, 3); -;;; kukit.logFatal = kukit._logFilter(console.error, 3); -;;; kukit.hasFirebug = true; +;;; this.logDebug = this._logFilter(console.log, 0); +;;; this.log = this._logFilter(console.log, 1); +;;; this.logWarning = this._logFilter(console.warn, 2); +;;; this.logError = this._logFilter(console.error, 3); +;;; this.logFatal = this._logFilter(console.error, 3); +;;; } ;;; } ;;; // check whether the logging stuff of MochiKit is available ;;; kukit.hasMochiKit = function() { -;;; var result = typeof kukit.log == 'undefined'; -;;; result = result && typeof MochiKit != 'undefined'; +;;; var result = typeof MochiKit != 'undefined'; ;;; result = result && typeof MochiKit.Logging != 'undefined'; ;;; result = result && typeof MochiKit.Logging.log != 'undefined'; ;;; return result; -;;; } -;;; if (kukit.hasMochiKit()) { -;;; kukit.logDebug = kukit._logFilter(MochiKit.Logging.logDebug, 0); -;;; kukit.log = kukit._logFilter(MochiKit.Logging.log, 1); -;;; kukit.logWarning = kukit._logFilter(MochiKit.Logging.logWarning, 2); -;;; kukit.logError = kukit._logFilter(MochiKit.Logging.logError, 3); -;;; kukit.logFatal = kukit._logFilter(MochiKit.Logging.logFatal, 3); -;;; // make convenience url -;;; // javascript:kukit.showLog(); -;;; // instead of the need to say -;;; // javascript:void(createLoggingPane(true)); -;;; kukit.showLog = function() { -;;; createLoggingPane(true); -;;; }; +;;; }(); + +;;; // Set up logging for MochiKit +;;; if (! kukit.hasFirebug && kukit.hasMochiKit) { +;;; kukit._logger._setupHandlers = function() { +;;; this.logDebug = this._logFilter(MochiKit.Logging.logDebug, 0); +;;; this.log = this._logFilter(MochiKit.Logging.log, 1); +;;; this.logWarning = this._logFilter(MochiKit.Logging.logWarning, 2); +;;; this.logError = this._logFilter(MochiKit.Logging.logError, 3); +;;; this.logFatal = this._logFilter(MochiKit.Logging.logFatal, 3); +;;; } +;;; // make convenience url +;;; // javascript:kukit.showLog(); +;;; // instead of the need to say +;;; // javascript:void(createLoggingPane(true)); +;;; kukit.showLog = function() { +;;; createLoggingPane(true); +;;; }; ;;; } ;;; // check whether the logging stuff of Safari is available ;;; kukit.hasSafari = function() { -;;; var result = typeof kukit.log == 'undefined'; -;;; result = result && typeof console != 'undefined'; +;;; var result = typeof console != 'undefined'; ;;; result = result && typeof console.log != 'undefined'; ;;; return result; -;;; } -;;; if (kukit.hasSafari()) { -;;; kukit.logDebug = kukit._logFilter(function(str) { console.log('DEBUG: '+str); }, 0); -;;; kukit.log = kukit._logFilter(function(str) { console.log('INFO: '+str); }, 1); -;;; kukit.logWarning = kukit._logFilter(function(str) { console.log('WARNING: '+str); }, 2); -;;; kukit.logError = kukit._logFilter(function(str) { console.log('ERROR: '+str); }, 3); -;;; kukit.logFatal = kukit._logFilter(function(str) { console.log('FATAL: '+str); }, 3); -;;; } +;;; }(); -/* no logging solution available */ -;;; if (typeof kukit.log == 'undefined') { - kukit.logDebug = kukit._null; - kukit.log = kukit._null; - kukit.logWarning = kukit._null; - kukit.logError = kukit._null; - kukit.logFatal = kukit._null; +;;; // Set up logging for Safari +;;; if (! kukit.hasFirebug && ! kukit.hasMochiKit && kukit.hasSafari) { +;;; kukit._logger._setupHandlers = function() { +;;; this.logDebug = this._logFilter(function(str) { console.log('DEBUG: '+str); }, 0); +;;; this.log = this._logFilter(function(str) { console.log('INFO: '+str); }, 1); +;;; this.logWarning = this._logFilter(function(str) { console.log('WARNING: '+str); }, 2); +;;; this.logError = this._logFilter(function(str) { console.log('ERROR: '+str); }, 3); +;;; this.logFatal = this._logFilter(function(str) { console.log('FATAL: '+str); }, 3); +;;; } ;;; } +// Initialize the logger with the solution we've just detected +kukit._logger.updateLogLevel(); + // log a startup message ;;; kukit.log('Loading KSS engine.'); From reebalazs at codespeak.net Sat Nov 24 21:24:39 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 24 Nov 2007 21:24:39 +0100 (CET) Subject: [KSS-checkins] r49059 - kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser Message-ID: <20071124202439.599378195@code0.codespeak.net> Author: reebalazs Date: Sat Nov 24 21:24:39 2007 New Revision: 49059 Modified: kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt Log: Small fixes on the ui Modified: kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt ============================================================================== --- kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt (original) +++ kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt Sat Nov 24 21:24:39 2007 @@ -98,7 +98,7 @@

    Current KSS log level is - DEBUG.

    @@ -126,7 +126,7 @@ tal:content="level">DEBUG
    -

    The cookie is global to the site.

    From reebalazs at codespeak.net Wed Nov 28 15:33:03 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 28 Nov 2007 15:33:03 +0100 (CET) Subject: [KSS-checkins] r49191 - kukit/kss.demo/branch/ree-1.2-working Message-ID: <20071128143303.B6BC681DD@code0.codespeak.net> Author: reebalazs Date: Wed Nov 28 15:33:02 2007 New Revision: 49191 Added: kukit/kss.demo/branch/ree-1.2-working/ - copied from r49190, kukit/kss.demo/branch/1.2/ Log: Branch off From reebalazs at codespeak.net Wed Nov 28 15:35:33 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 28 Nov 2007 15:35:33 +0100 (CET) Subject: [KSS-checkins] r49192 - kukit/kss.demo/branch/ree-1.2-working/kss/demo Message-ID: <20071128143533.415398122@code0.codespeak.net> Author: reebalazs Date: Wed Nov 28 15:35:32 2007 New Revision: 49192 Modified: kukit/kss.demo/branch/ree-1.2-working/kss/demo/events.py kukit/kss.demo/branch/ree-1.2-working/kss/demo/interfaces.py kukit/kss.demo/branch/ree-1.2-working/kss/demo/registry.py Log: Merge in -r47443 from trunk: demo plugins are not loaded (empty screen) depending on zcml loading order. Modified: kukit/kss.demo/branch/ree-1.2-working/kss/demo/events.py ============================================================================== --- kukit/kss.demo/branch/ree-1.2-working/kss/demo/events.py (original) +++ kukit/kss.demo/branch/ree-1.2-working/kss/demo/events.py Wed Nov 28 15:35:32 2007 @@ -8,13 +8,19 @@ IKSSDemoResource, IKSSSeleniumTestResource, IKSSDemoRegistrationEvent, + IKSSDemoRegistryEvent, + IKSSDemoRegistry ) from zope.interface import implements class KSSDemoRegistrationEvent(object): - """Redispatch of registration for demo utilities""" + """Redispatch of registration for demo resource utilities""" implements(IKSSDemoRegistrationEvent) +class KSSDemoRegistryEvent(object): + """Redispatch of registration for demo registry utilities""" + implements(IKSSDemoRegistryEvent) + @zope.component.adapter(IUtilityRegistration, IRegistrationEvent) def dispatchRegistration(registration, event): """When a demo utility is registered, add it to the registry. @@ -24,9 +30,14 @@ """ component = registration.component # Only dispatch registration of the interesting utilities. - new_event = KSSDemoRegistrationEvent() if IKSSDemoResource.providedBy(component) or \ IKSSSeleniumTestResource.providedBy(component): + new_event = KSSDemoRegistrationEvent() + handlers = zope.component.subscribers((component, registration, event, new_event), None) + for handler in handlers: + pass # getting them does the work + if IKSSDemoRegistry.providedBy(component): + new_event = KSSDemoRegistryEvent() handlers = zope.component.subscribers((component, registration, event, new_event), None) for handler in handlers: pass # getting them does the work Modified: kukit/kss.demo/branch/ree-1.2-working/kss/demo/interfaces.py ============================================================================== --- kukit/kss.demo/branch/ree-1.2-working/kss/demo/interfaces.py (original) +++ kukit/kss.demo/branch/ree-1.2-working/kss/demo/interfaces.py Wed Nov 28 15:35:32 2007 @@ -140,6 +140,11 @@ # -- class IKSSDemoRegistrationEvent(Interface): - """Redispatched evend for registration of - IKSSPDemoRegistry utilities. + """Redispatched event for registration of + IKSSDemoRegistration utilities (resources). + """ + +class IKSSDemoRegistryEvent(Interface): + """Redispatched event for registration of + IKSSDemoRegistry utilities. """ Modified: kukit/kss.demo/branch/ree-1.2-working/kss/demo/registry.py ============================================================================== --- kukit/kss.demo/branch/ree-1.2-working/kss/demo/registry.py (original) +++ kukit/kss.demo/branch/ree-1.2-working/kss/demo/registry.py Wed Nov 28 15:35:32 2007 @@ -9,6 +9,7 @@ IKSSDemoResource, IKSSSeleniumTestResource, IKSSDemoRegistrationEvent, + IKSSDemoRegistryEvent, ) from zope.component.interfaces import ( IUtilityRegistration, @@ -55,10 +56,26 @@ self.demos_are_sorted = False site.registerHandler(self.registerDemosFromPlugin) site.registerHandler(self.unregisterDemosFromPlugin) + site.registerHandler(self.registerEarlierDemos) # registry for selenium tests self.selenium_tests = [] site.registerHandler(self.registerSeleniumTestsFromPlugin) site.registerHandler(self.unregisterSeleniumTestsFromPlugin) + # ... the rest of setup will be done from registerEarlierDemos + + @adapter(IKSSDemoRegistry, IUtilityRegistration, IRegistered, IKSSDemoRegistryEvent) + def registerEarlierDemos(self, registry, registration=None, event=None, new_event=None): + """Make sure that the resources registered earlier, are added + (so this is a listener to the registration of myself + which is needed because CA is not ready at time of the __init__) + """ + if registry != self: + # The utility only register on itself. + return + site = getSiteManager() + for name, plugin in site.getUtilitiesFor(IKSSDemoResource): + for demo in plugin.demos: + self.registerDemo(demo) @adapter(IKSSDemoResource, IUtilityRegistration, IRegistered, IKSSDemoRegistrationEvent) def registerDemosFromPlugin(self, plugin, registration=None, event=None, new_event=None): From gotcha at codespeak.net Thu Nov 29 18:27:47 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 29 Nov 2007 18:27:47 +0100 (CET) Subject: [KSS-checkins] r49209 - kukit/kss.demo/trunk/kss/demo/browser Message-ID: <20071129172747.A2EB5816F@code0.codespeak.net> Author: gotcha Date: Thu Nov 29 18:27:47 2007 New Revision: 49209 Modified: kukit/kss.demo/trunk/kss/demo/browser/demo.css Log: add styling for .log Modified: kukit/kss.demo/trunk/kss/demo/browser/demo.css ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/demo.css (original) +++ kukit/kss.demo/trunk/kss/demo/browser/demo.css Thu Nov 29 18:27:47 2007 @@ -88,3 +88,13 @@ .container { padding : 1em; } + +.log { + margin: 0; + padding: 0.4em; + background: #CCC; + color: gray; + font-style: italic; +} + + From gotcha at codespeak.net Thu Nov 29 18:28:58 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 29 Nov 2007 18:28:58 +0100 (CET) Subject: [KSS-checkins] r49210 - kukit/kss.core/branch/finish-closures/kss/core/pluginregistry/browser Message-ID: <20071129172858.1A67B816F@code0.codespeak.net> Author: gotcha Date: Thu Nov 29 18:28:57 2007 New Revision: 49210 Modified: kukit/kss.core/branch/finish-closures/kss/core/pluginregistry/browser/develui.pt Log: improve kss mode ui Modified: kukit/kss.core/branch/finish-closures/kss/core/pluginregistry/browser/develui.pt ============================================================================== --- kukit/kss.core/branch/finish-closures/kss/core/pluginregistry/browser/develui.pt (original) +++ kukit/kss.core/branch/finish-closures/kss/core/pluginregistry/browser/develui.pt Thu Nov 29 18:28:57 2007 @@ -82,11 +82,9 @@ + value="Switch to production mode." /> + value="Switch to development mode." />

    The cookie is global to the site and may be overridden by a local utility (eg. ResourceRegistries, in Plone)

    From gotcha at codespeak.net Thu Nov 29 18:30:15 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 29 Nov 2007 18:30:15 +0100 (CET) Subject: [KSS-checkins] r49211 - kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests Message-ID: <20071129173015.85DF3816F@code0.codespeak.net> Author: gotcha Date: Thu Nov 29 18:30:15 2007 New Revision: 49211 Modified: kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/actions.html kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/basic_commands.html Log: remove dev mode / prod mode Modified: kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/actions.html ============================================================================== --- kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/actions.html (original) +++ kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/actions.html Thu Nov 29 18:30:15 2007 @@ -13,273 +13,6 @@ /demo/actions.html - - - clickAndWait - link=Setup - - - - assertTextPresent - Kss mode setup - - - - clickAndWait - button_devel - - - - assertTextPresent - development - - - - clickAndWait - link=Back - - - - assertTextPresent - development - - - - - assertAttribute - toggleclass-button at class - button click cursorPointer - - - click - toggleclass-button - - - - assertAttribute - toggleclass-button at class - button click cursorPointer selected - - - click - toggleclass-button - - - - assertAttribute - toggleclass-button at class - button click cursorPointer - - - assertAttribute - server-toggleclass-button at class - button click cursorPointer - - - click - server-toggleclass-button - - - - waitForAttribute - server-toggleclass-button at class - button click cursorPointer selected - - - assertAttribute - server-toggleclass-button at class - button click cursorPointer selected - - - click - server-toggleclass-button - - - - waitForAttribute - server-toggleclass-button at class - button click cursorPointer - - - assertAttribute - server-toggleclass-button at class - button click cursorPointer - - - - assertAttribute - addclass-button at class - button click cursorPointer - - - click - addclass-button - - - - waitForAttribute - addclass-button at class - button click cursorPointer selected - - - assertAttribute - addclass-button at class - button click cursorPointer selected - - - assertAttribute - server-addclass-button at class - button click cursorPointer - - - click - server-addclass-button - - - - waitForAttribute - server-addclass-button at class - button click cursorPointer selected - - - assertAttribute - server-addclass-button at class - button click cursorPointer selected - - - - assertAttribute - removeclass-button at class - button click cursorPointer selected - - - click - removeclass-button - - - - waitForAttribute - removeclass-button at class - button click cursorPointer - - - assertAttribute - removeclass-button at class - button click cursorPointer - - - assertAttribute - server-removeclass-button at class - button click cursorPointer selected - - - click - server-removeclass-button - - - - waitForAttribute - server-removeclass-button at class - button click cursorPointer - - - assertAttribute - server-removeclass-button at class - button click cursorPointer - - - - clickAndWait - link=Setup - - - - assertTextPresent - Kss mode setup - - - - clickAndWait - button_prod - - - - assertTextPresent - production - - - - clickAndWait - link=Back - - - - assertTextPresent - production - - - - - assertAttribute - toggleclass-button at class - button click cursorPointer - - - click - toggleclass-button - - - - assertAttribute - toggleclass-button at class - button click cursorPointer selected - - - click - toggleclass-button - - - - assertAttribute - toggleclass-button at class - button click cursorPointer - - - assertAttribute - server-toggleclass-button at class - button click cursorPointer - - - click - server-toggleclass-button - - - - waitForAttribute - server-toggleclass-button at class - button click cursorPointer selected - - - assertAttribute - server-toggleclass-button at class - button click cursorPointer selected - - - click - server-toggleclass-button - - - - waitForAttribute - server-toggleclass-button at class - button click cursorPointer - - - assertAttribute - server-toggleclass-button at class - button click cursorPointer - - assertAttribute toggleclass-button at class @@ -422,6 +155,7 @@ server-removeclass-button at class button click cursorPointer +/tr> Modified: kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/basic_commands.html ============================================================================== --- kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/basic_commands.html (original) +++ kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/basic_commands.html Thu Nov 29 18:30:15 2007 @@ -13,235 +13,6 @@ /demo/basic_commands.html - - - clickAndWait - link=Setup - - - - assertTextPresent - Kss mode setup - - - - clickAndWait - button_devel - - - - assertTextPresent - development - - - - clickAndWait - link=Back - - - - assertTextPresent - development - - - - - assertText - demo - KSS - - - assertText - copy - copy here - - - click - change - - - - waitForElementPresent - workedagain - - - - assertElementPresent - workedagain - - - - assertText - demo - it worked again - - - click - clear - - - - waitForElementNotPresent - workedagain - - - - assertNotText - demo - it worked again - - - click - copyFrom - - - - waitForNotText - copy - copy here - - - assertNotText - copy - copy here - - - assertElementNotPresent - workedagain - - - - click - change - - - - waitForElementPresent - workedagain - - - - assertElementPresent - workedagain - - - - assertNotText - copy - it worked again - - - click - copyFrom - - - - waitForText - copy - it worked again - - - assertText - copy - it worked again - - - click - clear - - - - waitForNotText - demo - it worked again - - - assertNotText - demo - it worked again - - - click - copyTo - - - - waitForText - demo - it worked again - - - assertText - demo - it worked again - - - click - clear - - - - waitForNotText - demo - it worked again - - - assertNotText - demo - it worked again - - - click - moveTo - - - - waitForText - demo - it worked again - - - assertText - demo - it worked again - - - assertNotText - copy - it worked again - - - - clickAndWait - link=Setup - - - - assertTextPresent - Kss mode setup - - - - clickAndWait - button_prod - - - - assertTextPresent - production - - - - clickAndWait - link=Back - - - - assertTextPresent - production - - - assertText demo From gotcha at codespeak.net Thu Nov 29 18:30:56 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 29 Nov 2007 18:30:56 +0100 (CET) Subject: [KSS-checkins] r49212 - kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests Message-ID: <20071129173056.9BF1C8173@code0.codespeak.net> Author: gotcha Date: Thu Nov 29 18:30:56 2007 New Revision: 49212 Added: kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/setDevMode.html kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/setProdMode.html Log: add selenium tests to change mode Added: kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/setDevMode.html ============================================================================== --- (empty file) +++ kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/setDevMode.html Thu Nov 29 18:30:56 2007 @@ -0,0 +1,33 @@ + + + +basic_commands + + + + + + + + + + + + + + + + + + + + + + + + + + +
    basic_commands
    opendemo/@@kss_devel_mode/ui
    assertTextPresentKss mode setup
    clickAndWaitbutton_devel
    assertTextPresentdevelopment
    + + Added: kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/setProdMode.html ============================================================================== --- (empty file) +++ kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/setProdMode.html Thu Nov 29 18:30:56 2007 @@ -0,0 +1,33 @@ + + + +basic_commands + + + + + + + + + + + + + + + + + + + + + + + + + + +
    basic_commands
    open/demo/@@kss_devel_mode/ui
    assertTextPresentKss mode setup
    clickAndWaitbutton_prod
    assertTextPresentproduction
    + + From gotcha at codespeak.net Thu Nov 29 18:31:33 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 29 Nov 2007 18:31:33 +0100 (CET) Subject: [KSS-checkins] r49213 - kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests Message-ID: <20071129173133.662B8816F@code0.codespeak.net> Author: gotcha Date: Thu Nov 29 18:31:33 2007 New Revision: 49213 Modified: kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/suite.html Log: add more tests to test suite Modified: kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/suite.html ============================================================================== --- kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/suite.html (original) +++ kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/suite.html Thu Nov 29 18:31:33 2007 @@ -1,14 +1,103 @@ - - +
    - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Test Suite
    Two selects revisited
    Forms
    +

    + Development mode +

    +
    Basic commands
    Two selects
    Two selects revisited
    Forms
    Actions
    Auto update
    Focus
    Prevent default on click
    Prevent default
    Inline edit
    Bubbling
    Selector parameters
    Selectors
    +

    + Production mode +

    +
    Basic commands
    Two selects
    Two selects revisited
    Forms
    Actions
    Auto update
    Focus
    Prevent default on click
    Prevent default
    Inline edit
    Bubbling
    Selector parameters
    Selectors
    From gotcha at codespeak.net Thu Nov 29 18:32:24 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 29 Nov 2007 18:32:24 +0100 (CET) Subject: [KSS-checkins] r49214 - in kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo: coreplugin selenium_tests Message-ID: <20071129173224.5F1D48097@code0.codespeak.net> Author: gotcha Date: Thu Nov 29 18:32:23 2007 New Revision: 49214 Modified: kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/coreplugin/kss_evt_preventbubbling.kss kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/coreplugin/kss_evt_preventbubbling.pt kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/kss_prevent_bubbling.html Log: fix test to make it work in production mode as well Modified: kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/coreplugin/kss_evt_preventbubbling.kss ============================================================================== --- kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/coreplugin/kss_evt_preventbubbling.kss (original) +++ kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/coreplugin/kss_evt_preventbubbling.kss Thu Nov 29 18:32:23 2007 @@ -1,20 +1,29 @@ #parent-node:click { evt-click-allowbubbling: true; evt-click-preventdefault: true; - action-client: alert; - alert-message: "you clicked inside the DIV tag"; + action-client: deleteNodeBefore; + deleteNodeBefore-kssSelector: #logEnd; + action-client: insertHTMLBefore; + insertHTMLBefore-kssSelector: #logEnd; + insertHTMLBefore-html: "containing DIV.

    "; } #bubbling-node:click { evt-click-preventdefault: true; - action-client: alert; - alert-message: "you clicked the bubbling A tag"; + action-client: deleteNodeBefore; + deleteNodeBefore-kssSelector: #logEnd; + action-client: insertHTMLBefore; + insertHTMLBefore-kssSelector: #logEnd; + insertHTMLBefore-html: "bubbling P.

    "; } #not-bubbling-node:click { evt-click-preventdefault: true; evt-click-preventbubbling: true; - action-client: alert; - alert-message: "you clicked the not bubbling A tag"; + action-client: deleteNodeBefore; + deleteNodeBefore-kssSelector: #logEnd; + action-client: insertHTMLBefore; + insertHTMLBefore-kssSelector: #logEnd; + insertHTMLBefore-html: "not bubbling P.

    "; } Modified: kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/coreplugin/kss_evt_preventbubbling.pt ============================================================================== --- kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/coreplugin/kss_evt_preventbubbling.pt (original) +++ kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/coreplugin/kss_evt_preventbubbling.pt Thu Nov 29 18:32:23 2007 @@ -6,11 +6,13 @@ @@ -22,28 +24,27 @@

    header

    -

    Kss prevent bubbling demo

    -

    This demo shows how a rule can prevent bubbling of an event to its parent nodes

    - - -

    DIV

    -
    -

    -Click anywhere inside this DIV to show an alert -

    -

    -Click here to trigger an event in both the A tag and in the parent node -

    -

    -Text -

    -

    -Click here to trigger an event only in the A tag -

    -

    -Text -

    -
    - +

    Prevent bubbling

    +

    This demo shows how a rule can prevent bubbling of an event to its parent nodes

    +

    Containing DIV

    +
    +

    + Click anywhere inside this containing DIV and check the log hereunder. +

    +

    Click here to trigger an event in both the P tag and in the parent node.

    +

    + Some text +

    +

    Click here to trigger an event only in the P tag.

    +

    + Some text +

    +
    +

    Log

    +

    You clicked

    +
    +

    +

    +
    Modified: kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/kss_prevent_bubbling.html ============================================================================== --- kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/kss_prevent_bubbling.html (original) +++ kukit/kss.core/branch/finish-closures/kss/core/plugins/core/demo/selenium_tests/kss_prevent_bubbling.html Thu Nov 29 18:32:23 2007 @@ -13,118 +13,9 @@ /demo/kss_evt_preventbubbling.html - - clickAndWait - link=Setup - - - - assertTextPresent - Kss mode setup - - - - clickAndWait - button_devel - - - - assertTextPresent - development - - - - clickAndWait - link=Back - - - - assertTextPresent - development - - - - - clickAt - css=div#parent-node - - - - assertAlert - you clicked inside the DIV tag, event [click], rule #0, node [DIV]. - - - - assertAlertNotPresent - - - - - clickAt - css=a#bubbling-node - - - - assertAlert - you clicked the bubbling A tag, event [click], rule #1, node [A]. - - - - assertAlert - you clicked inside the DIV tag, event [click], rule #0, node [DIV]. - - - - assertAlertNotPresent - - - - - clickAt - css=a#not-bubbling-node - - - - assertAlert - you clicked the not bubbling A tag, event [click], rule #2, node [A]. - - - - - clickAndWait - link=Setup - - - - assertTextPresent - Kss mode setup - - - - clickAndWait - button_prod - - - - assertTextPresent - production - - - - clickAndWait - link=Back - - - - assertTextPresent - production - - - - - assertAlertNotPresent - + assertText + logger @@ -133,49 +24,29 @@ - assertAlert - you clicked inside the DIV tag - - - - assertAlertNotPresent - - + assertText + css=#logger + containing DIV. clickAt - css=a#bubbling-node - - - - assertAlert - you clicked the bubbling A tag - - - - assertAlert - you clicked inside the DIV tag + css=p#bubbling-node - assertAlertNotPresent - - + assertText + logger + containing DIV. bubbling P. containing DIV. clickAt - css=a#not-bubbling-node + css=p#not-bubbling-node - assertAlert - you clicked the not bubbling A tag - - - - assertAlertNotPresent - - + assertText + css=#logger + containing DIV. bubbling P. containing DIV. not bubbling P. From jvloothuis at codespeak.net Fri Nov 30 09:18:04 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Fri, 30 Nov 2007 09:18:04 +0100 (CET) Subject: [KSS-checkins] r49218 - kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser Message-ID: <20071130081804.B39188210@code0.codespeak.net> Author: jvloothuis Date: Fri Nov 30 09:18:02 2007 New Revision: 49218 Modified: kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt Log: Fixed an XML error (missing /> on an input) which made the develui unusable Modified: kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt ============================================================================== --- kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt (original) +++ kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt Fri Nov 30 09:18:02 2007 @@ -121,7 +121,7 @@ + " />
    From reebalazs at codespeak.net Fri Nov 30 10:48:57 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Fri, 30 Nov 2007 10:48:57 +0100 (CET) Subject: [KSS-checkins] r49222 - kukit/kukit.js/branch/ree-loglevels/kukit Message-ID: <20071130094857.672EA820D@code0.codespeak.net> Author: reebalazs Date: Fri Nov 30 10:48:56 2007 New Revision: 49222 Modified: kukit/kukit.js/branch/ree-loglevels/kukit/utils.js Log: Make filtering in a central place, according to Jeroen's suggestion but little differently. Modified: kukit/kukit.js/branch/ree-loglevels/kukit/utils.js ============================================================================== --- kukit/kukit.js/branch/ree-loglevels/kukit/utils.js (original) +++ kukit/kukit.js/branch/ree-loglevels/kukit/utils.js Fri Nov 30 10:48:56 2007 @@ -112,6 +112,12 @@ ;;; }; // Call the function that sets up the handlers this._setupHandlers(); + // Wrap the just set up handlers, to include wrapping +;;; this.logDebug = this._logFilter(this.logDebug, 0); +;;; this.log = this._logFilter(this.log, 1); +;;; this.logWarning = this._logFilter(this.logWarning, 2); +;;; this.logError = this._logFilter(this.logError, 3); +;;; this.logFatal = this._logFilter(this.logFatal, 3); }; // Log filter, for use from the handlers. @@ -169,11 +175,11 @@ ;;; kukit._logger._setupHandlers = function() { ;;; // for debug level we also log as 'info', because we do ;;; // not want FireBug to display line information. -;;; this.logDebug = this._logFilter(console.log, 0); -;;; this.log = this._logFilter(console.log, 1); -;;; this.logWarning = this._logFilter(console.warn, 2); -;;; this.logError = this._logFilter(console.error, 3); -;;; this.logFatal = this._logFilter(console.error, 3); +;;; this.logDebug = console.log; +;;; this.log = console.log; +;;; this.logWarning = console.warn; +;;; this.logError = console.error; +;;; this.logFatal = console.error; ;;; } ;;; } @@ -188,11 +194,11 @@ ;;; // Set up logging for MochiKit ;;; if (! kukit.hasFirebug && kukit.hasMochiKit) { ;;; kukit._logger._setupHandlers = function() { -;;; this.logDebug = this._logFilter(MochiKit.Logging.logDebug, 0); -;;; this.log = this._logFilter(MochiKit.Logging.log, 1); -;;; this.logWarning = this._logFilter(MochiKit.Logging.logWarning, 2); -;;; this.logError = this._logFilter(MochiKit.Logging.logError, 3); -;;; this.logFatal = this._logFilter(MochiKit.Logging.logFatal, 3); +;;; this.logDebug = MochiKit.Logging.logDebug; +;;; this.log = MochiKit.Logging.log; +;;; this.logWarning = MochiKit.Logging.logWarning; +;;; this.logError = MochiKit.Logging.logError; +;;; this.logFatal = MochiKit.Logging.logFatal; ;;; } ;;; // make convenience url ;;; // javascript:kukit.showLog(); @@ -213,11 +219,11 @@ ;;; // Set up logging for Safari ;;; if (! kukit.hasFirebug && ! kukit.hasMochiKit && kukit.hasSafari) { ;;; kukit._logger._setupHandlers = function() { -;;; this.logDebug = this._logFilter(function(str) { console.log('DEBUG: '+str); }, 0); -;;; this.log = this._logFilter(function(str) { console.log('INFO: '+str); }, 1); -;;; this.logWarning = this._logFilter(function(str) { console.log('WARNING: '+str); }, 2); -;;; this.logError = this._logFilter(function(str) { console.log('ERROR: '+str); }, 3); -;;; this.logFatal = this._logFilter(function(str) { console.log('FATAL: '+str); }, 3); +;;; this.logDebug = function(str) { console.log('DEBUG: '+str); }; +;;; this.log = function(str) { console.log('INFO: '+str); }; +;;; this.logWarning = function(str) { console.log('WARNING: '+str); }; +;;; this.logError = function(str) { console.log('ERROR: '+str); }; +;;; this.logFatal = function(str) { console.log('FATAL: '+str); }; ;;; } ;;; } From reebalazs at codespeak.net Fri Nov 30 10:58:28 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Fri, 30 Nov 2007 10:58:28 +0100 (CET) Subject: [KSS-checkins] r49223 - kukit/kukit.js/branch/ree-loglevels/kukit Message-ID: <20071130095828.E4C11820D@code0.codespeak.net> Author: reebalazs Date: Fri Nov 30 10:58:28 2007 New Revision: 49223 Modified: kukit/kukit.js/branch/ree-loglevels/kukit/utils.js Log: Add a comment Modified: kukit/kukit.js/branch/ree-loglevels/kukit/utils.js ============================================================================== --- kukit/kukit.js/branch/ree-loglevels/kukit/utils.js (original) +++ kukit/kukit.js/branch/ree-loglevels/kukit/utils.js Fri Nov 30 10:58:28 2007 @@ -145,6 +145,8 @@ kukit.logFatal = function(message) {kukit._logger.logFatal(message);}; // Function to change the log level from javascript +// level must be one of "DEBUG", "INFO", "WARNING", "ERROR". +// (Small caps are tolerated as well) kukit.setLogLevel = function(level) { ;;; // Store it in the cookie so that it persists through requests. ;;; kukit.dom.writeCookie(kukit._COOKIE_LOGLEVEL, level); From reebalazs at codespeak.net Fri Nov 30 11:03:51 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Fri, 30 Nov 2007 11:03:51 +0100 (CET) Subject: [KSS-checkins] r49224 - kukit/kukit.js/branch/ree-loglevels/kukit Message-ID: <20071130100351.C25CB8211@code0.codespeak.net> Author: reebalazs Date: Fri Nov 30 11:03:51 2007 New Revision: 49224 Modified: kukit/kukit.js/branch/ree-loglevels/kukit/utils.js Log: Fix the on-the-fly setting Modified: kukit/kukit.js/branch/ree-loglevels/kukit/utils.js ============================================================================== --- kukit/kukit.js/branch/ree-loglevels/kukit/utils.js (original) +++ kukit/kukit.js/branch/ree-loglevels/kukit/utils.js Fri Nov 30 11:03:51 2007 @@ -149,7 +149,7 @@ // (Small caps are tolerated as well) kukit.setLogLevel = function(level) { ;;; // Store it in the cookie so that it persists through requests. -;;; kukit.dom.writeCookie(kukit._COOKIE_LOGLEVEL, level); +;;; kukit.dom.createCookie(kukit._COOKIE_LOGLEVEL, level); ;;; // re-establish the log handlers, based on this cookie setting ;;; kukit._logger.updateLogLevel(); } From jvloothuis at codespeak.net Fri Nov 30 11:07:58 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Fri, 30 Nov 2007 11:07:58 +0100 (CET) Subject: [KSS-checkins] r49225 - kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser Message-ID: <20071130100758.8E1898212@code0.codespeak.net> Author: jvloothuis Date: Fri Nov 30 11:07:58 2007 New Revision: 49225 Modified: kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.css kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt Log: Updated the devel ui so that the debug levels now have working labels and the colors are a bit better (imho) Modified: kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.css ============================================================================== --- kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.css (original) +++ kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.css Fri Nov 30 11:07:58 2007 @@ -97,7 +97,18 @@ color: green; } -.cyan { - color: cyan; +.error { + color: red; } +.warning { + color: orange; +} + +.info { + color: green; +} + +.debug { + color: blue; +} \ No newline at end of file Modified: kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt ============================================================================== --- kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt (original) +++ kukit/kss.core/branch/ree-loglevels/kss/core/pluginregistry/browser/develui.pt Fri Nov 30 11:07:58 2007 @@ -96,9 +96,9 @@

    KSS log level setup

    -

    +

    Current KSS log level is - DEBUG.

    @@ -118,12 +118,13 @@ - - +
    An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20071130/3a71a1d1/attachment.htm From kukit-checkins at codespeak.net Fri Nov 30 17:33:35 2007 From: kukit-checkins at codespeak.net (VIAGRA ® Official Site) Date: Fri, 30 Nov 2007 17:33:35 +0100 (CET) Subject: [KSS-checkins] November 78% OFF Message-ID: <20071130065715.14520.qmail@ip-53.net-89-2-150.rev.numericable.fr> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20071130/6c0a7294/attachment-0001.htm