From reebalazs at codespeak.net Tue May 1 01:02:30 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Tue, 1 May 2007 01:02:30 +0200 (CEST) Subject: [KSS-checkins] r42507 - in kukit/kss.demo/trunk: . docs Message-ID: <20070430230230.B108E8069@code0.codespeak.net> Author: reebalazs Date: Tue May 1 01:02:29 2007 New Revision: 42507 Modified: kukit/kss.demo/trunk/docs/HISTORY.txt kukit/kss.demo/trunk/setup.py Log: Prepare for release Modified: kukit/kss.demo/trunk/docs/HISTORY.txt ============================================================================== --- kukit/kss.demo/trunk/docs/HISTORY.txt (original) +++ kukit/kss.demo/trunk/docs/HISTORY.txt Tue May 1 01:02:29 2007 @@ -6,6 +6,11 @@ - ... +kss.demo - 1.2-beta2 Released 2007-04-30 + + - Prepare for release + [ree] + kss.demo - 1.2-beta1 Released 2007-03-04 - Prepare for release Modified: kukit/kss.demo/trunk/setup.py ============================================================================== --- kukit/kss.demo/trunk/setup.py (original) +++ kukit/kss.demo/trunk/setup.py Tue May 1 01:02:29 2007 @@ -18,7 +18,7 @@ keywords='', author='KSS Project', author_email='kss-devel at codespeak.net', - url='http://kukit.org', + url='http://kssproject.org', license='GPL', packages=find_packages(exclude=['ez_setup']), namespace_packages=['kss'], From reebalazs at codespeak.net Tue May 1 01:04:11 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Tue, 1 May 2007 01:04:11 +0200 (CEST) Subject: [KSS-checkins] r42508 - kukit/kss.demo/tag/1.2-beta2 Message-ID: <20070430230411.71FEC8069@code0.codespeak.net> Author: reebalazs Date: Tue May 1 01:04:10 2007 New Revision: 42508 Added: kukit/kss.demo/tag/1.2-beta2/ - copied from r42507, kukit/kss.demo/trunk/ Log: Tagging release From reebalazs at codespeak.net Tue May 1 01:08:30 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Tue, 1 May 2007 01:08:30 +0200 (CEST) Subject: [KSS-checkins] r42509 - in kukit/kss.demo/tag/1.2-beta2: . kss/demo Message-ID: <20070430230830.176C58069@code0.codespeak.net> Author: reebalazs Date: Tue May 1 01:08:29 2007 New Revision: 42509 Removed: kukit/kss.demo/tag/1.2-beta2/setup.cfg Modified: kukit/kss.demo/tag/1.2-beta2/kss/demo/version.txt kukit/kss.demo/tag/1.2-beta2/setup.py Log: Setting release Modified: kukit/kss.demo/tag/1.2-beta2/kss/demo/version.txt ============================================================================== --- kukit/kss.demo/tag/1.2-beta2/kss/demo/version.txt (original) +++ kukit/kss.demo/tag/1.2-beta2/kss/demo/version.txt Tue May 1 01:08:29 2007 @@ -1 +1 @@ -1.2dev Unreleased +1.2-beta2 Released 2007-04-30 Deleted: /kukit/kss.demo/tag/1.2-beta2/setup.cfg ============================================================================== --- /kukit/kss.demo/tag/1.2-beta2/setup.cfg Tue May 1 01:08:29 2007 +++ (empty file) @@ -1,3 +0,0 @@ -[egg_info] -tag_build = dev -tag_svn_revision = true Modified: kukit/kss.demo/tag/1.2-beta2/setup.py ============================================================================== --- kukit/kss.demo/tag/1.2-beta2/setup.py (original) +++ kukit/kss.demo/tag/1.2-beta2/setup.py Tue May 1 01:08:29 2007 @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import sys, os -version = '1.2' +version = '1.2-beta2' setup(name='kss.demo', version=version, @@ -26,12 +26,11 @@ zip_safe=False, install_requires=[ # -*- Extra requirements: -*- - 'kss.core>=dev', + 'kss.core>=1.2-beta2', ], entry_points=""" # -*- Entry points: -*- """, dependency_links=[ - 'https://codespeak.net/svn/kukit/kss.core/trunk#egg=kss.core-dev', ], ) From reebalazs at codespeak.net Wed May 2 00:13:21 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 00:13:21 +0200 (CEST) Subject: [KSS-checkins] r42563 - kukit/kss.concatresource Message-ID: <20070501221321.CD5D2807C@code0.codespeak.net> Author: reebalazs Date: Wed May 2 00:13:21 2007 New Revision: 42563 Added: kukit/kss.concatresource/ Log: Create package import From reebalazs at codespeak.net Wed May 2 00:13:31 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 00:13:31 +0200 (CEST) Subject: [KSS-checkins] r42564 - kukit/kss.concatresource/trunk Message-ID: <20070501221331.ADEA2807E@code0.codespeak.net> Author: reebalazs Date: Wed May 2 00:13:31 2007 New Revision: 42564 Added: kukit/kss.concatresource/trunk/ Log: Create package import From reebalazs at codespeak.net Wed May 2 00:13:39 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 00:13:39 +0200 (CEST) Subject: [KSS-checkins] r42565 - kukit/kss.concatresource/branch Message-ID: <20070501221339.78B6D807F@code0.codespeak.net> Author: reebalazs Date: Wed May 2 00:13:39 2007 New Revision: 42565 Added: kukit/kss.concatresource/branch/ Log: Create package import From reebalazs at codespeak.net Wed May 2 00:13:51 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 00:13:51 +0200 (CEST) Subject: [KSS-checkins] r42566 - kukit/kss.concatresource/tag Message-ID: <20070501221351.471448080@code0.codespeak.net> Author: reebalazs Date: Wed May 2 00:13:51 2007 New Revision: 42566 Added: kukit/kss.concatresource/tag/ Log: Create package import From reebalazs at codespeak.net Wed May 2 00:30:41 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 00:30:41 +0200 (CEST) Subject: [KSS-checkins] r42567 - in kukit/kss.concatresource/trunk: . docs kss Message-ID: <20070501223041.E6001807C@code0.codespeak.net> Author: reebalazs Date: Wed May 2 00:30:41 2007 New Revision: 42567 Added: kukit/kss.concatresource/trunk/README.txt kukit/kss.concatresource/trunk/docs/ kukit/kss.concatresource/trunk/docs/HISTORY.txt kukit/kss.concatresource/trunk/docs/INSTALL.txt kukit/kss.concatresource/trunk/docs/LICENSE.GPL kukit/kss.concatresource/trunk/docs/LICENSE.txt kukit/kss.concatresource/trunk/kss/ kukit/kss.concatresource/trunk/setup.cfg kukit/kss.concatresource/trunk/setup.py Log: Initial structure Added: kukit/kss.concatresource/trunk/README.txt ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/README.txt Wed May 2 00:30:41 2007 @@ -0,0 +1,10 @@ +kss.concatresource Package Readme +================================= + +Overview +-------- + +concatresource + +XXX + Added: kukit/kss.concatresource/trunk/docs/HISTORY.txt ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/docs/HISTORY.txt Wed May 2 00:30:41 2007 @@ -0,0 +1,11 @@ +Changelog for kss.concatresource + + (name of developer listed in brackets) + +kss.demo - 1.2dev Unreleased + + - ... + + - Initial package structure. + [ree] + Added: kukit/kss.concatresource/trunk/docs/INSTALL.txt ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/docs/INSTALL.txt Wed May 2 00:30:41 2007 @@ -0,0 +1,16 @@ +kss.demo Installation +===================== + + * When you're reading this you have probably already run + ``easy_install kss.demo``. Find out how to install setuptools + (and EasyInstall) here: + http://peak.telecommunity.com/DevCenter/EasyInstall + + * Copy the files ``kss/concatresource/kss.concatresource-configure.zcml`` and + ``kss/concatresource/kss.concatresource-meta.zcml`` in the + ``/path/to/instance/etc/package-includes`` directory. + + * On Zope 2.8, the package-includes directory is not created by + default, so you also have to create it. + + Added: kukit/kss.concatresource/trunk/docs/LICENSE.GPL ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/docs/LICENSE.GPL Wed May 2 00:30:41 2007 @@ -0,0 +1,222 @@ + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS Added: kukit/kss.concatresource/trunk/docs/LICENSE.txt ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/docs/LICENSE.txt Wed May 2 00:30:41 2007 @@ -0,0 +1,15 @@ + kss.concatresource is copyright Balazs Ree and KSS Project contributors + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + 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. Added: kukit/kss.concatresource/trunk/setup.cfg ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/setup.cfg Wed May 2 00:30:41 2007 @@ -0,0 +1,3 @@ +[egg_info] +tag_build = dev +tag_svn_revision = true Added: kukit/kss.concatresource/trunk/setup.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/setup.py Wed May 2 00:30:41 2007 @@ -0,0 +1,35 @@ +from setuptools import setup, find_packages + +version = '1.2' + +setup(name='concatresource', + version=version, + description="concatresource creates concatenated and packed resources", + 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 Contributors', + 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=[ + # -*- Extra requirements: -*- + ], + entry_points=""" + # -*- Entry points: -*- + """, + dependency_links=[ + 'https://codespeak.net/svn/kukit/kss.concatresource/trunk#egg=kss.concatresource-dev', + ], + ) From reebalazs at codespeak.net Wed May 2 00:45:34 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 00:45:34 +0200 (CEST) Subject: [KSS-checkins] r42568 - in kukit/kss.concatresource/trunk/kss/concatresource: . compression compression/thirdparty test Message-ID: <20070501224534.D1B76807F@code0.codespeak.net> Author: reebalazs Date: Wed May 2 00:45:34 2007 New Revision: 42568 Added: kukit/kss.concatresource/trunk/kss/concatresource/ kukit/kss.concatresource/trunk/kss/concatresource/README kukit/kss.concatresource/trunk/kss/concatresource/__init__.py kukit/kss.concatresource/trunk/kss/concatresource/cachingadapter.py kukit/kss.concatresource/trunk/kss/concatresource/compression/ kukit/kss.concatresource/trunk/kss/concatresource/compression/__init__.py kukit/kss.concatresource/trunk/kss/concatresource/compression/css.py kukit/kss.concatresource/trunk/kss/concatresource/compression/javascript.py kukit/kss.concatresource/trunk/kss/concatresource/compression/thirdparty/ kukit/kss.concatresource/trunk/kss/concatresource/compression/thirdparty/LICENSE kukit/kss.concatresource/trunk/kss/concatresource/compression/thirdparty/__init__.py kukit/kss.concatresource/trunk/kss/concatresource/compression/thirdparty/packer.py kukit/kss.concatresource/trunk/kss/concatresource/concatfileresource.py kukit/kss.concatresource/trunk/kss/concatresource/concatresource-configure.zcml kukit/kss.concatresource/trunk/kss/concatresource/concatresource-meta.zcml kukit/kss.concatresource/trunk/kss/concatresource/configure.zcml kukit/kss.concatresource/trunk/kss/concatresource/directives.py kukit/kss.concatresource/trunk/kss/concatresource/fields.py kukit/kss.concatresource/trunk/kss/concatresource/fileresource.py kukit/kss.concatresource/trunk/kss/concatresource/interfaces.py kukit/kss.concatresource/trunk/kss/concatresource/meta.py kukit/kss.concatresource/trunk/kss/concatresource/meta.zcml kukit/kss.concatresource/trunk/kss/concatresource/resource.py kukit/kss.concatresource/trunk/kss/concatresource/test/ kukit/kss.concatresource/trunk/kss/concatresource/test/README kukit/kss.concatresource/trunk/kss/concatresource/test/__init__.py kukit/kss.concatresource/trunk/kss/concatresource/test/configure.zcml kukit/kss.concatresource/trunk/kss/concatresource/test/test1.js kukit/kss.concatresource/trunk/kss/concatresource/test/test2.js Log: Import module Added: kukit/kss.concatresource/trunk/kss/concatresource/README ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/README Wed May 2 00:45:34 2007 @@ -0,0 +1,137 @@ + +Objectives +---------- + +I made this utility for the works in the jsonserver integration and +AZAX/kukit. This was meant to be a temporary, lightweight solution but it +has long term merits too. I needed this because I wanted a solution that +works right now, works on zope3 and zope 2.8 even (so zc.resourcelibraries +was not a choice), does not depend on Plone (so ResourceRegistries is out +too). + +The interesting point of the utility is: instead of building registries to +emit include tags in the HTML, it simply makes one resource that needs to +be imported in a single line:: + + + +Also: + +- it compresses the JS or CSS files with Florian Schulze's compressor + from ResourceRegistries + +- it contains an utility interface that another component can implement + to dynamically extend the list of files (like I did with AZAX). So the + "registry" is not really implemented but can be plugged in. + +- it is tested (although not much) to work with Zope 2.8, 2.9, 3.1, 3.2 + +Meanwhile I implemented the cache headers for the resources correctly +here, the current implementation of caching is broken in Five and I +believe in Z3 resources as well; beware that I considered the original +Zope3 code only and did not look at additional utilities. According to my +observation: in Z3 the original resources attempt to handle the cache +headers correctly but never really check if the file gets changed on the +filesystem (only on restart). If this is really a problem and not just I +believe, then it is fixed in my code. (Read more in the Caching part.) + +More information on this issue: + +http://article.gmane.org/gmane.comp.web.zope.z3base.general/53 + +Compression +----------- + +You can use more levels of compressions with the compress_level attribute. + + + +Some explanation: + +- compression is only implemented for JavaScript and CSS + +- The default level is "safe", this is useable with all scripts + +- The "full" level gives even better compression by taking out all newlines + and mangling private variable names, but some preparation must be made + in the scripts for that (like putting a ; after }-s I think, and + also maybe more). + +- Specifying "none" will leave your resource uncompressed. This + can be useful for debugging. + +Caching control +--------------- + +You have some possibility to control how caching of resources are done. + + + +The attribute "lmt_checking_period" controls how often the file +modification dates are checked from the filesystem. By default this is +60.0, this means that once the file modification is checked, it will not be +checked before the next 60 seconds elapses. In other words, if you change +the files on the filesystem, it will cause a maximum of this long delay +until the changes propagate to the rendered resources. For debugging this +can be set to 0 to allow immediate changes, however in production this +setup would cause the files often looked up in the filesystem, which, +especially with badly implemented filesystems can cause a problem. This +feature is already an enhancement to the original Zope 3 resource +implementation where, unless running in debug mode, changes in the resource +files will require a restart to become visible in the result. + +The attribute "caching", when set to "memory", will result that the cooked +resource will be cached in memory and looked up from them as long as the +files are unchanged. This, especially with compress options, can cause a +speedup in rendering the resources. However, in normal operation this is +not necessary at all, since if caching is set up properly, the browser and +the upstream cache asks via the "If-Modified-Since" headers if the resource +has been changed recently, and the resource itself is queried only when +needed, independently of the setup of this option. While debugging, +however, when browser caching is forced to switch off, without this option +the resource would be cooked each time the browser reloads the dependent +page, so in this case setting "caching" to "memory" causes a significant +speedup in these cases. In production however, is not only unnecessary but +also causes an additional memory consumption. + +Debug setup +----------- + +To summarize with an example, the following settings are advisable while +debugging: + + + +Release notes +------------- + +In Zope 2.9.2 there is Five 1.3.3 included. This contains a bug that +the resources will never be looked up from the +application root. + +To fix this, you need to update Five to version 1.3.5, or update Zope +to version >= 2.9.3. + + Added: kukit/kss.concatresource/trunk/kss/concatresource/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/__init__.py Wed May 2 00:45:34 2007 @@ -0,0 +1,11 @@ +'''\ +Product init +''' +# alias myself to python import root, directly +try: + import sys + if not 'concatresource' in sys.modules: + # only 1st import is aliased. + sys.modules['concatresource'] = sys.modules[globals()['__name__']] +except ImportError: + pass Added: kukit/kss.concatresource/trunk/kss/concatresource/cachingadapter.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/cachingadapter.py Wed May 2 00:45:34 2007 @@ -0,0 +1,65 @@ +from time import time +from interfaces import ICachedResource +from zope.interface import implements + +try: + from zope.datetime import rfc1123_date +except ImportError: + # Zope < 2.10 + from zope.app.datetimeutils import rfc1123_date + + +class CachedResource(object): + 'Adapts a ContextFile to a cached resource' + implements(ICachedResource) + + def __init__(self, context): + self.context = context + self.lmt_last_checked = 0 + self.data_last_fetched = 0 + + def _fetchdata(self): + try: + result = self._contents + ##print "*****Resource from cached" + except AttributeError: + result = self._contents = self.context.getContents() + self.data_last_fetched = time() + ##print "*****Resource kooked" + return result + + def _deldata(self): + del self._contents + + def purgeData(self): + 'Force file contents to be reloaded' + ##print "***** PURGE", self.context.__name__ + try: + self._deldata() + except AttributeError: + pass + + # Once fetched, data is cached in the object until + # explicitely deleted. + data = property(lambda self: self._fetchdata()['data'], None, _deldata) + content_type = property(lambda self: self._fetchdata()['content_type'], None, _deldata) + + # Last modified time is calculated on demand + # but never more often then lmt_check_period + def _fetchlm(self): + now = time() + if now - self.lmt_last_checked > self.lmt_check_period: + self.lmt_last_checked = now + lmt = float(self.context.getLastMod()) or now + lmh = rfc1123_date(lmt) + d = self._last_mod = dict(lmt = lmt, lmh = lmh) + ##print "***** LMT reread", d + else: + d = self._last_mod + return d + + lmt = property(lambda self: self._fetchlm()['lmt']) + lmh = property(lambda self: self._fetchlm()['lmh']) + + caching = property(lambda self: self.context.caching) + lmt_check_period = property(lambda self: self.context.lmt_check_period) Added: kukit/kss.concatresource/trunk/kss/concatresource/compression/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/compression/__init__.py Wed May 2 00:45:34 2007 @@ -0,0 +1,20 @@ +'''\ +Preprocess resource files by applying compression on them +''' + +__all__ = ('compress', ) + +from javascript import compress as compress_javascript +from css import compress as compress_css + +compress_methods = { + 'application/x-javascript': compress_javascript, + 'text/css': compress_css, + } + +default_compress_method = lambda text: text + +def compress(data, content_type, compress_level): + 'Returns compressed text for a given content type' + method = compress_methods.get(content_type, default_compress_method) + return method(data, compress_level) Added: kukit/kss.concatresource/trunk/kss/concatresource/compression/css.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/compression/css.py Wed May 2 00:45:34 2007 @@ -0,0 +1,18 @@ +'''\ +The css compressor uses the 3rdparty packer module +that is taken from Plone's ResourceRegistries. +''' + +from thirdparty.packer import CSSPacker + +csspacker_safe = CSSPacker('safe') +csspacker_full = CSSPacker('full') + +def compress(data, compress_level): + if compress_level == "safe": + return csspacker_safe.pack(data) + elif compress_level == "full": + return csspacker_full.pack(data) + else: + # none + return data Added: kukit/kss.concatresource/trunk/kss/concatresource/compression/javascript.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/compression/javascript.py Wed May 2 00:45:34 2007 @@ -0,0 +1,17 @@ +'''\ +The javascript compressor uses the 3rdparty packer module +that is taken from Plone's ResourceRegistries.''' + +from thirdparty.packer import JavascriptPacker + +jspacker_safe = JavascriptPacker('safe') +jspacker_full = JavascriptPacker('full') + +def compress(data, compress_level): + if compress_level == "safe": + return jspacker_safe.pack(data) + elif compress_level == "full": + return jspacker_full.pack(data) + else: + # none + return data Added: kukit/kss.concatresource/trunk/kss/concatresource/compression/thirdparty/LICENSE ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/compression/thirdparty/LICENSE Wed May 2 00:45:34 2007 @@ -0,0 +1,25 @@ + +packer.py is released under the MIT license. + +# packer.py +# +# Copyright (c) 2006 Florian Schulze +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + Added: kukit/kss.concatresource/trunk/kss/concatresource/compression/thirdparty/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/compression/thirdparty/__init__.py Wed May 2 00:45:34 2007 @@ -0,0 +1,4 @@ +'''\ +Module init +''' + Added: kukit/kss.concatresource/trunk/kss/concatresource/compression/thirdparty/packer.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/compression/thirdparty/packer.py Wed May 2 00:45:34 2007 @@ -0,0 +1,921 @@ +# +# packer.py +# +# Copyright (c) 2006-2007 Florian Schulze +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +import re, unittest, textwrap + + +class KeywordMapper: + def __init__(self, regexp, encoder): + if isinstance(regexp, (str, unicode)): + self.regexp = re.compile(regexp) + else: + self.regexp = regexp + self.encoder = encoder + self.mapping = {} + + def analyseKeywords(self, input): + matches = self.regexp.findall(input) + + protected = {} + keyword_count = {} + index = 0 + for match in matches: + if match not in keyword_count: + keyword_count[match] = 0 + protected[self.encoder(index)] = index + index = index + 1 + keyword_count[match] = keyword_count[match] + 1 + + for match in matches: + if match in protected and keyword_count[match]: + keyword_count[match] = 0 + + protected = {} + for match in keyword_count: + if not keyword_count[match]: + protected[match] = None + + ## sorted_matches = [(c,len(v),v) for v,c in keyword_count.iteritems()] + # the above line implements the original behaviour, the code below + # removes keywords which have not enough weight to be encoded, in total + # this saves some bytes, because the total length of the generated + # codes is a bit smaller. This needs corresponding code in the + # fast_decode javascript function of the decoder, see comment there + sorted_matches = [] + for value, count in keyword_count.iteritems(): + weight = count * len(value) + if len(value) >= weight: + keyword_count[value] = 0 + sorted_matches.append((0, value)) + else: + sorted_matches.append((weight, value)) + sorted_matches.sort() + sorted_matches.reverse() + sorted_matches = [x[-1] for x in sorted_matches] + + index = 0 + mapping = {} + for match in sorted_matches: + if not keyword_count[match]: + if match not in protected: + mapping[match] = (-1, match) + continue + while 1: + encoded = self.encoder(index) + index = index + 1 + if encoded in protected: + mapping[encoded] = (index-1, encoded) + continue + else: + break + mapping[match] = (index-1, encoded) + + return mapping + + def analyse(self, input): + self.mapping = self.analyseKeywords(input) + + def getKeywords(self): + sorted = zip(self.mapping.itervalues(), self.mapping.iterkeys()) + sorted.sort() + keywords = [] + for (index, encoded), value in sorted: + if index >= 0: + if encoded != value: + keywords.append(value) + else: + keywords.append('') + return keywords + + def sub(self, input): + def repl(m): + return self.mapping.get(m.group(0), ('', m.group(0)))[1] + return self.regexp.sub(repl, input) + + +class JavascriptKeywordMapper(KeywordMapper): + def __init__(self, regexp=None, encoder=None): + if regexp is None: + self.regexp = re.compile(r'\w+') + elif isinstance(regexp, (str, unicode)): + self.regexp = re.compile(regexp) + else: + self.regexp = regexp + if encoder is None: + self.encoder = self._encode + else: + self.encoder = encoder + self.mapping = {} + + def _encode(self, charCode, + mapping="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"): + result = [] + quotient = charCode + while quotient or not len(result): + quotient, remainder = divmod(quotient, 62) + result.append(mapping[remainder]) + result.reverse() + return "".join(result) + + def getDecodeFunction(self, fast=True, name=None): + jspacker = JavascriptPacker('full') + + # fast boot function + fast_decoder = r""" + // does the browser support String.replace where the + // replacement value is a function? + if (!''.replace(/^/, String)) { + // decode all the values we need + // we have to add the dollar prefix, because $encoded can be + // any keyword in the decode function below. For example + // 'constructor' is an attribute of any object and it would + // return a false positive match in that case. + while ($count--) $decode["$"+$encode($count)] = $keywords[$count] || $encode($count); + // global replacement function + $keywords = [function($encoded){$result = $decode["$"+$encoded]; return $result!=undefined?$result:$encoded}]; + // generic match + $encode = function(){return'\\w+'}; + // reset the loop counter - we are now doing a global replace + $count = 1; + };""" + + if name is None: + # boot function + decoder = r""" + function($packed, $ascii, $count, $keywords, $encode, $decode) { + $encode = function($charCode) { + return ($charCode < $ascii ? "" : $encode(parseInt($charCode / $ascii))) + + (($charCode = $charCode % $ascii) > 35 ? String.fromCharCode($charCode + 29) : $charCode.toString(36)); + }; + // fastDecodePlaceholder + while ($count--) + if ($keywords[$count]) + $packed = $packed.replace(new RegExp("\\b" + $encode($count) + "\\b", "g"), $keywords[$count]); + return $packed; + }""" + + if fast: + decoder = decoder.replace('// fastDecodePlaceholder', fast_decoder) + + decoder = jspacker.pack(decoder) + + else: + decoder = r""" + var %s = function($ascii, $count, $keywords, $encode, $decode) { + $encode = function($charCode) { + return ($charCode < $ascii ? "" : $encode(parseInt($charCode / $ascii))) + + (($charCode = $charCode %% $ascii) > 35 ? String.fromCharCode($charCode + 29) : $charCode.toString(36)); + }; + // fastDecodePlaceholder + var decoder = function($packed, $ascii1, $count1, $keywords1, $encode1, $decode1) { + $count1 = $count; + while ($count1--) + if ($keywords[$count1]) + $packed = $packed.replace(new RegExp("\\b" + $encode($count1) + "\\b", "g"), $keywords[$count1]); + return $packed; + }; + return decoder; + }""" % name + + if fast: + decoder = decoder.replace('// fastDecodePlaceholder', fast_decoder) + + decoder = jspacker.pack(decoder) + + keywords = self.getKeywords() + decoder = "%s(62, %i, '%s'.split('|'), 0, {});" % (decoder, len(keywords), "|".join(keywords)) + + return decoder + + def getDecoder(self, input, keyword_var=None, decode_func=None): + if keyword_var is None: + keywords = self.getKeywords() + num_keywords = len(keywords) + keywords = "|".join(keywords) + keywords = "'%s'.split('|')" % keywords + else: + keywords = keyword_var + num_keywords = len(self.getKeywords()) + + if decode_func is None: + decode_func = self.getDecodeFunction() + + escaped_single = input.replace("\\","\\\\").replace("'","\\'").replace('\n','\\n') + escaped_double = input.replace("\\","\\\\").replace('"','\\"').replace('\n','\\n') + if len(escaped_single) < len(escaped_double): + script = "'%s'" % escaped_single + else: + script = '"%s"' % escaped_double + return "eval(%s(%s,62,%i,%s,0,{}))" % (decode_func, script, + num_keywords, + keywords) + + +class Packer: + def __init__(self): + self.patterns = [] + + def copy(self): + result = Packer() + result.patterns = self.patterns[:] + return result + + def _repl(self, match): + # store protected part + self.replacelist.append(match.group(1)) + # return escaped index + return "\x00%i" % len(self.replacelist) + + def pack(self, input): + # list of protected parts + self.replacelist = [] + # escape the escapechar + output = input.replace('\x00','\x00\x00') + for regexp, replacement, keyword_encoder in self.patterns: + if replacement is None: + if keyword_encoder is None: + # protect the matched parts + output = regexp.sub(self._repl, output) + else: + mapper = KeywordMapper(regexp=regexp, + encoder=keyword_encoder) + # get keywords + mapper.analyse(output) + # replace keywords + output = mapper.sub(output) + else: + # substitute + output = regexp.sub(replacement, output) + # restore protected parts + replacelist = list(enumerate(self.replacelist)) + replacelist.reverse() # from back to front, so 1 doesn't break 10 etc. + for index, replacement in replacelist: + # we use lambda in here, so the real string is used and no escaping + # is done on it + before = len(output) + regexp = re.compile('(? n, $$name -> na, $top1 -> t1, $top2 -> t2 + def _dollar_replacement(match): + length = len(match.group(2)) + start = length - max(length - len(match.group(3)), 0) + result = match.group(1)[start:start+length] + match.group(4) + return result + self.sub(r"""((\$+)([a-zA-Z\$_]+))(\d*)\b""", _dollar_replacement) + + self.keywordSub(r"""\b_[A-Za-z\d]\w*""", lambda i: "_%i" % i) + + # protect strings + # this is more correct, but needs more testing + # it has to be more accurate because of the more aggresive packing later + self.protect(r"""(?<=return|..case|.....[=\[|(,?:+])\s*((?P['"])(?:\\(?P=quote)|\\\n|.)*?(?P=quote))""", re.DOTALL) + else: + # protect strings + # these sometimes catch to much, but in safe mode this doesn't hurt + self.protect(r"""('(?:\\'|\\\n|.)*?')""") + self.protect(r'''("(?:\\"|\\\n|.)*?")''') + # protect regular expressions + self.protect(r"""\s+(\/[^\/\n\r\*][^\/\n\r]*\/g?i?)""") + self.protect(r"""([^\w\$\/'"*)\?:]\/[^\/\n\r\*][^\/\n\r]*\/g?i?)""") + # multiline comments + self.sub(r'/\*(?!@).*?\*/', '', re.DOTALL) + # one line comments + self.sub(r'\s*//.*$', '', re.MULTILINE) + # strip whitespace at the beginning and end of each line + self.sub(r'^[ \t\r\f\v]*(.*?)[ \t\r\f\v]*$', r'\1', re.MULTILINE) + # whitespace after some special chars but not + # before function declaration + self.sub(r'([{;\[(,=&|\?:<>%!/])\s+(?!function)', r'\1') + # after an equal sign a function definition is ok + self.sub(r'=\s+(?=function)', r'=') + if level == 'full': + # whitespace after some more special chars + self.sub(r'([};\):,])\s+', r'\1') + # whitespace before some special chars + self.sub(r'\s+([={},&|\?:\.()<>%!/\]])', r'\1') + # whitespace before plus chars if no other plus char before it + self.sub(r'(? b) { + do something + } else { + do something else + }; + }; + next_instr; + """, + """\ + function dummy(a,b){if(a>b){do something} else{do something else}};next_instr;""", + 'safe' + ), + ( + 'nestedCurlyBracketsWithSemicolons', + """\ + function dummy(a, b) { + if (a > b) { + do something + } else { + do something else + }; + }; + next_instr; + """, + """\ + function dummy(a,b){if(a>b){do something}else{do something else}};next_instr;""", + 'full' + ), +) + + +css_safe_compression_tests = ( + ( + 'commentCompression', + """ + /* this is a comment */ + #testElement { + property: value; /* another comment */ + } + /**********/ + /* this is a multi + line comment */ + #testElement { + /* yet another comment */ + property: value; + } + """, + """\ + /* */ + #testElement { + property: value; /* */ + } + /* */ + #testElement { + /* */ + property: value; + } + """ + ), + ( + 'newlineCompression', + """ + + + /* this is a comment */ + + #testElement { + property: value; /* another comment */ + } + + /* this is a multi + line comment */ + #testElement { + + /* yet another comment */ + property: value; + + } + + + """, + """\ + /* */ + #testElement { + property: value; /* */ + } + /* */ + #testElement { + /* */ + property: value; + } + """ + ), + # see http://www.dithered.com/css_filters/index.html + ( + 'commentHacks1', + """ + #testElement { + property/**/: value; + property/* */: value; + property /**/: value; + property: /**/value; + } + """, + """\ + #testElement { + property/**/: value; + property/* */: value; + property /**/: value; + property: /**/value; + } + """ + ), + ( + 'commentHacks2', + """ + selector/* */ { } + """, + """\ + selector/* */ { } + """ + ), + ( + 'commentHacks3', + """ + selector/* foobar */ { } + """, + """\ + selector/* */ { } + """ + ), + ( + 'commentHacks4', + """ + selector/**/ { } + """, + """\ + selector/**/ { } + """ + ), + ( + 'commentHacks5', + """ + /* \*/ + rules + /* */ + """, + """\ + /* \*/ + rules + /* */ + """ + ), + ( + 'commentHacks6', + """ + /* foobar \*/ + rules + /* */ + """, + """\ + /* \*/ + rules + /* */ + """ + ), + ( + 'commentHacks7', + """ + /*/*/ + rules + /* */ + """, + """\ + /*/*/ + rules + /* */ + """ + ), + ( + 'commentHacks8', + """ + /*/*//*/ + rules + /* */ + """, + """\ + /*/*//*/ + rules + /* */ + """ + ), + ( + 'stringProtection', + """ + /* test string protection */ + #selector, + #another { + content: 'foo; bar'; + } + """, + """\ + /* */ + #selector, + #another { + content: 'foo; bar'; + } + """ + ), +) + +css_full_compression_tests = ( + ( + 'commentCompression', + """ + /* this is a comment */ + #testElement { + property: value; /* another comment */ + } + /**********/ + /* this is a multi + line comment */ + #testElement { + /* yet another comment */ + property: value; + } + """, + """\ + #testElement{property:value;} + #testElement{property:value;} + """ + ), + ( + 'newlineCompression', + """ + + + /* this is a comment */ + + #testElement { + property: value; /* another comment */ + } + + /* this is a multi + line comment */ + #testElement { + + /* yet another comment */ + property: value; + + } + + + """, + """\ + #testElement{property:value;} + #testElement{property:value;} + """ + ), + # see http://www.dithered.com/css_filters/index.html + # in full compression all hacks get removed + ( + 'commentHacks1', + """ + #testElement { + property/**/: value; + property/* */: value; + property /**/: value; + property: /**/value; + } + """, + """\ + #testElement{property:value;property:value;property:value;property:value;} + """ + ), + ( + 'commentHacks2', + """ + selector/* */ { } + """, + """\ + selector{} + """ + ), + ( + 'commentHacks3', + """ + selector/* foobar */ { } + """, + """\ + selector{} + """ + ), + ( + 'commentHacks4', + """ + selector/**/ { } + """, + """\ + selector{} + """ + ), + ( + 'commentHacks5', + """ + /* \*/ + rules + /* */ + """, + """\ + rules + """ + ), + ( + 'commentHacks6', + """ + /* foobar \*/ + rules + /* */ + """, + """\ + rules + """ + ), + ( + 'commentHacks7', + """ + /*/*/ + rules + /* */ + """, + """\ + rules + """ + ), + ( + 'commentHacks8', + """ + /*/*//*/ + rules + /* */ + """, + """\ + rules + """ + ), + ( + 'stringProtection', + """ + /* test string protection and full compression */ + #selector, + #another { + content: 'foo; bar'; + } + """, + """\ + #selector,#another{content:'foo; bar';} + """ + ), +) + +class PackerTestCase(unittest.TestCase): + def __init__(self, name, input, output, packer): + unittest.TestCase.__init__(self) + self.name = name + self.input = input + self.output = output + self.packer = packer + + def __str__(self): + return self.name + + def runTest(self): + self.assertEqual(self.packer.pack(self.input), self.output) + + +def test_suite(): + suite = unittest.TestSuite() + + jspacker = { + 'safe': JavascriptPacker('safe'), + 'full': JavascriptPacker('full'), + } + csspacker = { + 'safe': CSSPacker('safe'), + 'full': CSSPacker('full'), + } + + for info in js_compression_tests: + name = info[0] + input = textwrap.dedent(info[1]) + output = textwrap.dedent(info[2]) + if (len(info) == 4): + compression = info[3].split(",") + else: + compression = ("safe", "full") + + for packer in compression: + suite.addTest(PackerTestCase("%s (%s)" % (name, packer), + input, output, + jspacker[packer])) + + packer = "safe" + for name, input, output in css_safe_compression_tests: + input = textwrap.dedent(input) + output = textwrap.dedent(output) + + suite.addTest(PackerTestCase("%s (%s)" % (name, packer), + input, output, + csspacker[packer])) + + packer = "full" + for name, input, output in css_full_compression_tests: + input = textwrap.dedent(input) + output = textwrap.dedent(output) + + suite.addTest(PackerTestCase("%s (%s)" % (name, packer), + input, output, + csspacker[packer])) + + return suite + +if __name__ == '__main__': + unittest.main(defaultTest='test_suite') Added: kukit/kss.concatresource/trunk/kss/concatresource/concatfileresource.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/concatfileresource.py Wed May 2 00:45:34 2007 @@ -0,0 +1,101 @@ +'''\ + +Support for concatenation and compression of resources + +We concatenate first and compress afterwards, giving a better +chance for the compressor to optimize +''' + +from zope.interface import implements +from interfaces import IContextFile +# we are aliased to Products, hence the following absolute import +from concatresource.interfaces import IConcatResourceAddon +from fileresource import File +from compression import compress +import time +import zope.component +try: + from zope.component.interfaces import ComponentLookupError +except ImportError: + # Zope < 2.10 + from zope.component.exceptions import ComponentLookupError + +class ConcatFiles(object): + '''A resource that concatenates files and compresses the result + + It is also possible to extend the statically given list via + a utility. + ''' + implements(IContextFile) + + def __init__(self, pathlist, name, compress_level, caching, lmt_check_period): + # Path is now a list. + assert isinstance(pathlist, (list, tuple)) + # check all files, just to raise error if don't exist + for path in pathlist: + file(path, 'rb').close() + # + self.pathlist_base = pathlist + self.__name__ = name + self.compress_level = compress_level + self.caching = caching + self.lmt_check_period = lmt_check_period + # markers for pathlist modification + self.pathlist = [] + self.fileslist_changed = None + self.fileslist = [] + + def getPathList(self): + 'Gets the extended pathlist' + # we allow the list to be extended via an utility + try: + registry = zope.component.getUtility(IConcatResourceAddon, self.__name__) + except ComponentLookupError: + extend = [] + else: + extend = registry.getAddonFiles() + pathlist = self.pathlist_base + extend + return pathlist + + def getFilesList(self): + 'Gets the list of files' + ## # XXX We have two choices: + ## # 1. We only calculate the list once, on startup + ## # that is, we suppose that the file resource is + ## # called up after the extension reg has been finished + ## # and that it never changes later. + ## # 2. but it also could be like this to allow changes later: + pathlist = self.getPathList() + if pathlist != self.pathlist: + ##if not self.pathlist: + ##pathlist = self.getPathList() + # mark pathlist modification + self.pathlist = pathlist + self.fileslist_changed = time.time() + fileslist = self.fileslist = [File(path, self.__name__) for path in pathlist] + else: + fileslist = self.fileslist + return fileslist + + def getLastMod(self): + # We take in consideration that the pathlist + # itself could have changed too. + return max([f.getLastMod() for f in self.getFilesList()] + + [self.fileslist_changed]) + + def getContents(self): + fileslist = self.getFilesList() + assert fileslist, 'Must contain at least one resource.' + result = fileslist[0].getContents() + content_type = result['content_type'] + data = [result['data']] + for subres in fileslist[1:]: + d = subres.getContents() + # all elements must have the same content type. + assert d['content_type'] == content_type + data.append(d['data']) + result['data'] = '\n'.join(data) + result['compress_level'] = self.compress_level + # Do compression on the result + result['data'] = compress(**result) + return result Added: kukit/kss.concatresource/trunk/kss/concatresource/concatresource-configure.zcml ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/concatresource-configure.zcml Wed May 2 00:45:34 2007 @@ -0,0 +1 @@ + Added: kukit/kss.concatresource/trunk/kss/concatresource/concatresource-meta.zcml ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/concatresource-meta.zcml Wed May 2 00:45:34 2007 @@ -0,0 +1,2 @@ + + \ No newline at end of file Added: kukit/kss.concatresource/trunk/kss/concatresource/configure.zcml ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/configure.zcml Wed May 2 00:45:34 2007 @@ -0,0 +1,12 @@ + + + + + + + + Added: kukit/kss.concatresource/trunk/kss/concatresource/directives.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/directives.py Wed May 2 00:45:34 2007 @@ -0,0 +1,62 @@ +from zope.interface import Interface +from zope.configuration.fields import GlobalObject, Tokens, Path, \ + PythonIdentifier, MessageID +from zope.schema import TextLine, Text, Id, Choice, Float +from fields import PathList +from zope.app.component.metadirectives import IBasicViewInformation +from zope.app.publisher.browser.metadirectives import IBasicResourceInformation + +try: + from zope.security.zcml import Permission +except ImportError: + # Zope < 2.10 + from zope.app.security.fields import Permission + + +class IConcatResourceDirective(IBasicResourceInformation): + """ + Defines a concatenated browser resource + """ + + name = TextLine( + title=u"The name of the resource", + description=u""" + This is the name used in resource urls. Resource urls are of + the form site/@@/resourcename, where site is the url of + "site", a folder with a service manager. + + We make resource urls site-relative (as opposed to + content-relative) so as not to defeat caches.""", + required=True + ) + + files = PathList( + title=u"Files", + description=u"A space separated list of resource files", + required=True + ) + + compress_level = Choice( + title=u"Compress level", + description=u"Level of compression applied, by default 'safe'.", + values=(u'none', u'safe', u'full'), + required=False, + ) + + caching = Choice( + title=u"Caching strategy", + description=u"Enables caching in memory for faster debugging, by default not enabled.", + values=(u'default', u'memory'), + required=False, + ) + + lmt_check_period = Float( + title=u"Last modification time checking", + description=u"""Sets a grace period in seconds, until which the last modification times + are never fetched again from the filesystem. In other words, the system will + react after this time for recent changes. For debugging, it is best + to set this to 0, for production it can be left to the default 60.0""", + required=False, + ) + + Added: kukit/kss.concatresource/trunk/kss/concatresource/fields.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/fields.py Wed May 2 00:45:34 2007 @@ -0,0 +1,19 @@ + +from zope.schema import Text +from zope.schema.interfaces import IFromUnicode +from zope.interface import implements +import os.path + +class PathList(Text): + + implements(IFromUnicode) + + def fromUnicode(self, u): + result = [] + for u in u.split(): + if os.path.isabs(u): + path = os.path.normpath(u) + else: + path = self.context.path(u) + result.append(path) + return result Added: kukit/kss.concatresource/trunk/kss/concatresource/fileresource.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/fileresource.py Wed May 2 00:45:34 2007 @@ -0,0 +1,48 @@ +'''\ +this is a fixture of zope app's fileresource + +It correctly handles cache expiration headers and rereads +files when needed only. +''' + +from zope.interface import implements +try: + from zope.contenttype import guess_content_type +except ImportError: # BBB: Zope < 2.10 + try: + # XXX ??? What zope version needs this? + from zope.app.contenttypes import guess_content_type + except ImportError: + from zope.app.content_types import guess_content_type + +import os +from interfaces import IContextFile + +class File(object): + implements(IContextFile) + + def __init__(self, path, name): + self.path = path + self.__name__ = name + + def getLastMod(self): + return os.path.getmtime(self.path) + + def getContents(self): + ##print "***** READ", self.path + f = open(self.path, 'rb') + data = f.read() + f.close() + content_type, enc = guess_content_type(self.path, data) + return dict(data = data, content_type = content_type) + +class Image(File): + """Image objects stored in external files.""" + + def getContents(self): + d = super(Image, self).getContens() + if d ['content_type'] in (None, 'application/octet-stream'): + ext = os.path.splitext(self.path)[1] + if ext: + d['content_type'] = 'image/%s' % ext[1:] + return d Added: kukit/kss.concatresource/trunk/kss/concatresource/interfaces.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/interfaces.py Wed May 2 00:45:34 2007 @@ -0,0 +1,41 @@ + +from zope.interface import Interface +from zope.schema import Bytes, TextLine, Float + +class IContextFile(Interface): + + def getLastMod(self): + 'Returns last modification time of the file' + + def getContents(): + 'Reads the data and content type of the file' + +class ICachedResource(Interface): + + data = Bytes(title = u'The content data of the file') + + content_type = TextLine(title = u'The mime content type of the file') + + lmt = Float(title = u'Last modification timestamp') + + lmh = Float(title = u'Last modification in human readable form') + + def purgeData(self): + 'Purges the cached data' + +class IConcatResourceAddon(Interface): + '''Utility to register addons + + This can be used to dynamically extend components for a given resource. + We don't provide implementation for this here, but other + components can implement this to provide dynamic add-ons. + + The name of the utility should be the name of the resource. + ''' + + def getAddonFiles(request): + '''Returns a list of addon files. + This will be concatenated to the end of the static list. + ''' + + Added: kukit/kss.concatresource/trunk/kss/concatresource/meta.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/meta.py Wed May 2 00:45:34 2007 @@ -0,0 +1,113 @@ + +import os +from zope.security.checker import CheckerPublic, NamesChecker +from zope.configuration.exceptions import ConfigurationError +from zope.publisher.interfaces.browser import IBrowserRequest +from zope.app.component.metaconfigure import handler +from zope.interface import Interface +from resource import ConcatResourceFactory + +try: + import Products.Five +except ImportError: + __five__ = False +else: + __five__ = True + from Products.Five.metaclass import makeClass + from Products.Five.security import getSecurityInfo, protectClass, protectName,\ + initializeClass + +try: + from zope.publisher.interfaces.browser import IDefaultBrowserLayer + _layer = IDefaultBrowserLayer + __pre_3_2__ = False +except ImportError: + from zope.app.servicenames import Presentation + _layer = 'default' + __pre_3_2__ = True + +try: + from zope.component import zcml + __pre_3_3__ = False +except: + __pre_3_3__ = True + +# z3 only +allowed_names = ('GET', 'HEAD', 'publishTraverse', 'browserDefault', + 'request', '__call__') + +# We keep this in order to allow an occasional merge to browser:resource +_factory_map = { + 'files': { + 'prefix': 'ConcatResource', + 'count': 0, + 'factory': ConcatResourceFactory + }, + } + +def concatresource(_context, name, files=None, compress_level='safe', + caching='default', lmt_check_period=60.0, + layer=_layer, permission='zope.Public'): + + if not files: + raise ConfigurationError( + "Must use a files" + " attribute for concatresource directives, with at least" + " one file contained." + ) + + res = files + res_type = 'files' + factory_info = _factory_map.get(res_type) + factory_info['count'] += 1 + res_factory = factory_info['factory'] + + if __five__: + checker = None + _class_name = '%s%s' % (factory_info['prefix'], factory_info['count']) + new_class = makeClass(_class_name, (res_factory.resource,), {}) + + _context.action( + discriminator = ('five:protectClass', new_class), + callable = protectClass, + args = (new_class, permission) + ) + _context.action( + discriminator = ('five:initialize:class', new_class), + callable = initializeClass, + args = (new_class,) + ) + + else: + new_class = res_factory.resource + + if permission == 'zope.Public': + permission = CheckerPublic + + checker = NamesChecker(allowed_names, permission) + + factory = res_factory(res, name, compress_level, caching, lmt_check_period, + resource_factory=new_class, checker=checker) + + if __pre_3_2__: + _context.action( + discriminator = ('resource', name, IBrowserRequest, layer), + callable = handler, + args = (Presentation, 'provideResource', + name, IBrowserRequest, factory, layer), + ) + else: + if __pre_3_3__: + _context.action( + discriminator = ('resource', name, IBrowserRequest, layer), + callable = handler, + args = ('provideAdapter', + (layer,), Interface, name, factory, _context.info), + ) + else: + _context.action( + discriminator = ('resource', name, IBrowserRequest, layer), + callable = handler, + args = ('registerAdapter', + factory, (layer,), Interface, name, _context.info), + ) Added: kukit/kss.concatresource/trunk/kss/concatresource/meta.zcml ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/meta.zcml Wed May 2 00:45:34 2007 @@ -0,0 +1,15 @@ + + + + + + + + + Added: kukit/kss.concatresource/trunk/kss/concatresource/resource.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/resource.py Wed May 2 00:45:34 2007 @@ -0,0 +1,155 @@ +from zope.publisher.interfaces.browser import IBrowserPublisher +from zope.interface import implements +from concatfileresource import ConcatFiles +from interfaces import ICachedResource +import cachingadapter # force adapter registration + +try: + from zope.publisher.browser import BrowserView + from zope.datetime import time as timeFromDateTimeString +except ImportError: + # Zope < 2.10 + from zope.app.publisher.browser import BrowserView + from zope.app.datetimeutils import time as timeFromDateTimeString + +try: + import Products.Five +except ImportError: + __five__ = False + from zope.app.publisher.browser.resource import Resource +else: + __five__ = True + try: + # Zope 2.8 / Five 1.0.2 + from Products.Five.resource import Resource + __five_pre_1_3_ = True + except ImportError: + # Zope 2.9 / Five 1.3 + from Products.Five.browser.resource import Resource + __five_pre_1_3__ = False + +class GenericResource(BrowserView, Resource): + """A publishable resource""" + + if __five__: + #implements(IBrowserPublisher) + + def __browser_default__(self, request): + return self, (request.REQUEST_METHOD,) + + else: + implements(IBrowserPublisher) + + def publishTraverse(self, request, name): + '''See interface IBrowserPublisher''' + raise LookupError(name) + + def browserDefault(self, request): + '''See interface IBrowserPublisher''' + return getattr(self, request.method), () + + # for unit tests + def _testData(self): + return self.context.data + + def chooseContext(self): + """Choose the appropriate context""" + return self.context + + def GET(self): + """Default document""" + + file = self.chooseContext() + request = self.request + response = request.response + + # Control in-memory caching + cache_in_memory = file.caching == 'memory' + if cache_in_memory: + last_mod = file.lmt + if last_mod > file.data_last_fetched: + # force delete file contents + file.purgeData() + + # HTTP If-Modified-Since header handling. This is duplicated + # from OFS.Image.Image - it really should be consolidated + # somewhere... + if __five__: + header = request.get_header('If-Modified-Since') + else: + header = request.getHeader('If-Modified-Since', None) + if header is not None: + header = header.split(';')[0] + # Some proxies seem to send invalid date strings for this + # header. If the date string is not valid, we ignore it + # rather than raise an error to be generally consistent + # with common servers such as Apache (which can usually + # understand the screwy date string as a lucky side effect + # of the way they parse it). + try: mod_since=long(timeFromDateTimeString(header)) + except: mod_since=None + if mod_since is not None: + if not cache_in_memory: + last_mod = file.lmt + if last_mod > 0 and int(last_mod) <= mod_since: + response.setStatus(304) + return '' + + response.setHeader('Content-Type', file.content_type) + response.setHeader('Last-Modified', file.lmh) + # Cache for one day + response.setHeader('Cache-Control', 'public,max-age=86400') + data = file.data + + if not cache_in_memory: + # force delete file contents + file.purgeData() + + return data + + def HEAD(self): + file = self.chooseContext() + response = self.request.response + response.setHeader('Content-Type', file.content_type) + response.setHeader('Last-Modified', file.lmh) + # Cache for one day + response.setHeader('Cache-Control', 'public,max-age=86400') + return '' + +class ResourceFactory(object): + + factory = None + resource = None + + def __init__(self, path, name, compress_level, caching, lmt_check_period, + resource_factory=None, checker=None): + self.__name = name + self.__path = path + self.__compress_level = compress_level + self.__caching = caching + self.__lmt_check_period = lmt_check_period + if resource_factory is not None: + self.resource = resource_factory + # z3 only + self.__checker = checker + + def __call__(self, request): + try: + rsrc = self.__rsrc + except AttributeError: + # Delayed creation. That assures that registry is set up by this time. + rsrc = self.__rsrc = ICachedResource(self.factory(self.__path, self.__name, + self.__compress_level, self.__caching, self.__lmt_check_period)) + resource = self.resource(rsrc, request) + # z3 only + resource.__name__ = self.__name + if self.__checker is not None: + # z3 only + resource.__Security_checker__ = self.__checker + return resource + +class ConcatResourceFactory(ResourceFactory): + """A factory for concat resources""" + + factory = ConcatFiles + resource = GenericResource Added: kukit/kss.concatresource/trunk/kss/concatresource/test/README ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/test/README Wed May 2 00:45:34 2007 @@ -0,0 +1,5 @@ + +I yet have to add tests that work transparently with zope3 and five. + +Till then, include the configure.zmcl in this directory from the root. + Added: kukit/kss.concatresource/trunk/kss/concatresource/test/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/test/__init__.py Wed May 2 00:45:34 2007 @@ -0,0 +1,4 @@ +'''\ +Module init +''' + Added: kukit/kss.concatresource/trunk/kss/concatresource/test/configure.zcml ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/test/configure.zcml Wed May 2 00:45:34 2007 @@ -0,0 +1,18 @@ + + + + + + + Added: kukit/kss.concatresource/trunk/kss/concatresource/test/test1.js ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/test/test1.js Wed May 2 00:45:34 2007 @@ -0,0 +1,13 @@ + +_PythonKw = function(kw) { + this.kw = kw; + } + +_PythonKw.prototype.toJSON = function() { + var pack = {"pythonKwMaRkEr": this.kw}; + return toJSON(pack); + } + +function PythonKw(kw) { + return new _PythonKw(kw); + } Added: kukit/kss.concatresource/trunk/kss/concatresource/test/test2.js ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/test/test2.js Wed May 2 00:45:34 2007 @@ -0,0 +1,10 @@ +/* A 2nd js file */ + +/* +* +* +* +*/ + +var someContents = "Some content here, too."; +var someMoreContents = "Some more content."; From reebalazs at codespeak.net Wed May 2 00:53:59 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 00:53:59 +0200 (CEST) Subject: [KSS-checkins] r42569 - kukit/kss.concatresource/trunk/kss/concatresource Message-ID: <20070501225359.5488C807F@code0.codespeak.net> Author: reebalazs Date: Wed May 2 00:53:58 2007 New Revision: 42569 Added: kukit/kss.concatresource/trunk/kss/concatresource/kss.concatresource-configure.zcml - copied, changed from r42568, kukit/kss.concatresource/trunk/kss/concatresource/concatresource-configure.zcml kukit/kss.concatresource/trunk/kss/concatresource/kss.concatresource-meta.zcml - copied, changed from r42568, kukit/kss.concatresource/trunk/kss/concatresource/concatresource-meta.zcml kukit/kss.concatresource/trunk/kss/concatresource/version.txt Removed: kukit/kss.concatresource/trunk/kss/concatresource/README kukit/kss.concatresource/trunk/kss/concatresource/concatresource-configure.zcml kukit/kss.concatresource/trunk/kss/concatresource/concatresource-meta.zcml Log: Make package egg conform Deleted: /kukit/kss.concatresource/trunk/kss/concatresource/README ============================================================================== --- /kukit/kss.concatresource/trunk/kss/concatresource/README Wed May 2 00:53:58 2007 +++ (empty file) @@ -1,137 +0,0 @@ - -Objectives ----------- - -I made this utility for the works in the jsonserver integration and -AZAX/kukit. This was meant to be a temporary, lightweight solution but it -has long term merits too. I needed this because I wanted a solution that -works right now, works on zope3 and zope 2.8 even (so zc.resourcelibraries -was not a choice), does not depend on Plone (so ResourceRegistries is out -too). - -The interesting point of the utility is: instead of building registries to -emit include tags in the HTML, it simply makes one resource that needs to -be imported in a single line:: - - - -Also: - -- it compresses the JS or CSS files with Florian Schulze's compressor - from ResourceRegistries - -- it contains an utility interface that another component can implement - to dynamically extend the list of files (like I did with AZAX). So the - "registry" is not really implemented but can be plugged in. - -- it is tested (although not much) to work with Zope 2.8, 2.9, 3.1, 3.2 - -Meanwhile I implemented the cache headers for the resources correctly -here, the current implementation of caching is broken in Five and I -believe in Z3 resources as well; beware that I considered the original -Zope3 code only and did not look at additional utilities. According to my -observation: in Z3 the original resources attempt to handle the cache -headers correctly but never really check if the file gets changed on the -filesystem (only on restart). If this is really a problem and not just I -believe, then it is fixed in my code. (Read more in the Caching part.) - -More information on this issue: - -http://article.gmane.org/gmane.comp.web.zope.z3base.general/53 - -Compression ------------ - -You can use more levels of compressions with the compress_level attribute. - - - -Some explanation: - -- compression is only implemented for JavaScript and CSS - -- The default level is "safe", this is useable with all scripts - -- The "full" level gives even better compression by taking out all newlines - and mangling private variable names, but some preparation must be made - in the scripts for that (like putting a ; after }-s I think, and - also maybe more). - -- Specifying "none" will leave your resource uncompressed. This - can be useful for debugging. - -Caching control ---------------- - -You have some possibility to control how caching of resources are done. - - - -The attribute "lmt_checking_period" controls how often the file -modification dates are checked from the filesystem. By default this is -60.0, this means that once the file modification is checked, it will not be -checked before the next 60 seconds elapses. In other words, if you change -the files on the filesystem, it will cause a maximum of this long delay -until the changes propagate to the rendered resources. For debugging this -can be set to 0 to allow immediate changes, however in production this -setup would cause the files often looked up in the filesystem, which, -especially with badly implemented filesystems can cause a problem. This -feature is already an enhancement to the original Zope 3 resource -implementation where, unless running in debug mode, changes in the resource -files will require a restart to become visible in the result. - -The attribute "caching", when set to "memory", will result that the cooked -resource will be cached in memory and looked up from them as long as the -files are unchanged. This, especially with compress options, can cause a -speedup in rendering the resources. However, in normal operation this is -not necessary at all, since if caching is set up properly, the browser and -the upstream cache asks via the "If-Modified-Since" headers if the resource -has been changed recently, and the resource itself is queried only when -needed, independently of the setup of this option. While debugging, -however, when browser caching is forced to switch off, without this option -the resource would be cooked each time the browser reloads the dependent -page, so in this case setting "caching" to "memory" causes a significant -speedup in these cases. In production however, is not only unnecessary but -also causes an additional memory consumption. - -Debug setup ------------ - -To summarize with an example, the following settings are advisable while -debugging: - - - -Release notes -------------- - -In Zope 2.9.2 there is Five 1.3.3 included. This contains a bug that -the resources will never be looked up from the -application root. - -To fix this, you need to update Five to version 1.3.5, or update Zope -to version >= 2.9.3. - - Deleted: /kukit/kss.concatresource/trunk/kss/concatresource/concatresource-configure.zcml ============================================================================== --- /kukit/kss.concatresource/trunk/kss/concatresource/concatresource-configure.zcml Wed May 2 00:53:58 2007 +++ (empty file) @@ -1 +0,0 @@ - Deleted: /kukit/kss.concatresource/trunk/kss/concatresource/concatresource-meta.zcml ============================================================================== --- /kukit/kss.concatresource/trunk/kss/concatresource/concatresource-meta.zcml Wed May 2 00:53:58 2007 +++ (empty file) @@ -1,2 +0,0 @@ - - \ No newline at end of file Copied: kukit/kss.concatresource/trunk/kss/concatresource/kss.concatresource-configure.zcml (from r42568, kukit/kss.concatresource/trunk/kss/concatresource/concatresource-configure.zcml) ============================================================================== --- kukit/kss.concatresource/trunk/kss/concatresource/concatresource-configure.zcml (original) +++ kukit/kss.concatresource/trunk/kss/concatresource/kss.concatresource-configure.zcml Wed May 2 00:53:58 2007 @@ -1 +1 @@ - + Copied: kukit/kss.concatresource/trunk/kss/concatresource/kss.concatresource-meta.zcml (from r42568, kukit/kss.concatresource/trunk/kss/concatresource/concatresource-meta.zcml) ============================================================================== --- kukit/kss.concatresource/trunk/kss/concatresource/concatresource-meta.zcml (original) +++ kukit/kss.concatresource/trunk/kss/concatresource/kss.concatresource-meta.zcml Wed May 2 00:53:58 2007 @@ -1,2 +1 @@ - - \ No newline at end of file + Added: kukit/kss.concatresource/trunk/kss/concatresource/version.txt ============================================================================== --- (empty file) +++ kukit/kss.concatresource/trunk/kss/concatresource/version.txt Wed May 2 00:53:58 2007 @@ -0,0 +1 @@ +1.2dev Unreleased From nouri at codespeak.net Wed May 2 16:12:08 2007 From: nouri at codespeak.net (nouri at codespeak.net) Date: Wed, 2 May 2007 16:12:08 +0200 (CEST) Subject: [KSS-checkins] r42578 - in kukit/kss.core/trunk/kss/core: . pluginregistry Message-ID: <20070502141208.6A438807F@code0.codespeak.net> Author: nouri Date: Wed May 2 16:12:07 2007 New Revision: 42578 Modified: kukit/kss.core/trunk/kss/core/BeautifulSoup.py kukit/kss.core/trunk/kss/core/pluginregistry/selector_type.py Log: Fix NameErrors Modified: kukit/kss.core/trunk/kss/core/BeautifulSoup.py ============================================================================== --- kukit/kss.core/trunk/kss/core/BeautifulSoup.py (original) +++ kukit/kss.core/trunk/kss/core/BeautifulSoup.py Wed May 2 16:12:07 2007 @@ -857,7 +857,7 @@ """Convenience method that works with all 2.x versions of Python to determine whether or not something is stringlike.""" try: - return isinstance(s, unicode) or isintance(s, basestring) + return isinstance(s, unicode) or isinstance(s, basestring) except NameError: return isinstance(s, str) Modified: kukit/kss.core/trunk/kss/core/pluginregistry/selector_type.py ============================================================================== --- kukit/kss.core/trunk/kss/core/pluginregistry/selector_type.py (original) +++ kukit/kss.core/trunk/kss/core/pluginregistry/selector_type.py Wed May 2 16:12:07 2007 @@ -1,5 +1,6 @@ from plugin import AzaxPlugin +from plugin import AzaxPluginError from interfaces import ISelectorType import zope.component as capi from zope.interface import implements From reebalazs at codespeak.net Wed May 2 18:17:12 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 18:17:12 +0200 (CEST) Subject: [KSS-checkins] r42579 - kukit/kss.concatresource/trunk/docs Message-ID: <20070502161712.C4035807F@code0.codespeak.net> Author: reebalazs Date: Wed May 2 18:17:06 2007 New Revision: 42579 Added: kukit/kss.concatresource/trunk/docs/README.txt - copied unchanged from r42568, kukit/kss.concatresource/trunk/kss/concatresource/README Log: Add back the readme From reebalazs at codespeak.net Wed May 2 18:20:28 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 18:20:28 +0200 (CEST) Subject: [KSS-checkins] r42580 - kukit/kss.core/branch/ree-stripout-comments Message-ID: <20070502162028.640408080@code0.codespeak.net> Author: reebalazs Date: Wed May 2 18:20:28 2007 New Revision: 42580 Added: kukit/kss.core/branch/ree-stripout-comments/ - copied from r42579, kukit/kss.core/branch/performance_improvement/ Log: Branch off From reebalazs at codespeak.net Wed May 2 18:21:47 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 18:21:47 +0200 (CEST) Subject: [KSS-checkins] r42581 - kukit/kukit.js/branch/ree-stripout-comments Message-ID: <20070502162147.27687807F@code0.codespeak.net> Author: reebalazs Date: Wed May 2 18:21:46 2007 New Revision: 42581 Added: kukit/kukit.js/branch/ree-stripout-comments/ - copied from r42580, kukit/kukit.js/branch/performance_improvement/ Log: Branch off From reebalazs at codespeak.net Wed May 2 18:24:02 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 18:24:02 +0200 (CEST) Subject: [KSS-checkins] r42582 - kukit/kss.concatresource/branch/ree-stripout-comments Message-ID: <20070502162402.C798A807F@code0.codespeak.net> Author: reebalazs Date: Wed May 2 18:24:02 2007 New Revision: 42582 Added: kukit/kss.concatresource/branch/ree-stripout-comments/ - copied from r42581, kukit/kss.concatresource/trunk/ Log: Branch off From reebalazs at codespeak.net Wed May 2 18:33:33 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 18:33:33 +0200 (CEST) Subject: [KSS-checkins] r42583 - in kukit/kss.core/branch/ree-stripout-comments/kss/core: . pluginregistry Message-ID: <20070502163333.BAE778076@code0.codespeak.net> Author: reebalazs Date: Wed May 2 18:33:33 2007 New Revision: 42583 Modified: kukit/kss.core/branch/ree-stripout-comments/kss/core/ (props changed) kukit/kss.core/branch/ree-stripout-comments/kss/core/EXTERNALS.TXT kukit/kss.core/branch/ree-stripout-comments/kss/core/pluginregistry/ (props changed) kukit/kss.core/branch/ree-stripout-comments/kss/core/pluginregistry/EXTERNALS.TXT Log: Set externals for the new branch Modified: kukit/kss.core/branch/ree-stripout-comments/kss/core/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/branch/ree-stripout-comments/kss/core/EXTERNALS.TXT (original) +++ kukit/kss.core/branch/ree-stripout-comments/kss/core/EXTERNALS.TXT Wed May 2 18:33:33 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/performance_improvement +kukit http://codespeak.net/svn/kukit/kukit.js/branch/ree-stripout-comments Modified: kukit/kss.core/branch/ree-stripout-comments/kss/core/pluginregistry/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/branch/ree-stripout-comments/kss/core/pluginregistry/EXTERNALS.TXT (original) +++ kukit/kss.core/branch/ree-stripout-comments/kss/core/pluginregistry/EXTERNALS.TXT Wed May 2 18:33:33 2007 @@ -7,4 +7,4 @@ # # concatresource is now included like as batteries -_concatresource http://codespeak.net/svn/z3/jsonserver/branch/merge/concatresource +_concatresource https://codespeak.net/svn/kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource From reebalazs at codespeak.net Wed May 2 19:20:31 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 2 May 2007 19:20:31 +0200 (CEST) Subject: [KSS-checkins] r42587 - in kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource: . compression Message-ID: <20070502172031.550548081@code0.codespeak.net> Author: reebalazs Date: Wed May 2 19:20:30 2007 New Revision: 42587 Modified: kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression/javascript.py kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/directives.py Log: Added stripped, devel, safe-devel, full-devel directives. The standard compressions changed to come with ;;; stripout. Modified: kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression/javascript.py ============================================================================== --- kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression/javascript.py (original) +++ kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression/javascript.py Wed May 2 19:20:30 2007 @@ -7,11 +7,41 @@ jspacker_safe = JavascriptPacker('safe') jspacker_full = JavascriptPacker('full') +def stripout_comments(data): + 'Strips out ;;; lines from the data.' + result = [] + for line in data.splitlines(True): + if not line.lstrip().startswith(';;;'): + result.append(line) + return ''.join(result) + +def remove_markers(data): + 'Removes the ;;; markers but leaves the lines.' + result = [] + for line in data.splitlines(True): + if line.lstrip().startswith(';;;'): + line = line.lstrip()[3:] + result.append(line) + return ''.join(result) + def compress(data, compress_level): - if compress_level == "safe": + if compress_level == "devel": + return remove_markers(data) + elif compress_level == "stripped": + return stripout_comments(data) + elif compress_level == "safe": + data = stripout_comments(data) return jspacker_safe.pack(data) elif compress_level == "full": + data = stripout_comments(data) + return jspacker_full.pack(data) + elif compress_level == "safe-devel": + date = remove_markers(data) + return jspacker_safe.pack(data) + elif compress_level == "full-devel": + date = remove_markers(data) return jspacker_full.pack(data) else: # none + ##date = remove_markers(data) return data Modified: kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/directives.py ============================================================================== --- kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/directives.py (original) +++ kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/directives.py Wed May 2 19:20:30 2007 @@ -39,7 +39,7 @@ compress_level = Choice( title=u"Compress level", description=u"Level of compression applied, by default 'safe'.", - values=(u'none', u'safe', u'full'), + values=(u'none', u'safe', u'full', u'stripped', u'devel', u'safe-devel', u'full-devel'), required=False, ) From reebalazs at codespeak.net Thu May 3 08:18:25 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 3 May 2007 08:18:25 +0200 (CEST) Subject: [KSS-checkins] r42602 - kukit/kss.core/trunk/kss/core/pluginregistry Message-ID: <20070503061825.811E4807C@code0.codespeak.net> Author: reebalazs Date: Thu May 3 08:18:24 2007 New Revision: 42602 Modified: kukit/kss.core/trunk/kss/core/pluginregistry/ (props changed) kukit/kss.core/trunk/kss/core/pluginregistry/EXTERNALS.TXT Log: Switch to kss.concatresource trunk in externals Modified: kukit/kss.core/trunk/kss/core/pluginregistry/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/trunk/kss/core/pluginregistry/EXTERNALS.TXT (original) +++ kukit/kss.core/trunk/kss/core/pluginregistry/EXTERNALS.TXT Thu May 3 08:18:24 2007 @@ -7,4 +7,4 @@ # # concatresource is now included like as batteries -_concatresource http://codespeak.net/svn/z3/jsonserver/branch/merge/concatresource +_concatresource https://codespeak.net/svn/kukit/kss.concatresource/trunk/kss/concatresource From reebalazs at codespeak.net Thu May 3 08:21:30 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 3 May 2007 08:21:30 +0200 (CEST) Subject: [KSS-checkins] r42603 - kukit/kss.core/branch/performance_improvement/kss/core/pluginregistry Message-ID: <20070503062130.22763807C@code0.codespeak.net> Author: reebalazs Date: Thu May 3 08:21:29 2007 New Revision: 42603 Modified: kukit/kss.core/branch/performance_improvement/kss/core/pluginregistry/ (props changed) kukit/kss.core/branch/performance_improvement/kss/core/pluginregistry/EXTERNALS.TXT Log: Switch to kss.concatresource trunk in externals Modified: kukit/kss.core/branch/performance_improvement/kss/core/pluginregistry/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/branch/performance_improvement/kss/core/pluginregistry/EXTERNALS.TXT (original) +++ kukit/kss.core/branch/performance_improvement/kss/core/pluginregistry/EXTERNALS.TXT Thu May 3 08:21:29 2007 @@ -7,4 +7,4 @@ # # concatresource is now included like as batteries -_concatresource http://codespeak.net/svn/z3/jsonserver/branch/merge/concatresource +_concatresource https://codespeak.net/svn/kukit/kss.concatresource/trunk/kss/concatresource From reebalazs at codespeak.net Thu May 3 08:31:34 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 3 May 2007 08:31:34 +0200 (CEST) Subject: [KSS-checkins] r42604 - kukit/kss.concatresource/trunk/kss/concatresource/compression Message-ID: <20070503063134.D9F64807C@code0.codespeak.net> Author: reebalazs Date: Thu May 3 08:31:34 2007 New Revision: 42604 Modified: kukit/kss.concatresource/trunk/kss/concatresource/compression/css.py kukit/kss.concatresource/trunk/kss/concatresource/compression/javascript.py Log: The packer needs to be created for each packing Modified: kukit/kss.concatresource/trunk/kss/concatresource/compression/css.py ============================================================================== --- kukit/kss.concatresource/trunk/kss/concatresource/compression/css.py (original) +++ kukit/kss.concatresource/trunk/kss/concatresource/compression/css.py Thu May 3 08:31:34 2007 @@ -4,14 +4,14 @@ ''' from thirdparty.packer import CSSPacker - -csspacker_safe = CSSPacker('safe') -csspacker_full = CSSPacker('full') +# Packer needs to be created for each packing def compress(data, compress_level): if compress_level == "safe": + csspacker_safe = CSSPacker('safe') return csspacker_safe.pack(data) elif compress_level == "full": + csspacker_full = CSSPacker('full') return csspacker_full.pack(data) else: # none Modified: kukit/kss.concatresource/trunk/kss/concatresource/compression/javascript.py ============================================================================== --- kukit/kss.concatresource/trunk/kss/concatresource/compression/javascript.py (original) +++ kukit/kss.concatresource/trunk/kss/concatresource/compression/javascript.py Thu May 3 08:31:34 2007 @@ -3,14 +3,14 @@ that is taken from Plone's ResourceRegistries.''' from thirdparty.packer import JavascriptPacker - -jspacker_safe = JavascriptPacker('safe') -jspacker_full = JavascriptPacker('full') +# Packer needs to be created for each packing def compress(data, compress_level): if compress_level == "safe": + jspacker_safe = JavascriptPacker('safe') return jspacker_safe.pack(data) elif compress_level == "full": + jspacker_full = JavascriptPacker('full') return jspacker_full.pack(data) else: # none From reebalazs at codespeak.net Thu May 3 08:39:38 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 3 May 2007 08:39:38 +0200 (CEST) Subject: [KSS-checkins] r42605 - kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression Message-ID: <20070503063938.301A2807C@code0.codespeak.net> Author: reebalazs Date: Thu May 3 08:39:37 2007 New Revision: 42605 Modified: kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression/css.py kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression/javascript.py Log: Merge -r42603:42604 from trunk: The packer needs to be created for each packing Modified: kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression/css.py ============================================================================== --- kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression/css.py (original) +++ kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression/css.py Thu May 3 08:39:37 2007 @@ -4,14 +4,14 @@ ''' from thirdparty.packer import CSSPacker - -csspacker_safe = CSSPacker('safe') -csspacker_full = CSSPacker('full') +# Packer needs to be created for each packing def compress(data, compress_level): if compress_level == "safe": + csspacker_safe = CSSPacker('safe') return csspacker_safe.pack(data) elif compress_level == "full": + csspacker_full = CSSPacker('full') return csspacker_full.pack(data) else: # none Modified: kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression/javascript.py ============================================================================== --- kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression/javascript.py (original) +++ kukit/kss.concatresource/branch/ree-stripout-comments/kss/concatresource/compression/javascript.py Thu May 3 08:39:37 2007 @@ -3,9 +3,7 @@ that is taken from Plone's ResourceRegistries.''' from thirdparty.packer import JavascriptPacker - -jspacker_safe = JavascriptPacker('safe') -jspacker_full = JavascriptPacker('full') +# Packer needs to be created for each packing def stripout_comments(data): 'Strips out ;;; lines from the data.' @@ -31,15 +29,19 @@ return stripout_comments(data) elif compress_level == "safe": data = stripout_comments(data) + jspacker_safe = JavascriptPacker('safe') return jspacker_safe.pack(data) elif compress_level == "full": data = stripout_comments(data) + jspacker_full = JavascriptPacker('full') return jspacker_full.pack(data) elif compress_level == "safe-devel": date = remove_markers(data) + jspacker_safe = JavascriptPacker('safe') return jspacker_safe.pack(data) elif compress_level == "full-devel": date = remove_markers(data) + jspacker_full = JavascriptPacker('full') return jspacker_full.pack(data) else: # none From reebalazs at codespeak.net Thu May 3 08:42:32 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 3 May 2007 08:42:32 +0200 (CEST) Subject: [KSS-checkins] r42606 - kukit/kss.concatresource/tag/initial-import Message-ID: <20070503064232.11B70807C@code0.codespeak.net> Author: reebalazs Date: Thu May 3 08:42:31 2007 New Revision: 42606 Added: kukit/kss.concatresource/tag/initial-import/ - copied from r42564, kukit/kss.concatresource/trunk/ Log: Marking initial import with a tag From reebalazs at codespeak.net Thu May 3 08:44:04 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 3 May 2007 08:44:04 +0200 (CEST) Subject: [KSS-checkins] r42607 - kukit/kss.concatresource/tag/initial-import/trunk Message-ID: <20070503064404.B2A0F807C@code0.codespeak.net> Author: reebalazs Date: Thu May 3 08:44:03 2007 New Revision: 42607 Added: kukit/kss.concatresource/tag/initial-import/trunk/ - copied from r42568, kukit/kss.concatresource/trunk/ Log: Marking initial import with a tag From reebalazs at codespeak.net Thu May 3 08:58:38 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 3 May 2007 08:58:38 +0200 (CEST) Subject: [KSS-checkins] r42608 - in kukit/kss.core/branch/ree-stripout-comments/kss/core: . pluginregistry Message-ID: <20070503065838.88BD4807C@code0.codespeak.net> Author: reebalazs Date: Thu May 3 08:58:37 2007 New Revision: 42608 Modified: kukit/kss.core/branch/ree-stripout-comments/kss/core/BeautifulSoup.py kukit/kss.core/branch/ree-stripout-comments/kss/core/pluginregistry/selector_type.py Log: Merge -r42577:42578 from trunk: fix name errors in BeautifulSoup and in the selector types registry. Modified: kukit/kss.core/branch/ree-stripout-comments/kss/core/BeautifulSoup.py ============================================================================== --- kukit/kss.core/branch/ree-stripout-comments/kss/core/BeautifulSoup.py (original) +++ kukit/kss.core/branch/ree-stripout-comments/kss/core/BeautifulSoup.py Thu May 3 08:58:37 2007 @@ -857,7 +857,7 @@ """Convenience method that works with all 2.x versions of Python to determine whether or not something is stringlike.""" try: - return isinstance(s, unicode) or isintance(s, basestring) + return isinstance(s, unicode) or isinstance(s, basestring) except NameError: return isinstance(s, str) Modified: kukit/kss.core/branch/ree-stripout-comments/kss/core/pluginregistry/selector_type.py ============================================================================== --- kukit/kss.core/branch/ree-stripout-comments/kss/core/pluginregistry/selector_type.py (original) +++ kukit/kss.core/branch/ree-stripout-comments/kss/core/pluginregistry/selector_type.py Thu May 3 08:58:37 2007 @@ -1,5 +1,6 @@ from plugin import AzaxPlugin +from plugin import AzaxPluginError from interfaces import ISelectorType import zope.component as capi from zope.interface import implements From reebalazs at codespeak.net Thu May 3 08:59:32 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 3 May 2007 08:59:32 +0200 (CEST) Subject: [KSS-checkins] r42609 - in kukit/kss.core/branch/performance_improvement/kss/core: . pluginregistry Message-ID: <20070503065932.CC8B28078@code0.codespeak.net> Author: reebalazs Date: Thu May 3 08:59:31 2007 New Revision: 42609 Modified: kukit/kss.core/branch/performance_improvement/kss/core/BeautifulSoup.py kukit/kss.core/branch/performance_improvement/kss/core/pluginregistry/selector_type.py Log: Merge -r42577:42578 from trunk: fix name errors in BeautifulSoup and in the selector types registry. Modified: kukit/kss.core/branch/performance_improvement/kss/core/BeautifulSoup.py ============================================================================== --- kukit/kss.core/branch/performance_improvement/kss/core/BeautifulSoup.py (original) +++ kukit/kss.core/branch/performance_improvement/kss/core/BeautifulSoup.py Thu May 3 08:59:31 2007 @@ -857,7 +857,7 @@ """Convenience method that works with all 2.x versions of Python to determine whether or not something is stringlike.""" try: - return isinstance(s, unicode) or isintance(s, basestring) + return isinstance(s, unicode) or isinstance(s, basestring) except NameError: return isinstance(s, str) Modified: kukit/kss.core/branch/performance_improvement/kss/core/pluginregistry/selector_type.py ============================================================================== --- kukit/kss.core/branch/performance_improvement/kss/core/pluginregistry/selector_type.py (original) +++ kukit/kss.core/branch/performance_improvement/kss/core/pluginregistry/selector_type.py Thu May 3 08:59:31 2007 @@ -1,5 +1,6 @@ from plugin import AzaxPlugin +from plugin import AzaxPluginError from interfaces import ISelectorType import zope.component as capi from zope.interface import implements From reebalazs at codespeak.net Thu May 3 14:13:46 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 3 May 2007 14:13:46 +0200 (CEST) Subject: [KSS-checkins] r42625 - kukit/azax/branch/1.1-performance_improvement Message-ID: <20070503121346.E7F1B8075@code0.codespeak.net> Author: reebalazs Date: Thu May 3 14:13:45 2007 New Revision: 42625 Added: kukit/azax/branch/1.1-performance_improvement/ - copied from r42624, kukit/azax/branch/1.1-ree-load-event-cleanup/ Log: Copy branch From reebalazs at codespeak.net Thu May 3 14:24:00 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 3 May 2007 14:24:00 +0200 (CEST) Subject: [KSS-checkins] r42626 - in kukit/azax/branch/1.1-performance_improvement: . pluginregistry Message-ID: <20070503122400.4BE628075@code0.codespeak.net> Author: reebalazs Date: Thu May 3 14:23:59 2007 New Revision: 42626 Modified: kukit/azax/branch/1.1-performance_improvement/ (props changed) kukit/azax/branch/1.1-performance_improvement/EXTERNALS.TXT kukit/azax/branch/1.1-performance_improvement/pluginregistry/ (props changed) kukit/azax/branch/1.1-performance_improvement/pluginregistry/EXTERNALS.TXT Log: Fix externals Modified: kukit/azax/branch/1.1-performance_improvement/EXTERNALS.TXT ============================================================================== --- kukit/azax/branch/1.1-performance_improvement/EXTERNALS.TXT (original) +++ kukit/azax/branch/1.1-performance_improvement/EXTERNALS.TXT Thu May 3 14:23:59 2007 @@ -5,5 +5,5 @@ # You can update your working dir by: # svn propset svn:externals -F EXTERNALS.TXT . # -kukit http://codespeak.net/svn/kukit/kukit.js/branch/ree-load-event-cleanup +kukit http://codespeak.net/svn/kukit/kukit.js/branch/performance_improvement configfeature http://codespeak.net/svn/z3/jsonserver/branch/merge/configfeature Modified: kukit/azax/branch/1.1-performance_improvement/pluginregistry/EXTERNALS.TXT ============================================================================== --- kukit/azax/branch/1.1-performance_improvement/pluginregistry/EXTERNALS.TXT (original) +++ kukit/azax/branch/1.1-performance_improvement/pluginregistry/EXTERNALS.TXT Thu May 3 14:23:59 2007 @@ -7,4 +7,4 @@ # # concatresource is now included like as batteries -_concatresource http://codespeak.net/svn/z3/jsonserver/branch/merge/concatresource +_concatresource http://codespeak.net/svn/kukit/kss.concatresource/trunk/kss/concatresource From reebalazs at codespeak.net Sun May 6 09:15:21 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 6 May 2007 09:15:21 +0200 (CEST) Subject: [KSS-checkins] r42726 - kukit/kukit.js/branch/ree-stripout-comments/kukit Message-ID: <20070506071521.0BACB807C@code0.codespeak.net> Author: reebalazs Date: Sun May 6 09:15:21 2007 New Revision: 42726 Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/kssparser.js Log: replace '\' in the parser to '\x5c', obviously confuses the full packer Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/kssparser.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/kssparser.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/kssparser.js Sun May 6 09:15:21 2007 @@ -36,7 +36,7 @@ kukit.kssp.colon = kukit.tk.mkToken('colon', ":"); kukit.kssp.quote = kukit.tk.mkToken('quote', "'"); kukit.kssp.dquote = kukit.tk.mkToken('dquote', '"'); -kukit.kssp.backslash = kukit.tk.mkToken('backslash', '\\'); +kukit.kssp.backslash = kukit.tk.mkToken('backslash', '\x5c'); kukit.kssp.comma = kukit.tk.mkToken('comma', ","); kukit.kssp.equals = kukit.tk.mkToken('equals', "="); @@ -409,7 +409,7 @@ */ kukit.kssp.String = kukit.tk.mkParser('string', { "'": 'this.emitAndReturn(new kukit.kssp.quote(this.src))', - "\\": 'new kukit.kssp.Backslashed(this.src, kukit.kssp.backslash)' + '\x5c': 'new kukit.kssp.Backslashed(this.src, kukit.kssp.backslash)' }); kukit.kssp.String.prototype.process = function() { // collect up the value of the string, omitting the quotes @@ -424,7 +424,7 @@ */ kukit.kssp.String2 = kukit.tk.mkParser('string', { '"': 'this.emitAndReturn(new kukit.kssp.dquote(this.src))', - "\\": 'new kukit.kssp.Backslashed(this.src, kukit.kssp.backslash)' + '\x5c': 'new kukit.kssp.Backslashed(this.src, kukit.kssp.backslash)' }); kukit.kssp.String2.prototype.process = kukit.kssp.String.prototype.process; From reebalazs at codespeak.net Sun May 6 09:46:59 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 6 May 2007 09:46:59 +0200 (CEST) Subject: [KSS-checkins] r42728 - kukit/kukit.js/branch/ree-stripout-comments/kukit Message-ID: <20070506074659.6FC33807C@code0.codespeak.net> Author: reebalazs Date: Sun May 6 09:46:59 2007 New Revision: 42728 Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js Log: Fix semicolons to enable full packing Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js Sun May 6 09:46:59 2007 @@ -522,7 +522,7 @@ kukit.er.BinderInfo.prototype.processBindingEvents = function () { // We came to the end of the binding phase. Now we process all our binding // events, This will do the actual binding on the browser side. - this.binding.processBindingEvents(this.binderinstance) + this.binding.processBindingEvents(this.binderinstance); // Now we to add these to the new ones. this.binding.propagateTo(this.bound); // Delete them from the registry, to protect against accidents. Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js Sun May 6 09:46:59 2007 @@ -370,7 +370,7 @@ kukit.engine.bindScheduler.addPost(func_to_bind, 'Execute iload event for iframe ' + iloadoper.node.name); }; new kukit.dom.EmbeddedContentLoadedScheduler(iloadoper.node.id, f, iloadoper.parms.autodetect); - } + }; kukit.engine.bindScheduler.addPost(g, 'Schedule iload event for iframe ' + iloadoper.node.name); } else { kukit.logDebug('EventRule #' + iloadoper.eventrule.getNr() + ' mergeid ' + iloadoper.eventrule.kss_selector.mergeid + ' event selected normal postponed execution.'); From reebalazs at codespeak.net Sun May 6 11:21:49 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 6 May 2007 11:21:49 +0200 (CEST) Subject: [KSS-checkins] r42734 - kukit/kukit.js/branch/ree-stripout-comments/kukit Message-ID: <20070506092149.411D9807F@code0.codespeak.net> Author: reebalazs Date: Sun May 6 11:21:48 2007 New Revision: 42734 Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/actionreg.js kukit/kukit.js/branch/ree-stripout-comments/kukit/commandprocessor.js kukit/kukit.js/branch/ree-stripout-comments/kukit/commandreg.js kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js kukit/kukit.js/branch/ree-stripout-comments/kukit/errors.js kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js kukit/kukit.js/branch/ree-stripout-comments/kukit/forms.js kukit/kukit.