Change Log * denotes potential backwards incompatibility v2.1.3 db module requires PK definition up-front (instead of erroring out later) default login render tags give better feedback on unsuccessful login raise NameError instead of string exception for invalid eval'd tag attributes fixes for spyceProject fix kwargs render-through on spy: list and table tags fix auto-selecting of multiple defaults in compound controls fix for class-based exceptions in old-style tag exception handlers v2.1.2 fix support for threadless python builds fix using compiled tags within other tags fix f:textarea fix spyceUtil.extractValue for incomplete dict work-alikes fix session1 fix tempdir on SF site v2.1 * Python 2.3 required now! # New features # SqlAlchemy integration spy:login, spy:loginrequired tags HandlerError integration with forms :list, :bool, and :int hints to handler arg-marshalling intelligent ValidationError "data" option to f:select; added f:checkboxlist, f:radiolist * removed "value" and "default" parameters to f:form * changed semantics of "default" parameter to f:select spy:ul, spy:ol, spy:dl, spy:table tags new session module based on work by Conan Albrecht pyweboff demo * spy:parent searches for parent.spi in current directory before using config.defaultparent * indexExtensions superceded by indexFiles in spyceconf cached parent template lookup improved ability to report certain types of Spyce syntax errors Fixes for "special characters" in cookies improved Programmatic Interface docs (Iwan Vosloo) (f)cgi improvements by Pauli Virtanen # New & updated examples (see docs/eg.html) # db.spy formtag.spy formintro.spy login-optional.spy login-required.spy handlerintro.spy handlervalidate.spy handlervalidate2.spy session2.spy # Deprecations / incompatibilities # template module moved to contrib/ flow control from "core" taglib moved to contrib/flow.py * these will probably be gone entirely in Spyce 2.2 * session [the old one] module renamed to contrib/session1.py To make your old code happy, change [[.import name=session]] to [[.import name=session1 as=session]] * Removed javascript generation done by f:submit; too "black magical" * removed check_modules_no_restart option * indexExtensions superceded by indexFiles in spyceconf # Bug fixes # module/tag cache obeys check_mtime fix f:date javascript KeyboardInterrupt fix for spyceWWW in restart-for-changes mode spyceNotFound error can be customized again when using Spyce webserver fix for multiline string constants in files with weird line endings v2.0.3 fix pool bug if server not in concurrency=threaded mode; reported by "Dude" documentation improvements avoid stomping on user python modules named 'config'; reported by Betty Li (John Reese) fixed bad interaction of "redirect if directory path doesn't end in /" and "look for default index.$[index extensions] files" code in Spyce webserver default concurrency mode for Spyce webserver is 'threading' instead of None spyceProject script to automate new-project creation; see http://spyce.sourceforge.net/docs/doc-conf_next.html v2.0.2 session_dir uses config.tmp by default if no directory is specified fix for session_dir pickling on win32 fix for fileCache pickling bug on win32 reported by Jarosław Zabiello fix for sessions + handlers problem reported by Jonathan Taylor * all module init() methods are now run before handlers are called. v2.0.1 use tempfile.gettempdir() as default config.tmp add originalsyspath to spyceconf bugfixes for Active Tag compiler portability & other bugfixes (John Reese) v2.0 Important new features: new-style Active Tags - http://spyce.sourceforge.net/docs/doc-tag_new2.html OpenACS-like (Tiles-ish, for you JSP people) parent/child layout system - roughly the same speed as include.spyce, so using one parent template has about 1/2 the overhead as the old standard two-includes-for-header-and-footer. - http://spyce.sourceforge.net/docs/doc-tag_core.html#parent Active Handlers reusable components without the leaky abstraction of ASP.NET et al. - http://spyce.sourceforge.net/docs/doc-lang_handlers.html Important incompatibilities with version 1.3: * replaced spyce.conf with spyceconf.py; functionality retained * request.get and request.post now return [] instead of None by default if name is specified but nothing was submitted corresponding to it - "if request.get('foo'):" will work the same since [] is false for boolean purposes - motivation: now you can simply write "for item in request.get('foo')" without worrying about TypeError many absolute paths are relative to spyce docroot now - redirect.internal, includes, error.setFileHandler * this will break your code if you were using absolute filesystem paths; relative paths will be unaffected * active tag attributes are evaluated in spyceProcess context - no more explicit tagcontext Changes since 2.0-beta: - mod_python fix - fix sometimes ignoring config.debug option - updated concurrency protection for more general case of all spyce_cache accesses - added indexExtensions option to spyceconf - included code by John Reese - added contrib/spyce.el (Emacs Spyce mode) - added form:date tag Other changes: new config options for spyceWWW mode (-l): check_modules_and_restart (default), check_modules_no_restart - detects changed python modules and restarts/reloads to apply the changes add "class chunk" language construct: [[! or <%! - enables inlining handler callbacks - http://spyce.sourceforge.net/docs/doc-lang_chunkc.html add globaltags configuration option - no longer have to specify [[.taglib]] on each page spyceCompile.py now optimizes away taglib loads if the tag isn't used on the page - so no penalty for putting a lot of stuff into globaltags add form:date tag add scheduler [python] module spyceTag export method allows sending variables back to spyceProcess context * core:let only supports singleton form; core:unlet removed pool module now works with non-spyceWWW deployments, via pickle * writeExpr emits empty string for None by default - so you can write [[= request['foo'] ]] instead of [[= request.getpost1('foo', '') ]] param|file request filters evaluate imports in spyceConfig as the very last part of spyceServer __init__ - so imported module can proceed to "import spyce; spyce.getServer()..." added request.stack method - infinite-loop checking for includes, parent templates * removed include.fromFile field added ipaddr WWW config option, for machines w/ multiple IPs * spyceTagPlus.syntaxExists removed (equivalent checking now done automatically) - only custom tag authors are affected by this * spyce Modules are no longer allowed to redirect.internal during finish() - it potentially prevented other modules' finish methods from being called an active tag's directory is pushed onto sys.path for the duration of its use - means tag can import from .py files in its directory no matter where installed fix: apply --conf option to CGI mode fix: follow symlinks to find correct mtime of .spy files to compare against cached - also call normpath in FileHandler - patch by Francisco Javier Cabello fix: potential race condition in commonHandler/newWrapper call - (only could cause problems when running spyceWWW/threaded concurrency) * fix: pool module now reflects server globals, as indicated by documentation fix: changed spyce modules are reloaded - wasn't a huge deal to not have this before since not many people wrote active tags or modified existing Spyce modules; more important now that (I expect) more people will be using the 2.0-style active tags v1.3.14 fix: mod_python environment dictionary does not support iteration, causing problems with cgi.py library in Python >2.3. Fix is to convert to regular Python dictionary. Thanks to Jan Kujawa v1.3.13 improved performance (approx. 3x) of single-threaded print exceptions in non-default modules reported like errors in script code fix: mysession.spy: session depends on pool, so switched import order fix: faulty session handlers thrown out on error - takes care of annoying NameError: 'pool' not found fix: sys.path always returned to original state, even on error globals accessible via python modules - applied patch contributed by: Niko Matsakis iterable objects allowed within 'for' tag - modified patch submitted by: Stefan Behnel spyce lambdas can return values updated spyceLock.py to eliminate Python FutureWarning for large constants added include.spyceStr(), idea from Santtu Pajukanta fix: error module performs response.clearFilters - thanks to Colin Gillespie for reporting this turning on spyce.DEBUG_ERROR will also display when modules start/finish v1.3.12 added fix to prevent reparsing of POST stream on internal redirect (modified Conan Albrecht's contribution) documentation updates fix: parsing totally empty files threw exception user request: iterate over request object modified semantics of active tags - singleton tags now behave like paired tags with empty bodies - defined a number of flags in spyceTag to reduce level of indentation in generated python code where unnecessary: conditional, loops, catches, mustend - see tag documentation updated core tag library accordingly fix: dump_handler with binary files truncating on Windows fix: files with DOS linebreaks fix: both <%. and <%@ can now begin a spyce directive directory listings of Spyce webserver look nicer, Apache-like added form active tag library added PATH_INFO functionality to spyceWWW v1.3.11 user request: daemon webserver mode fix: mod_python flush problem performance: rewrote tokenizer/parser - no longer using clusmy parser generator package - still pure python, compilation times between 2-6x faster user request: expose functionality to define spyceProcess function with arbitrary parameters, and pass in parameters... helps Coil framework with Spyce integration fix: spyce webserver not performing path manipulations correctly on Windows fix: spyce.mime file not copied for .rpm and Windows installers v1.3.10 Default development configuration changed to: Apache 2.0.40 and Python 2.2.x Release testing will be performed: both on Linux and Windows under CGI, FastCGI and mod_python Other versions of Apache and Python should continue to work, but will not be tested. I am depending on user feedback to catch any errant bugs under these older configurations. fix: spyceWWW properly deals with directory URLs that don't end in '/' fix: request.getpost1/postget1() now accept default values fix: memory cache checks file permission as well as modification time fix: makefile was including .pyc/.pyo files in tarball fix: spyce.vim syntax highlighting for spyce lambdas fix: error module should be loaded last to avoid stdout module being unloaded on error, thereby causing print statements to no longer go to the browser during error handling fix: error module setHandler used incorrect variable name, causing setHandler to fail updated spyce.vim syntax file for JSP/ASP like delimeters spyce.vim now included in vim distribution rpm generates spyceParserTable.py (allowing for different versions of python) added 'no-store' and 'must-revalidate' to response.uncacheable() added pageerror configuration option to modify default page-level handler rpm now requires http >2.0 and python >2.2 installed v1.3.9 spyceWWW web server improved - configuration options integrated into spyce.conf - handler mechanism created - defined spyce and dump handlers - reads Apache format mime-type definition files - .spy files ==> spyce handler; rest ==> dump handler - can display directory listings - configuration options added accordingly - corresponding documentation changed documentation restructured to explain common configuration file options in the runtime section fix: docs/examples/*.gif added to rpm and windows installer expanded section on how to get Spyce running under IIS via CGI v1.3.8 user request: modified request.get/post/get1/post1/env() to accept default values (note: will break code that provided caseInsensitive parameter by position) added request.getpost/getpost1/postget/postget1/default() methods bug fixes: python 1.5 backwards compatibility issues in the following online examples: gif.spy, myPortal.spy, mysession.spy v1.3.7 support for ASP-style delimeters -- <% %> use of Bastion eliminated, due to Python deprecation v1.3.6 info.spy example updated to deal with implicitly loaded taglib module minor documentation fix for doc-mod_include quotes for the PythonPath in httpd.conf v1.3.5 taglib and spylambda modules loaded implicitly only when needed (i.e. when tags or spyce lambdas are actually used in a given file) make install made more portable; removed install -D switch EOFError now handled for file-based spyce caching (strange Windows bug?) improvements to automaton module v1.3.4 doc updates - session module minor mod_python bug - filename attribute used over environment fix - windows installer unable to find python executable in some cases v1.3.3 examples/info.spy added keep track of spyce entry point, added to spyce header fix - CGI fails (only on Apache2.0!) with GET info due v1.3.2 changes fix - typo in core:if tag v1.3.2 mod_python 3.0.1 compatibility - switched to sre module, despite stack limits, because pre module conflicts with pcre shared object that apache uses (actually, just fails on some complicate reg.exps!) This implies that very, very long spyce files might fail, until sre module implements a state-machine-based reg.exp engine. - apacheRequest.connection.child_num mysteriously removed, therefore using os.getpid() in spyceModpyRequest.getServerID() spyceApache.conf tweaked (should be more compatible) installHelper.py converts backslash to forward slash for httpd.conf on Windows switched from pre to sre module in spyceCompile.py - reason: Apache 2.0.x uses different pcre library from Python causing failure under mod_python - pre was used over the default (sre) because sre implementation is stack-based and encountered overruns... Oh, well! Don't write Spyce files that blow the stack until sre is fixed. v1.3.1 fix - wrapped thread-unsafe yacc-like package with lock renamed util module to spyceUtil.py - conflict with python1.5 site-package renamed cache.py, lock.py (just in case) make website update script faster v1.3.0 active tags introduced - see: http://spyce.sourceforge.net/doc-tag.html - [[.taglib]] directive added - taglib spyce module added - compiler changes to deal with active tags - tagging infrastructure (spyceTag, spyceTagPlus, spyceTagLibrary) - see: spyceTags.py - user-defined active tag libraries possible - see: http://spyce.sourceforge.net/doc-tag_new.html - core active tag library see: tags/core.py see: http://spyce.sourceforge.net/doc-tag_core.html - tag libraries loaded from same path as modules - compiler syntax checking improved - check for unbalanced parens - check for unbalanced active tags - extensible syntax checking for active tags v1.2.10 bugfix - typo in spyceWWW caused threading mode startup failure v1.2.9 stdout.push() can now accept no file argument stdout.pop() now returns captured output stdout.capture() added see: examples/stdout.spy and stdout module docs session_user session handler added in session module see: examples/mysession.spy and session module docs spylambda.define() can now memoize see: http://spyce.sourceforge.net/doc-mod_lambda.html memoized spyce lambda syntax: [[spy! ...: ...]] see: http://spyce.sourceforge.net/doc-lang_lambda.html slight modification to spyce.vim syntax file response.addHeader() now support replacement response.timestamp(), expire(), expireRel(), lastModified() and uncacheable() methods added see: http://spyce.sourceforge.net/doc-mod_response.html performance! v1.2.8 links page added spyce VIM syntax file updated; deals with spyce lambdas include module improvements - 'vars' field added - included file can return value - documentation updated, specifically regarding use of 'context' v1.2.7 internal restructuring continues - separated spyce exceptions - separated spyce configuration - expanded spyce API and spyceServer - spyce.spyceDone now imported as spyceDone simplified spyceModule - renamed wrapper field, to _api - old spyceModule available as spyceModulePlus - all standard modules updated fixed - syntax errors were not reported properly file-based spyce caching, with config option performance improvements v1.2.6 single and multi-page documentation minor fixes: - NoCloseOut.flush() added - BufferedOutput.flush() flushes sub-stream - template module pointed at new location of cache code v1.2.5 spyceAPI defined: module access to spyceWrapper object restricted - see: http://spyce.sourceforge.net/doc-mod_new.html - (in general, will be moving towards restricted execution space) toc module improved; add level(), l1()...l9() methods server-level debug option added to config file - see: http://spyce.sourceforge.net/doc-conf_common_debug.html - debug Spyce module deprecated engine now supports recursive requests (include spyce from itself) sys.stdout (and therefore print statements) made thread-safe spyce engine supports concurrent requests server-level concurrency option added to config file - see: http://spyce.sourceforge.net/doc-conf_common_concurrency.html - spyce webserver operates in single, forking and threading modes server-level Spyce module caching - replaces Spyce-level module caching - caching-related code separated from wrapper code compilation seperated from wrapper (spyce.spyceCode) autodetect when PYTHONOPTIMIZE causes lexer/parser failure minor fixes and performance tweaks v1.2.4 fix - new PLY parser uses reflection at runtime to read documentation strings containing grammar, thus you should not run Python in optimize mode, thus mod_python option in spyceApache.conf changed. fix - python 1.5 compatible .spy files for docs v1.2.3 fix - code for new tokenizer/parser made python 1.5.2 compatible v1.2.2 fix - PATH_INFO via CGI fix - magic (#!) on first line treated as comment v1.2.1 complete rewrite of spyce tokenizer and parser - using PLY, table-driven added spyce lambdas to language v1.2.0 contrib section added support for SPYCE_PATH environment variable lots of documentation fixes decided spyce was mature enough for 1.2.0 v1.1.46 feature request: improved examples page on website v1.1.45 site and documentation revamp refactored the spyceModule class (see spyceModule.py) altered all standard modules to conform to new internal design new table-of-contents (toc) module (see docs) improved stdout module (see docs) added push() and pop() methods now loaded implicitly exception tracebacks in chunks identify specific error lines file globbing added to -O command-line option v1.1.44 module directive deprecated replaced with import tag import tag accepts args attribute calls module init() method at location of directive init() methods added to modules: session, compress see: http://spyce.sourceforge.net/doc_lang_directive.html http://spyce.sourceforge.net/doc_mod.html http://spyce.sourceforge.net/doc_mod_compress.html http://spyce.sourceforge.net/doc_mod_session.html http://spyce.sourceforge.net/doc_mod_new.html bugfix - modules finalized on redirect v1.1.43 bugfix - included files not inheriting modules properly bugfix - transform module inside included file v1.1.42 renamed spyce.conf to spyceApache.conf renamed spyceApache to spyceModpy renamed run_spyceApache to run_spyceModpy (affect spyceApache.conf) added server-level configuration file functionality server module search path modules to load at startup server-level error handler global server variables see: docs/doc_conf_common.html added response.isCancelled() function see: docs/doc_mod_response.html bugfix - early client disconnect caused problems under mod_python v1.1.41 extended HTTP response constants to conform to spec extended HTML entity encoded characters to conform to spec modified internal buffering semantics to allow eliminiation of special case code for specific HTTP return codes (redirects) in the common path performance improvements convenience functions transform.html_encode() and url_encode() added error module added: handles errors that occur during spyce processing bugfix - HTTP return codes propagated correctly under mod_python v1.1.40 bugfix - spyce syntax error propagated properly response headers cleared on an internal redirect case insensitive request.get,post,get1,post1,file v1.1.39 modified how filter module injects itself into output stream added response.addFilter() to allow piped functionality on the output stream, modules can insert write, writeStatic, writeExpr, flush and clear handlers added compress module for dynamic compression functionality compress module documentation renamed filter module to transform (name conflict with Python builtin) sys.path forced to be absolute before changing directory in CGI mode bugfix - spyce path trimmed to just filename when directory changed for CGI processing bugfix - spyce web server closes sockets v1.1.38 spyce can now run as a (proxy) web server spyce -l [-p port] v1.1.37 spyceDone exception to stop spyce processing raise spyceDone, see gif.spy, fileupload.spy examples response.close() deprecated not needed with spyceDone functionality cPickle used in session module improved session serialization performance v1.1.36 redirect.externalRefresh now has url= in string internal redirect fixed bug fix - consecutive compact line removal now possible examples added: hello2.spy, form.spy handle ISINDEX CGI queries that have extra command-line parameters Status CGI header used for spyce redirect return codes v1.1.35 bug - fixed cgi chdir in case of local directory request - invoke spyce engine programmatically with spyce string source tarball does not contain extra CVS junk v1.1.34 fixed apache config bug in windows installer v1.1.33 appended current Spyce file's directory to sys.path v1.1.32 minor documentation tweaks names attribute added to [[.module ]] tag request.__getitem__() added chdir in cgi mode v1.1.31 windows installer improved: apache configuration and restart fixed - handling of initial spaces in multi-line strings in python chunks v1.1.30 red page marker in docs created undefined windows lock variables v1.1.29 documentation split up rpm is now noarch v1.1.28 include.dump() now has binary option stdout changed to binary mode on windows for cgi purposes fixed session_dir handler bug on windows v1.1.27 fcgi implemented on windows too windows installer v1.1.26 fixed - nasty bug with the new module behaviour small improvements to documentation and examples improved request.uri() function v1.1.25 fixed - fcgi module broke on windows v1.1.24 line compaction improved module behaviour on include.spyce() defined v1.1.23 lots of changes so that: it works on Python 1.5.2 now too! file-based session handler now uses pid, and file locks live examples on sourceforge v1.1.22 fixed Python v2.1.1-related bugs. improved installation process and documentation rpm more likely to succeed - uses fcgi or drops back to cgi no longer mod_python based by default v1.1.21 (faulty release) stochastic session clean up; no more threading dependency documentation: better installation notes peep-hole optimizer v1.1.20 (faulty release) created explicit (swappable) cache infrastructure BUG ** Spyce also works on Python v2.1 request - request.post(),post1() works in includes documentation: cheetah install, ... v1.1.19 filter module v1.1.18 fcgi support added X-Spyce header added documentation: how to write new modules v1.1.17 feature request - compaction algorithm improved v1.1.16 generalised session.setHandler (session handler selection mechanism) gdbm, bsd db session handlers added v1.1.15 minor makefile and rpm script changes handling of multi-line strings in python code response.flush() added v1.1.14 wrappers to check python version v1.1.13 added new language construct: "Python chunks" v1.1.12 stdout module redirects stdout to response object added writeln() to response module v1.1.11 fixed lots of CGI bugs: reported bug - headers not sent session module thread prevented script death added spyce.ONE_SHOT variable cookie module fixed gif.spy example fixed external redirect fixed v1.1.10 performance: implemented semantic cache for spyce compilation templating module performs caching lots of commenting v1.1.9 templating module (cheetah integration) documentation v1.1.8 automaton module documentation v1.1.7 associative array access to session and cookie information added pool module documentation comments emitted as tokens syntax highlighting function: include.spycecode documentation v1.1.6 dynamically loading modules v1.1.5 redirect module added v1.1.4 response.unbuffer() v1.1.3 support for file upload request.get1(),post1() v1.1.2 more reliable exception location reporting v1.1.1 static includes module search path v1.1.0 Implemented modules -- major rewrite. Changed includes, sessions, cookies, ... everything into modules Changed the generated "stub", though this is mostly under-the-covers Rewrote most of the documentation v1.0.5 CGI support Expanded install docs v1.0.4 Many doc updates Autosession support changed directives tags to use html-like attributes v1.0.3 Automatic session cleanup Updated pilpel image v1.0.2 Handle 403 - Forbidden Handle 404 - Not Found v1.0.1 Tracking original spyce code locations in generated code Reporting runtime exceptions in original spyce code Reporting syntax (compile) exceptions in original spyce code v1.0 - Initial release Documentation Added [[.nocompact]] and [[.compact]] Allowed escaped \[[ and \]] in HTML Added session support, with on-disk implementation Realised and implemented command-line Added cookies Added http header calls Added get and post support Created request and response objects Added [[.include]] Added [[.funcion]] and [[./function]] Create in-memory spyce cache Wrote a token-based Brace Converter Added [[ ]] and [[= ]] Created Spyce compiler shell Wrote initial mod_python "hello world" handler Read up on mod_python Looked at PyServ Attempted to engineer a WebWare-based solution