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.