Changes in 5.18 (released 05/17/2016)
Added a function
isexceptionto UL4 that returns true if the argument is an exception object.The
__cause__or__contextattribute of exception objects now gets exposed to UL4 templates as thecauseattribute. In addition to that for the UL4 exceptionll.ul4c.Errorthe following attributes get exposed:location(which is the AST node or tag where the error occured),template(the innermost template where the exception occurred),outerpos(the position of the tag where the error occurred) andinnerpos(the position of the AST node where the error occurred).The UL4 function
typenow returns the Python class name for date, color, template exception objects.
Changes in 5.17.1 (released 05/10/2016)
Fixed a bug in the query done by
orasql.Connection.getobject.
Changes in 5.17 (released 05/04/2016)
The internal structure of UL4 templates has changed to simplify exception handling (Text nodes and tags reference the template now instead of only the template source).
The
rul4functionimporthas been dropped. Instead two functionsload(for reading the content of a file) andcompile(for compiling a string into an UL4 template) have been added.A function
errorfor outputting an error message and aborting template rendering have been added torul4.
Changes in 5.16 (released 04/13/2016)
orasqlnow supports check constraints.orasqlnow handles inline primary key constraints properly.The scripts
oracreate,oradelete,oradrop,oragrant,orareindexandoradiffhave a new option--format. The option valuepysqlswitches the output format to PySQL.Procedure and function source code created by
ll.orasqlwill now no longer have a linefeed introduced before the parameter list.orasql.Commentobjects now work even if the comment contains linefeeds.orasql.Commentobjects now have a methodtablethat returns the table to which the comment belongs.Some methods in
orasqlhave been renamed: Iterating methods no longer haveiterin their name (e.g.itertablesis now simply calledtables). Theddlpart of some method names has been changed tosql(e.g.createddlis now calledcreatesql).Importing
pysqlnow doesn't fail if the modulepwdorgrpdoesn't exist (e.g. on Windows). (However the PySQLfilecommand will still fail if a user/group name is given.)
Changes in 5.15.1 (released 03/21/2016)
Fixed some Python 3 compatibility problems in the module
ll.daemonand updated the command line argument parsing to make it extensible.
Changes in 5.15 (released 03/18/2016)
Calls to UL4 functions and templates now support specifying a
*or**argument multiple times (similar to Python's PEP 448).Also
*and**expressions are now allowed in list, set and dict "literals".The UL4 function
sortednow supports akeyandreverseargument.Strings in UL4 now support the
splitlinesmethod.An UL4 function
asciihas been added.PySQL no longer supports the
-- !!!command terminator. Use theraiseexceptionscommand instead to specify error handling.The PySQL command
setvarnow uses thenamekey as the variable name instead of thevarkey.A new PySQL command
unsetvarhas been added for deleting an existing variable.PySQL variables can now be used in expressions, e.g.:
var('foo_10', 'str').upper()The PySQL function
loadhas been replaced by two functionsloadstrfor loading strings andloadbytesfor loading bytes.orasql.Indexnow has a methoditercolumnsfor iterating through the columns of the index.
Changes in 5.14.2 (released 03/02/2016)
Fixed color blending in
color.Colorto use "premultiplied alpha" values. With this change blending colors gives the same result as CSS.
Changes in 5.14.1 (released 12/04/2015)
Fixed a bug in
ll.makeso thatProjectobjects can now be used as arguments inCallActionobjects.
Changes in 5.14 (released 12/02/2015)
Whitespace handling for UL4 templates has been extended. There are three possible whitespace handling modes now (specified via the new
whitespaceparameter):"keep"(the oldkeepws=True)"strip"(the oldkeepws=False) and the new"smart".In smart mode if a line contains only indentation and one tag that doesn't produce output, the indentation and the linefeed after the tag will be stripped from the text. Furthermore the additional indentation that might be introduced by a
for,if,elif,elseordefblock will be ignored.Rendering a template from within another template will reindent the output of the inner template to the indentation of the outer template.
Rendering an UL4 template from inside a UL4 template is now again done via the
<?render?>tag.Whitespace handling mode for UL4 templates can now be specified in the template source itself via the
<?whitepace?>tag:<?whitespace smart?>
The name and signature of an UL4 template can now be specified in the template source too like this:
<?ul4 name(x, y, *args, **kwargs)?>
Closures in UL4 templates no longer see the state of the variables at the time when the local template was defined, but at the time when it is called. This is similar to most other languages that support closures.
In UL4 tags whitespace is allowed now before the tag name, i.e.:
<? for i in range(10) ?> <? print i ?> <? end for ?>Exposing attributes of objects to UL4 templates can now be customized via the methods
ul4getattrandul4setattr. Support for making attributes writable or exposing them under a different name viaul4attrshas been removed.An object can now be made renderable by UL4 templates by implementing the method
ul4render.An object can now be made callable by UL4 templates by implementing the method
ul4call(__call__is still supported).Stacktraces produced by UL4 templates now include less chained exceptions and are much more informative.
The
rul4option--keepwshas been renamed to--whitespaceand defaults tosmartnow.rul4got a new option--stacktrace:fulldisplays the full Python stack trace,short(the new default) only displays the exception chain without displaying any Python source.Templates used in
rul4have access to a new function:import, which can be used to load templates from any file.UL4 got two new comparison operators:
isandis notfor checking for object identity.oraddhas been renamed topysql. The commands are now no longer limited to being on one line. Normal SQL commands are now also supported. Normal SQL commands must be terminated with a comment line starting with-- @@@and PySQL commands must be either on one line, or start with a line containing only{and end with a line containing only}.Three new commands have been added:
includeincludes anotherpysqlfile.compileallrecompiles all objects in the schema andcheckerrorsraises an exception if there are objects with compilation errors in the schema.Also
str/bytesvalues can be loaded from external files via theloadclass.If an identifier is given when invoking a
sisyphusjob it will be included in the log file name now by default.Three new helper functions were added to
ll.misc:format_classformats the name of a class object (e.g.ValueErrororhttp.client.HTTPException).format_exceptionformats an exception:>>> misc.format_exception(ValueError("bad value")) 'ValueError: bad value'exception_chaintraverses the chain of exceptions (via the__cause__and__context__attributes).+in the path part of URLs are now considered safe characters. Spaces will be escaped as%20and no longer as+.ll.orasql.Commenthas a new methodcommentthat returns the text of the column comment itself.The database objects output by
ll.orasql.Object.iterreferencesandll.orasql.Oracle.iterreferencedbyare now sorted by name to get a stable order of dependencies.ll.mischas two new functions:notifystartandnotifyfinish. The can be used for issuing Mac OS X notifications.
Changes in 5.13.1 (released 06/12/2015)
ll.url.URL.relativecan now produce "scheme relative" URLs if requested via the parameterallowschemerel, i.e.:>>> u1 = url.URL("http://www.example.org/about/index.html") >>> u2 = url.URL("http://www.example.com/images/logo.png") >>> u2.relative(u1, allowschemerel=True) URL('//www.example.com/images/logo.png')The XIST publishing methods now have an additional parameter
allowschemerelurls. Whenallowschemerelurlsis true, scheme relative urls are allowed in the output:>>> node = html.a(href="http://www.example.org/index.html") >>> node.bytes(base="http://www.example.com", allowschemerelurls=True) b'<a href="//www.example.org/index.html"></a>'
Changes in 5.13 (released 12/18/2014)
UL4 templates now support signatures. Signatures can be used for top level templates and for subtemplates. This makes it possible to define default values for template variables and to call templates with positional arguments.
The option
setproctitlefor sisyphus jobs has been renamed toproctitle. The new methodsetproctitlesets the process title and can be used to customize setting the process title.Locally defined UL4 templates no longer see themselves among the variables of the parent template. This avoids cycles in the object graph.
The default for the name parameter in
tasksfor sisyphus jobs has changed fromstrtoNone, i.e. it defaults to unnamed tasks now.misc.Constnow allows to specify a module name.
Changes in 5.12.1 (released 12/09/2014)
Fixed a bug in
ll.oradd: Printing the final report failed when no commands where executed.
Changes in 5.12 (released 11/07/2014)
Fixed bugs in oracle URLs: the type
commentandcolumnare now skipped when iterating a user "directory". Content in theuserdirectory now works correctly.UL4ON has been reimplemented to be human-readable and more robust against modification of the dumped data. For generating UL4ON dumps with Oracle a PL/SQL package is available at https://github.com/LivingLogic/LivingLogic.Oracle.ul4
Changes in 5.11 (released 10/29/2014)
UL4 now supports sets, set literals and set comprehensions.
misc.javaexprnow supports sets.Sisyphus jobs have a new method
tasksthat loops over an iterable and callstaskfor each item:items = sys.modules.items() for (name, module) in self.tasks(items, "module", lambda kv: kv[0]): self.log("module is {}".format(module))An option
--maxemailerrorshas been added to sisyphus jobs: This options limits the number of exceptions and errors messages that will get attached to the failure email.An option
--setproctitlehas been added to sisyphus jobs: When this options is specified, the process title will be modified during execution of the job, so that thepscommand shows what the processes are doing. (This requiressetproctitlefrom the Cheeseshop.)
Changes in 5.10 (released 10/09/2014)
Old sisyphus logfiles can now be compressed automatically via
gzip,bzip2orlzma.The functions
misc.gzipandmisc.gunziphave been removed as Python 3.2 has the functions:gzip.compressandgzip.uncompresswhich work the same.
Changes in 5.9.1 (released 09/29/2014)
Fixed the precedence of the boolean
notoperator in UL4: Now it has a lower precedence than the comparison operators. i.e.not x in yis parsed asnot (x in y).
Changes in 5.9 (released 09/22/2014)
A script
udiffhas been added for doing line by line comparisons of two files or directories.udiffsupports all URLs thatll.urlsupports (e.g.sshandoracleURLs).The script
db2ul4has been renamed torul4. The following new features have been added: Additional variables can be passed to the UL4 template via the-D/--defineoption. Access to Oracle, SQLite and MySQL databases can be disallowed with the options--oracle,--sqliteand--mysql. Executing system commands can be disallowed with the option--system. SQL code that doesn't return results can be executed with the newConnectionmethodexecute. "out" parameters can now be used via variable objects that can be created with theint,number,str,clobanddatemethods.A new script
orareindexhas been added that can be used to rebuild/recreate all indexes and unique constraints in an Oracle database.All objects in
ll.orasqlthat represent objects in the database now have a methodexiststhat returns whether the object exists in the target database.ll.orasql.Indexhas a new methodrebuildddlthat returns SQL for rebuilding the index.URLs have a new
walkmethod that works similar to thewalkmethod for XIST trees:walkis a generator that returns aCursorobject that contains information about the state of the directory traversal and can be used to influence which parts of the directory hierarchy are traversed.The URL methods
listdir,files,dirsare generators now.The old URL method
walkhas been renamed towalkallandlistdir,files,dirs,walkall,walkfilesandwalkdirshave been enhanced:listdir,filesanddirsnow have argumentsincludeandexcludeinstead ofpattern(which worked likeincludedoes now). Also patterns can now be lists of strings.walkall,walkfilesandwalkdirsgained the same arguments. Additionally the argumentsenterdirandskipdircan be used to skip directories during traversal.Oracle URLs now support the methods
walk,walkall,walkfilesandwalkdirs(with the new argumentsinclude,exclude,enterdirandskipdir). The methodslistdir,filesanddirssupport the argumentsincludeandexclude.The various directory traversal methods in
ll.url.URLwill now output URLs in sorted order.URL.openfor Oracle URLs now supports theencodinganderrorsparameter.URLs no longer forward attribute access to unknown attributes to the connection to avoid problems with code that uses
hasattrto check for the presence of an attribute.Fixed handling of the current directory in
url.Dir:url.Dir("")now returnsURL('file:./').misc.SysInfohas a new attribute:script_urlreturns the name of the running script as ansshURL (e.g.ssh://user@www.example.org/~/project/script.py)The evaluation order of keyword arguments in calls to UL4 functions/templates has been fixed.
The test suite for UL4 now runs the Javascript versions of the templates not only on V8 but on Spidermonkey too.
Changes in 5.8.1 (released 06/18/2014)
The UL4 function
reprnow handles recursive lists/dicts similar to Pythonrepr(i.e. it doesn't raise an exception for infinite recursion).url.URLnow handles filenames containing spaces correctly when converting between URLs and filenames.
Changes in 5.8 (released 05/05/2014)
UL4 supports
whileloops now.misc.itemnow supports index sequences, which will be applied recursively, soitem(["foo", "bar"], (1, -1))returns'r'.A new context manager
misc.timeouthas been added, that usessignal.alarmto limit the runtime of the body of thewithblock.Updated the required version of
cssutilsto 1.0.Fixed the
oraddresetsequencecommand to really reset the sequence. The parametersminvalueandincrementare now optional. If missing they will be taken from the existing sequence.Passing the
clientinfoparameter tocx_Oracle.connectdoesn't work with Oracle 11.2.0.4.0 (leading to anORA-03113: end-of-file on communication channelerror). The methodorasql.connecthas been changed to set theclientinfoparameter after the connection has been established.Fixed cloning of plain XML attributes.
Fixed a bug in the C source code that broke compiling with Visual C. From now on we will have Windows installation packages again.
Changes in 5.7.1 (released 02/13/2014)
Fixed a bug in the script
oradiffthat resulting in the wrong order of the output.The
oraddcommandfilewill now create directories if they don't exist.
Changes in 5.7 (released 01/30/2014)
The
ll.oraddcommandfilehas been renamed toscp.The new
ll.oraddcommandfilewill now save the file directly from Python. A file mode, owner and group can be set.The JSON payload of the
ll.sisyphusfailure email will now be encoded in base64 format to work around a bug in the quoted-printable encoder.To conform to the Python 3 dictionary interface
ll.orasql.Record.iterkeyshas been renamed toll.orasql.Record.keysandll.orasql.Record.itervalueshas been renamed toll.orasql.Record.values. The original methodsll.orasql.Record.keysandll.orasql.Record.valueshave been dropped.
Changes in 5.6 (released 01/28/2014)
ll.oraddhas been updated to support variables and literal SQL in a more direct way. However the old method (via"keys"and"sql") is still supported, but will be removed in one of the next versions.The key
"args"is now optional for theoraddcommandsprocedureandsql.Support for oradd dumps in UL4ON format has been removed from
ll.oradd.Lines in an
oradddump starting with#will now be ignored.
Changes in 5.5.1 (released 01/27/2014)
ll.orasqlnow unterstands type bodies (so the scriptoracreatewill output them).
Changes in 5.5 (released 01/23/2014)
If expressions (i.e.
code if cond else code) have been added to UL4.The bitwise operators
&,|,^,~,<<and>>(and their agumented assigment counterparts&=,|=,^=,<<=and>>=) have been added to UL4.UL4ON now supports
sliceobjects.The
oraddscript has a new option-d/--directorythat is the base directory for file copy actions.oraddnow supports executing SQL directly.The project repository is hosted on GitHub now.
Changes in 5.4.1 (released 12/18/2013)
Use quoted printable encoding for the JSON attachment in the sisyphus failure email.
Changes in 5.4 (released 11/29/2013)
sshURLs now can handle any version of Python on the remote end. Theremotepythonparameter has been renamed topython.The default Python version for
sshURLs can now be specified with the environment variableLL_URL_SSH_PYTHON.
Changes in 5.3 (released 10/28/2013)
xist.parse.Tidycan now pass the XML declaration and the doctype to the application (however internal DTD subsets will be ignored).
Changes in 5.2.7 (released 10/15/2013)
orasql.Recordobjects are now instances ofcollections.Mappingand are handled correctly by UL4 now.
Changes in 5.2.6 (released 10/15/2013)
Attribute access has been fixed in UL4: For objects that supported the dictionary interface without being a dict, a
KeyErrorwas raised before instead of returning an "undefined" object.
Changes in 5.2.5 (released 10/09/2013)
starttimeandendtimeare now included in the JSON data sent with thesisyphusfailure report email too.
Changes in 5.2.4 (released 10/09/2013)
python_executableandpython_versionare now included in the JSON data sent with thesisyphusfailure report email.
Changes in 5.2.3 (released 10/09/2013)
The
taskcontext manager function insisyphusnow allows any UL4 compatible object for the task type and name not just strings orNone.
Changes in 5.2.2 (released 10/07/2013)
sisyphusnow doesn't reraise the exception if it was handled via email. This means that you will only get one email: either fromsisyphusor from your cron daemon. Exceptions that are not instances ofExceptionwill not be handled bysisyphus(i.e. you won't get an email when you press CTRL-C, but a normal stack trace).In case of a parse error in UL4 templates an exception will now be raised.
Changes in 5.2.1 (released 10/02/2013)
Fixed a bug in one of the UL4 templates for
sisyphus.
Changes in 5.2 (released 10/01/2013)
Added support for bound methods to UL4 templates. This means that methods that should be callable must be included in
ul4attrs.UL4 templates now support attribute, item and slice assignment, i.e. the following code will work:
<?code d = {}?><?code d.foo = 'bar'?> <?code d = {}?><?code d['foo'] = 'bar'?> <?code d = [17]?><?code d[0] = 23?> <?code d = [1, 7, 4]?><?code d[1:2] = [2, 3]?>For objects with attributes exposed to UL4, attributes can be specified as being writable by prepending the name with a
+inul4attrs.Added UL4 functions
firstandlastthat return the first or last item produced by an iterable.The default argument for the functions
misc.firstandmisc.lastnow defaults toNone. I.e. for empty iterators the default value will always be returned instead of generating an exception.ll.sispyhuscan now send an email itself in case of a failure. This email includes information about the failure in plain text, HTML and JSON format.ll.sispyhusnow supports subtasks via the methodtask. This replaces theprefixmethod.ll.sispyhusnow creates a relative symbolic link for the current logfile instead of an absolute one.oraddnow outputs the keys in its logging output.oraddcan now be used to reset sequences.Committing the transactions in
oraddcan now be done after each record with the new option--commit.--rollbackhas been removed.Renamed the attributes
scriptnameandshortscriptnameof themisc.sysinfoobject toscript_nameandshort_script_name.Fixed the user related attributes of
misc.sysinfo.
Changes in 5.1 (released 08/02/2013)
The HTML namespace (
ll.xist.ns.html) now supports microdata attributes.Added support for triple quoted strings to UL4 templates.
Added an UL4 function
sumthat works like the Python functionsum.Variables assigned in the body of a <?for?> loop in UL4 now survive the end of the loop. As a consequence of this, loop variables now leak into the surrounding scope (but not the loop variables for list/dictionary comprehensions or generator expressions).
Made checking for recoverable Oracle exceptions in
ll.nightshademore robust.Added missing processing instruction class
ll.xist.ns.ul4.note.ll.oraddnow prints the data object before trying to call the procedure and can handle foreign keys that areNULL.The methods
abslumandrellumofColorobjects are now exposed to UL4 templates.The
oraddscript has a new option--dry-runto rollback all database changes instead of committing them. This can be used to test whether anoradddump will work.oraddcan now copy files viascp. Parts of the file names used may depend on key values.oraddnow supports other out types than integers.The
querymethod for database connections indb2ul4scripts has changed: Instead of a query and a parameter dictionary, you have to pass in positional arguments that alternate between fragments of the SQL query and parameters. I.e.:db.query("select * from table where x=:x and y=:y", x=23, y=42)becomes:
db.query("select * from table where x=", 23, " and y=", 42)This makes
db2ul4independent from the parameter format of the database driver.
Changes in 5.0 (released 06/04/2013)
The HTML namespace (
ll.xist.ns.html) has been updated to support the current HTML5 definition.However old elements/attributes from the previous HTML namespace are still supported.
XIST now allows arbitrary elements and attributes.
ll.xist.parsewill parse any XML file, even if the pool object doesn't contain an element for the element name, and even if an attribute name isn't declared for an element.Undeclared elements will be "plain" instances of
ll.xist.xsc.Element(i.e. not instances of a subclass ofll.xist.xsc.Element) with the attributesxmlnsandxmlnameset accordingly and undeclared attributes will be "plain" instances ofll.xist.xsc.Attr(with properxmlnsandxmlnameattributes).This new feature requires several API changes which will be described below.
Validation is now off by default, to turn it on pass
validate=Truetoparse.treeorparse.itertreefor parsing, or the publisher object or thebytes,iterbytes,stringoriterstringmethods for publishing.Accessing an attribute via
__getattr__(i.e.htmlelement.attrs.class_) only works for attributes that are declared for the class, all other attributes must be accessed via__getitem__(i.e.htmlelement.attrs["class"]).__getitem__always requires the XML name of the attribute.__getitem__also allows an attribute name for a global attribute in Clark notation (i.e.htmlelement.attrs["{http://www.w3.org/XML/1998/namespace}lang"]). A global attribute can also be accessed via a (namespace name, attribute name) tuple (i.e.htmlelement.attrs[("http://www.w3.org/XML/1998/namespace", "lang")]). Using an attribute class or attribute object is also possible (i.e.htmlelement.attrs[xml.Attr.lang]orhtmlelement.attrs[xml.Attr.lang('de')]).Using
__setattr__to set attributes only works for declared attributes too. Using__setitem__to set attributes supports the same kind of arguments as__getitem__does. For declared attributes the resulting attribute object will always be an instance of the declared attribute class. For all other attributes it will be an instance ofll.xist.xsc.Attrexcept when an attribute class or instance is used as the key. In this case the attribute will be an instance of that class.The methods
convert,clone,__copy__,__deepcopy__,compacted,withsep,reversed,filtered,shuffled,mappedandnormalizedmake sure that plain nodes are copied properly, i.e. they retain their customxmlnsandxmlnameattributes.The keys in an attribute dictionary (i.e. an
ll.xist.xsc.Attrsobject) are no longer the attribute classes, but the (namespace name, attribute name) tuples:>>> node = html.div({xml.Attrs.lang: 'de'}, id='id42', class_='foo') >>> list(node.attrs.keys()) [('http://www.w3.org/XML/1998/namespace', 'lang'), (None, 'class'), (None, 'id')]For all methods that existed in Python/XML pairs (e.g.
withnamesandwithnames_xmlinxsc.Attrsorelementclassandelementclass_xmlinxsc.Pooletc.) there is only one version now: A method without the_xmlsuffix that accepts the XML version of the name.The method
checkvalidhas been renamed tovalidate. It no longer callswarnings.warnitself, but is a generator that returns the warning objects. Furthermore themodelobjects now get passed the complete path instead of only the target node (this is used to implement HTML5's transparent content model).Validating whether an attribute is allowed is now done in
Attrs.validateattr. The default implementation yields warnings about undeclared local attributes. The HTML5 namespace extends this to also accept any attribute whose name starts withdata-oraria-.Node comparison now ignores the classes for elements, entities and processsing instructions, so that plain nodes compare equal to instances of
Element,EntityorProcInstsubclasses as long as the name and content of the node matches.ll.xist.parse.Tidyno longer has askipbadargument.Converter contexts now support string as keys (which must be hierarchical dot-separated names similar to Java package names (e.g.
"org.example.project.handler") to avoid name collisions).The
docbookmodule has been updated to support DocBook 5.0.URLobjects are pickable now.When whitespace is removed in the literal text of UL4 templates (via the
keepwsparameter), any initial spaces (before the first line feed) are now no longer removed.If you have Cython installed and the environment variable
LL_USE_CYTHONset, several modules will now be compiled into extension modules.It's now possible to expose attributes and methods of objects to UL4 templates. Exposing attributes can be done by setting a class or instance attribute
ul4attrsto a sequence of attribute names. Exposing methods can be done with the decoratorsul4c.expose_methodandul4c.expose_generatormethod.A new UL4 function
listhas been added. This function works like the Python functionlist, creating a copy of a sequence or materialzing an iterator.A new UL4 function
slicehas been added. It works likeitertools.slice, i.e. returning a slice from an iterator.The function
html.astextthat converts an XIST tree containing HTML to plain text is now implemented in plain Python so it no longer requires a text mode browser. The function also got more configurable.The objects available to
db2ul4scripts have been changed:oracle,sqliteandmysqlare now objects with aconnectmethod that returns a connection object. A connection object now has a methodquerythat executes the query and returns an iterator over the results. Furthermorequerysupports keyword arguments for parameterized queries, i.e. you can now do:<?code db = oracle.connect("user/pwd@db")?> <?for row in db.query("select * from foo where bar = :bar", bar=42)?> <?print row?> <?end for?>The
systemobject now has anexecutemethod that executes the system command.Fixed a bug in
orasql.OracleFileResource.closethat surfaced when writing to on Oracle object.
Changes in 4.10 (released 03/04/2013)
It's now possible to use UL4 templates as functions by using the
<?return?>tag:>>> from ll import ul4c >>> f = ul4c.Template("<?return 2*x?>") >>> f(x=42) 84It's also possible to call a template as a function inside another template:
>>> from ll import ul4c >>> t = ul4c.Template("<?def x?><?return 42?><?end def?><?print x()?>") >>> t.renders() '42'Normal output of the template will be ignored if it is used as a function.
If the template runs through to the end without encountering a
<?return?>tag,Nonewill be returned if the template is used as a function.If the template is used as a template and a
<?return?>tag is encountered executing the template will be stopped (the return value will be ignored).The UL4 tag
<?code?>may now contain not only variable assigments, but any other expression. Of course this makes only sense for expressions that have side effects (e.g. a call to therendermethod).The tag
<?render?>has been removed. To update your code replace<?render r.render()?>with<?code r.render()?>.UL4 functions
printandprintxhave been added. They behave like the respective tags<?print?>and<?printx?>, but can output an arbitrary number of arguments.The builtin UL4 functions are now real objects that can be passed to templates as arguments.
The UL4 methods
days,seconds,microsecondsandmonthshave been added fortimedelta/monthdeltaobjects.Lists in UL4 now support the methods
append,insertandpop.Dictionaries in UL4 now support the method
update.The
db2ul4script now supports a-w/--keepwsargument.The UL4 functions
varsandgethave been removed.The
**syntax has been removed for UL4 dict literals.The automatic UL4 variable
stackhas been removed too.
Changes in 4.9.1 (released 01/17/2013)
Fixed a bug the
printxtag for UL4 templates.
Changes in 4.9 (released 01/17/2013)
Fixed a bug in UL4 templates when a template called a top-level template which in turn called its own subtemplate.
Fixed and enhanced
reproutput of UL4 templates and added support for IPythons pretty printing framework.
Changes in 4.8 (released 01/15/2013)
Linefeeds and indentation in the literal text for UL4 templates can now be ignored by specifying
keepws=Falsein the template constructor.
Changes in 4.7 (released 01/11/2013)
A variable
stackis now automatically defined in all UL4 templates. This list contains a stack of the currently executing UL4 templates.stack[-1]is the current template.UL4 templates now support lexical scopes. A locally defined subtemplate can access all local variables of the template in which it is defined.
UL4 functions and methods now support keyword arguments, e.g.
format(now(), fmt="%Y-%m-%d", lang="en").UL4 templates can no longer be converted to Java
CompiledTemplateobjects. (However converting it to anInterpretedTemplateis of course still supported).If the view
ctx_preferencesdoesn't existorasql.Preference.itername`now will simply return an empty iterator instead of failing with an Oracle exceptionORA-00942: table or view does not exist.For sisyphus jobs, the class attribute
maxtimecan now be set to adatetime.timedeltaobject.
Changes in 4.6 (released 12/18/2012)
The
walkmethod in XIST has been changed: The return value is a cursor object that provides information about the path and can be used to skip subtrees in the traversal. Filters (which are called selectors now) can no longer influence which parts of the trees are traversed, only whether a node is returned by the iterator or not.ll.xist.parse.itertreenow supports the same interface is thewalkmethod.A new function
xfind.filterhas been added that filters the output ofwalkoritertreeagainst aSelectorobject.The XIST parse events have been renamed: The
"start*"events to"enter*"and the"end*"events to"leave*".Slicing XIST elements now returns a sliced element, instead of a slice from the content
Frag:>>> from ll.xist.ns import html >>> html.ul(html.li(i) for i in range(5))[1:3].string() '<ul><li>1</li><li>2</li></ul>'
Functions with keyword only arguments are now supported in
ll.xist.ns.doc.explain.ll.misc.monthdeltanow supports theabsfunction (i.e.abs(monthdelta(-1))returnsmonthdelta(1).)
Changes in 4.5 (released 11/29/2012)
Added UL4 functions
anyandall.To improve UL4 exception messages there are now several undefined objects, which give information about which key/name/index resulted in the undefined object being created.
UL4ON can no longer read or write undefined values.
The UL4 function
formatnow swallows all exceptions produced bylocale.Oracle URLs now support reading and writing bytes.
Because of problems with distribute/pip and pytest
ll/__init__.pyhas been reintroduced.
Changes in 4.4 (released 11/08/2012)
Python 3.3 is required now (as the code uses
yield fromand__qualname__).ll/__init__.pyhas been removed, i.e. XIST is now a PEP 420 compatible namespace package.Fixed tab/space mix in
antlr3/debug.py.
Changes in 4.3.1 (released 11/06/2012)
Added a method
valuesto UL4 for dictionaries.Fixed a bug in
ll.misc.SysInfo.user_shell.Fixed function
ll.xist.ns.doc.explainfor methods.
Changes in 4.3 (released 11/02/2012)
UL4 now uses a parser generated by ANTLR instead of using spark. This means that the Python parser can now use the same grammar as the Java parser. (A Python 3 port of the ANTLR runtime is included).
Accessing non-existant variables in UL4 templates now no longer raises an exception but returns the special object
Undefined. The same is true for accessing non-existant dictionary keys or list/string indexes that are out of range.In a boolean context
Undefinedis treated as false andstr(Undefined)returns the empty string.Two new UL4 functions have been added:
isundefinedreturns whether the argument is theUndefinedobject or not.isdefinedhas the inverted logic, i.e. it returnsTrueif the argument is not theUndefinedobject.The characters CR and LF are no longer allowed in UL4 string constants. Furthermore the escape sequence
\eis no longer supported.All AST nodes for loading constants have been merged into a single class
Const.ll.ul4oncan now read and writedatetime.timedeltaandmisc.monthdeltaobjects as well as the newUndefinedobject from UL4 (ll.ul4c.Undefined).
Changes in 4.2 (released 10/22/2012)
UL4 templates now support list and dictionary comprehension as well as generator expressions.
A new UL4 function
datehas been added.The UL4 method
joinno longer callsstron the items in the argument list.The UL4 function format now supports a third argument: the language for formatting dates. So
format(date(2012, 10, 10), '%A', 'de')outputsMittwoch.UL4 date objects now have a new
weekmethod. This method returns the week number of the year. It supports one argument: the weekday number (0 for Monday, ... 6 for Sunday) that should be considered the start day of the week. All days in a new year preceding the first week start day are considered to be in week 0. The week start day defaults to 0 (Monday).datetime.timedeltaobjects are now completely supported in UL4 templates: They can be created with thetimedeltafunction and can be type tested for withistimedelta.Added a new class
ll.misc.monthdelta.monthdeltaobjects can be used to add months/years to adatetime.datetimeordatetime.dateobject. If the resulting day falls out of the range of valid days for the target month, the last day for the target month will be used instead.monthdeltaobjects are now supported in UL4 templates: They can be created with themonthdeltafunction and can be type tested for withismonthdelta.
Changes in 4.1.1 (released 10/04/2012)
Fixed a bug in the UL4 handling of slices. (
('0' + str(x))[-2:]didn't work correctly.)
Changes in 4.1 (released 10/02/2012)
Loop variable unpacking in UL4 now allows arbitrary nesting.
Variable assignment in UL4 now allows variable unpacking too, i.e.
(a, b) = [17, 23].The support for Growl notifications in
ll.makeon the Mac has been replaced by support for Mountain Lions Notification Center via terminal-notifier.sispyhusjobs now support notifications too.Java conversion of
ll.ul4c.Andhas been fixed to evaluate the second operand only when the result isn't clear from the first.ll.ul4on.Decodernow raises anEOFErrorwhen reading from an empty stream.A new script has been added:
oradd.pycan be used for importing data into an Oracle database (via procedure calls).
Changes in 4.0 (released 08/08/2012)
The source has been ported to Python 3. From now on XIST is a Python 3 only project. A big thanks goes to Martin v. Löwis, who got this conversion started at PyCon DE 2011. He did the basic
2to3conversion and updated the C source to work on Python 3. Without Martin, XIST wouldn't have made the leap to Python 3 for several years.As there's no Python 3 port of libxml2s Python wrapper, XIST now uses lxml for HTML parsing.
This change shouldn't have any visible consequences.
UL4 templates are no longer compiled to byte code, instead the AST is evaluated or converted to the target sourcecode directly.
Generating the final Javascript source code for UL4 templates is now done in Javascript itself.
A new module
ul4onhas been added. This module provides functions for encoding and decoding a lightweight extensible machine-readable text format for serializing the object types supported by UL4.The following new functions have been added to UL4:
isfirst,islast,isfirstlast,enumfl. They are variants ofenumeratethat give information about whether the item is the first and/or last item.The following new functions have been added to UL4:
urlquoteandurlunquote. They encode/decode the%-escaped form of URL query parameters.The UL4 function
jsonhas been renamed toasjsonand the following new UL4 functions have been added:fromjson,asul4onandfromul4on.The UL4 function
enumeratenow supports 1 or 2 arguments (the second argument being the start value).The UL4 functions
str,bool,intandfloatnow support being called without arguments (just like in Python).Date constants in UL4 have changed again. They are now written like this:
@(2012-04-12)or@(2012-04-12T12:34:56).The
<?render?>tag in UL4 now looks like a method call instead of a function call. I.e.<?render t(a=17, b=23)?>has changed to<?render t.render(a=17, b=23)?>.UL4 stacktraces now use exception chaining to report the exception location in nested templates.
The UL4 methods
findandrfindnow support lists and tuples.Two new UL4 functions have been added:
minandmax.The sort order for attributes when publishing XIST trees can be overwritten by setting the
xmlorderclass attribute to a string. This string will be used for sorting the attribute. Attributes that havexmlorderset will always be published before those that don't.Support for the old
ipipeinfrastructure has been removed. Support for IPythons new pretty printing infrastructure has been added. Output looks like this:In [1]: from ll.xist.ns import xml, html In [2]: html.a( ...: 'gurk', ...: xml.Attrs(lang='de'), ...: class_='link', ...: href='http://www.example.org/', ...: id='dings42', ...: ) Out[2]: ll.xist.ns.html.a( 'gurk', ll.xist.ns.xml.Attrs.lang='de', class_='link', href='http://www.example.org/', id='dings42')
Added the attributes
allowfullscreenandflashvarstoll.xist.ns.html.embed.Added the attribute
allowfullscreentoll.xist.ns.html.iframe.The
isdirmethod now always returnsFalsefor real (i.e. non-file or ssh) URLs. This allows stuff like:ucp http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2 \ ssh://user@www.example.org/~/src/ll.orasql.Indexnow uses the*_INDEXESviews to get a list of all indexes andLOBindexes are filtered out, since they will be recreated with the LOB itself. The methodtablehas been fixed for indexes that belong to a different user than the index.ll.orasql.LOBStreamhas a new methodseek.ll.make.FileActionsupports encoding/decoding when writing/reading the file. For this use theencodinganderrorsarguments.The XIST node method
sortedhas been removed, as it no longer makes sense, because with Python 3 nodes might be uncomparable.Th support for
%uescapes in URLs has been removed.The function
html.astextnow uses the newer links 2.The scripts
oracreate,oradrop,oradelete,oradiff,oramerge,oragrant,orafindanduhppno longer have an-e/--encodingoption. They always use Pythons output encoding.The options
-i/--inputencodingand-o/--outputencodingof the scriptdb2ul4have been replaced with an option-e/--encodingfor the encoding of the template files. For printing the result Pythons output encoding is used.The options
--inputencoding/--inputerrorsand--outputencoding/--outputerrorsofll.sisyphus.Jobhave been replaced with option--encoding/--errorsfor the encoding of the log files.oradiffnow iterates through the object in correct order, so if you're runningoradiffwith-mfullthe output shouldn't produce any errors when executed.ll.orasql.Indexcan now handle domain indexes.ll.orasql.Preferencehas been added.ll.orasqlnow ignores indexes of typeIOT - TOP.ll.orasqlcan now handle primary keys where the underlying index has a different name.ll.orasqlnow ignores tables with names starting withDR$(i.e. those created by Oracle Text Search).Attributes of
ll.misc.SysInfoinstances are now calculated on demand. With this change only one instance ofll.misc.SysInfois required. This instance isll.misc.sysinfo.When connecting to the database
ll.orasqlsets theclient_infoattribute to the name of the running script (unlessclientinfo=Noneis passed to theconnectcall).ll.xist.ns.specials.loremipsumnow repeats the text if the specifiedlenattribute is greater that the length of the lorem ipsum text.
Changes in 3.25 (released 08/12/2011)
ll.xist.parse.Tidywill now output the attribute events in sorted order. Publishing an XIST node will output the attributes in sorted order too.The
compactmethod has been renamed tocompactedto avoid collisions with thecompactattribute in HTML elements.A new script
uhpphas been added, that can be used for pretty printing HTML. As the attributes are output in alphabetical order it can also be used as a tool for comparing HTML files.
Changes in 3.24.1 (released 08/10/2011)
Fixed a bug in the new
ll.xist.xsc.AttrElementclass that surfaced in the context of boolean attributes.
Changes in 3.24 (released 08/09/2011)
The
ProcInstsubclassll.xist.xsc.AttrProcInsthas been replaced with anElementsubclassll.xist.xsc.AttrElement. Conditional handling of the attribute will be used, if theAttrElementinstance is the only child of the attribute. Outside of attributes theAttrElementinstance will be published normally (viapublish, which must be implemented).ll.xist.ns.ul4.attr_ifis anll.xist.xsc.AttrElementsubclass now. The condition is in thecondattribute and the attribute content is inside the element. Outside of an attributeattr_ifwill put a normal UL4ifcondition around its content.ll.xist.ns.ul4.attr_ifnnhas been removed.
Changes in 3.23.1 (released 07/28/2011)
Fixed a bug in
ll.sisyphus: The code wasn't updated to usell.ul4c.Templateinstead ofll.ul4c.compile.
Changes in 3.23 (released 07/20/2011)
UL4 template objects now have a name. This name will be displayed in exception messages. Nested templates display their own name in the exception message.
The module global functions
ll.ul4c.compile,ll.ul4c.loadandll.ul4c.loadshave been removed. Instead of them theTemplateconstructor and the class methodsloadandloadscan be used.The script
oradeletenow supports the options--include,--excludeand--keepjunktoo.
Changes in 3.22 (released 07/14/2011)
The scripts
oracreate,oradropandoragranthave new options--includeand--excludethat can be used to filter the objects that will be output.
Changes in 3.21 (released 06/03/2011)
Oracle 10 doesn't have a
DBA_ARGUMENTSview. Fixedll.orasql.Functionandll.orasql.Procedureaccordingly.The
typeattribute for theinputelement now supports the new input types from HTML5.The form elements
input,selectandtextareagained the additional attributes from HTML5.
Changes in 3.20.2 (released 05/23/2011)
Unicode parameters in
executeandexecutemanyinll.xist.orasqlnow get encoded to the Oracle client character set.
Changes in 3.20.1 (released 05/18/2011)
Fixed a bug in the Java code generation for UL4 templates: When the template source code contained C-style comments (i.e.
/* foo */) invalid Java source code was produced.
Changes in 3.20 (released 05/05/2011)
It's now possible to specify the connection mode (i.e.
SYSDBAandSYSOPER) inoracleURLs like this:$ uls oracle://sys:pwd:sysdba@dsn/
Supported are the values
normal(the default),sysdbaandsysoper.The
schemaargument used by various methods inll.orasqlhas been replaced by aownerargument that can beNone(for the current user), the constantALLfor all users (which uses theDBA_*variant of various meta data views if possible or theALL_*variants otherwise) and a specific user name.These views are also used if possible in all spots where the
ALL_views where used before.It's now possible to list all users in the database with the class methods
User.iternamesandUser.iterobjectsand withConnection.iterusers.Oracle
Columnobjects have a new methodtablethat returns the table the column belongs to.Oracle URLs now support the directory
user/which contains all users, i.e.oracle://user:pwd@db/user/lists all users andoracle://user:pwd@db/user/foo/lists the same stuff asoracle://foo:pwd@db/. This directory however will not be listed in the root directoryoracle://user:pwd@db/.ll.orasqlnow supports tables without columns.ll.orasql.Tablehas a new methodpkthat returns the primary key contraint (orNoneif the table has now primary key contraint).A bug in the queries for
Indexobjects inll.orasqlhas been fixed.ipipesupport has been removed fromll.orasql.Fixed a bug in
ll.xist.xsc.Pool: Registered elements/entities etc. now show up as attributes of the pool object.
Changes in 3.19 (released 04/26/2011)
ll.orasqlnow requires cx_Oracle 5.1.If the
readlobsoption is false forll.orasqlcursors, the CLOBs/BLOBs returned will be wrapped into something that behaves like a Python file.
Changes in 3.18.1 (released 04/13/2011)
The methods
elements,procinsts,entitiesandcharrefsofll.xist.xsc.Poolnow handle base pools properly.
Changes in 3.18 (released 04/08/2011)
Fixed a regression in
ll.orasql.OracleConnection.Fixed
ZeroDivisionErrorin scriptulsfor empty directories.Added a class method
ll.orasql.Contraint.iternamesand a class methodll.orasql.Index.iternamesthat skips those indexes that are generated by constraints. With this additionuls/ucpnow list/copy constraints and indexes properly. Alliternamesmethods now skip objects whose name starts withBIN$.The scripts
uls,ucpanducathave new options--includeand--excludefor including/excluding URLs that match a regular expression. They also have an new option--allto include/exclude dot files (i.e. files/directories whose name starts with a dot)ucpnow supports to new options--paddingand--separatorwhich are used for column output.Two unused options were removed:
--verbosefrom the scriptucatand--defaultsfrom the scripttld2xsc.ucp -xnow prints exception details.The variables available in UL4 templates used by
db2ul4have changed. Instead of aconnectobject, there are now three objects for each supported database (i.e.oracle,sqliteandmysql)The script
doc2txtnow reads fromstdinand writes tostdoutinstead of requiring file names on the command line.If the scripts
xml2xscordtd2xscare called without argumentsstdinis read.ll.xist.ns.restnow handles option lists.The Oracle URLs provided by
ll.orasqlnow have a.sqlextension for all schema objects. On writing a.sqlextension will be stripped to get the name of the schema object.Oracle URLs now should support schema objects with fancy names (i.e. ones that contain accented characters).
ll.orasql.Tablehas a new methodorganizationthat returns"heap"or normal tables and"index"for index organized tables.Pretty printing of XIST trees can now be customized with the class attributes
prettyindentbeforeandprettyindentafter. The values will be added to the current indentation level before and after the node in question.All scripts that are part of XIST (
uls,ucp,ucat,db2ul4,dtd2xsc,tld2xsc,doc2txt,xml2xsc,oracreate,oradrop,oradelete,oradiff,oramerge,oragrantandorafind) are now properly documented on the webpages.
Changes in 3.17.3 (released 03/02/2011)
Enhanced support for table and column names containing non-ASCII characters in
ll.orasql.Fixed a bug in the
ulsscript: In long recursive mode files were printed twice.
Changes in 3.17.2 (released 02/25/2011)
Fixed
setup.pyso that the spacer GIF and the UL4 Javascript support library really get installed.
Changes in 3.17.1 (released 02/25/2011)
Due to a bug in
MANIFEST.inthe spacer GIF and the UL4 Javascript support library where not included in the distirbution package. This has been fixed.
Changes in 3.17 (released 02/24/2011)
The UL4 function
reprnow handles all instances ofcollections.Mappingandcollections.Sequencetoo.The spacer pixel
px/spc.gifand the UL4 Javascript support libraryul4.jswill now be installed alongside the Python modules (inll.xist.data).The Java source code produced by
ll.ul.Template.javasourcewill now contain register declarations only for the registers that are actually used.misc.javastringhas been renamed tomisc.javaexprcan can now produce the Java sourcecode for more types.The UL4 method
isoformatnow omits the time part if it is00:00:00.The UL4 function
reprnow produces a valid UL4 date literal for date objects.The UL4 method
formatis now a function instead.The tests for UL4 now test the Java implementation too.
Changes in 3.16 (released 01/21/2011)
The UL4 functions
json,type,islistandisdictcan now handle all instances ofcollections.Mappingandcollections.Sequencenot justtuple,listanddict.ll.sisyphuslogging of exceptions and tracebacks should be more robust against encoding problems.The
cssutilsversion has been bumped to 0.9.7.dtd2xsc.pycan now combine the content of more than one DTD into a namespace. Handling of duplicate elements can be specified with a newduplicatesoption.xml2xsc.pycan now collect the XML info from multiple XML files.Fixed a bug in the command line argument handling of
dtd2xsc.py.dtd2xsc.pycan now handle undefined entities.The help message for all scripts in XIST now show the default for all options.
Replaced the function
misc.flagwith a classmisc.FlagActionthat can be used as the action inargparse.ArgumentParser.add_argumentcalls.Command line options for all scripts have been enhanced: Flags without a
yes/novalue now toggle the default (using the newmisc.FlagAction).The script
xml2xsc.pyhas a new option--defaultxmlnsfor setting a namespace name for elements without a namespace.ll.xist.xndand the related scripts have seen some refactoring.
Changes in 3.15.3 (released 11/26/2010)
ll.sisyphusnow supports a non-forking mode (--fork=no). In this mode executing the job and monitoring the maximum runtime is done by the same (single) process.
Changes in 3.15.2 (released 11/25/2010)
Publishing an
ll.xist.ns.xml.XMLobject will now always put the correct encoding into the XML declaration, no matter where in the XML tree thexml.XMLobject sits.
Changes in 3.15.1 (released 11/24/2010)
Fixed a bug in the error handling code of the UL4 compiler when an unknown function or method was encountered.
Fixed str/unicode problems with the search string in
orafind.py.
Changes in 3.15 (released 11/09/2010)
It's now possible to create Java source code from UL4 templates with the method
ll.ul4c.Template.javasource.Creating source code (in Python, Javascript and Java) from UL4 templates has been moved out of
ll.ul4c.Templateinto separate classes.The function
ll.xist.ns.fromul4now uses the new methodll.ul4c.Template.javasourcefor generating JSP.The binary format for UL4 templates has changed to enhance readability.
ll.xist.ns.jsp.javastringhas been moved toll.misc.
Changes in 3.14 (released 11/05/2010)
UL4 templates now have a method
jssourcethat returns Javascript source code. This means that now UL4 templates can be converted to: Python source code, JSP source code and Javascript source code.Date constants in UL4 have changed. They are now written like this:
@2010-11-05T.ul4c.Template.pythonsourceno longer acceptsNoneas the function name. The output will always be a full function.
Changes in 3.13 (released 10/22/2010)
sisyphus jobs now have a new method
prefix. This method is a context manager. For the duration of thewithblock, the passed in prefix will be prepended to all log lines.ll.sisyphusjob can now log tostdoutandstderrwith the new options-o/--log2stdoutand-e/--log2stderr.The tags that
ll.sisyphusitself uses for logging have changed slightly. For more info see the module documentation.The option
-lfor sisyphus jobs has been renamed to-f.
Changes in 3.12.1 (released 10/21/2010)
Fixed a bug in
ll.sisyphuswhen logging exceptions.
Changes in 3.12 (released 10/21/2010)
The way that
ll.sisyphushandles running jobs has changed. Jobs no longer create a pid file. Avoiding duplicate running jobs is done with a file lock on the script file and limiting the maximum runtime is done by forking the process and monitoring the runtime in the parent process. This means that a job that is past its maximum allowed runtime will not be killed by the next job invocation. Instead the job will kill itself.A new class
ll.misc.SysInfohas been added that provides host/user/python/script information.ll.sisyphususes this new class.Changed the default output of tags in
ll.sisyphuslog files from:[tag1, tag2, tag3]
to:
[tag1][tag2][tag3]
The default location for
ll.sisyphuslog files has changed to~/ll.sisyphus/projectname/jobname/.ll.orasql.ForeignKeyhas a new methoditercolumnsfor iterating over the columns the foreign key consists of.Fixed a bug in the
ulsscript: For remote URLs uid and gid must be resolved on the remote host.
Changes in 3.11.1 (released 10/18/2010)
Fixed two bugs in the error handling for unknown XML parsing events in
ll.xist.parse.Expat.__call__andll.xist.parse.SGMLOP.__call__(exceptions were yielded instead of raised).ll.sisyphusjobs now don't break if they can't find the script source.
Changes in 3.11 (released 10/15/2010)
ll.sisyphushas been rewritten. The new version supports: One log file per job invocation; enhanced configuration for logging; command line arguments.Various attributes of UL4 templates are exposed to UL4 itself.
Fixed a bug in
ll.url.LocalConnection.rename.
Changes in 3.10.1 (released 10/13/2010)
Fixed bugs in the handling of the
defandenddefopcodes inll.xist.ns.jsp.fromul4.Fixed a bug in the handling of the
rendermethod inll.xist.ns.jsp.fromul4.
Changes in 3.10 (released 09/24/2010)
Python 2.7 is required now as XIST now uses set literals, set and dict comprehension, the new
argparsemodule and various other new features of Python 2.7.All scripts and
ll.makehave been ported to useargparse.Fixed a bug in
ll.nightshade. If the function/procedure didn't set an encoding, the handling of the response body was totally broken (which resulted in a ISO-8859-1 encoded output).ll.xist.parse.Tidynow supports an additional parameter: Ifskipbadis true, unknown elements and attributes will be skipped.The random number functions
random,randrangeandrandchoicehave been added to UL4.A new function
ll.misc.prettycsvhas been added. It can be used to pretty print the data produced by thecsvmodule.
Changes in 3.9 (released 08/04/2010)
ll.xist.ns.html.htmlwill no longer change thelangandxml:langattributes. This functionality has been moved to the new elementll.xist.ns.htmlspecials.html. Furthermore this new element won't change existing attributes.ll.xist.ns.html.titleno longer does any manipulation of its content.The Java string literal formatting function in
ll.xist.ns.jsphas been exposed asjavastring.Fixed a bug in
oracreate.py: If the source of procedures and functions didn't have whitespace between the name and the(the(was missing from the output.
Changes in 3.8.3 (released 07/29/2010)
strarguments are now always treated asBLOBs inll.orasqlfunctions and procedures.
Changes in 3.8.2 (released 06/21/2010)
Fixed a bug in the logging methods of
ll.sisyphus.Job: Logging unicode strings didn't work. Now all strings are promoted to unicode.The default encoding for
ll.sisyphuslog files has changed to UTF-8. This can be changed by setting the class attributeencodingin the class derived fromll.sisyphus.Job.
Changes in 3.8.1 (released 06/17/2010)
The method
ll.url.URL.import_that had been dropped in version 3.8 has been reintroduced. However internallymisc.moduleis used for creating the module object. A side effect of this is that importing from non-local URLs now works:>>> from ll import url >>> u = url.URL("http://www.livinglogic.de/Python/misc/index_module.py") >>> m = u.import_() >>> m.last("gurk") "k"
Changes in 3.8 (released 06/15/2010)
The parsing infrastructure has been completely rewritten to be more modular and to support iterative parsing (similar to ElementTree).
Now parsing XML is done in a pipelined approach that looks like this:
>>> from ll.xist import xsc, parse >>> from ll.xist.ns import html >>> doc = parse.tree( ... parse.String("<a href='http://www.python.org/'>Python</a>") ... parse.Expat() ... parse.NS(html) ... parse.Node(pool=xsc.Pool(html)) ... ) >>> doc.bytes() '<a href="http://www.python.org/">Python</a>'Iterative parsing looks like this:
>>> from ll.xist import xsc, parse >>> from ll.xist.ns import xml, html, chars >>> for (evtype, path) in parse.itertree( ... parse.URL("http://www.python.org/"), ... parse.Expat(ns=True), ... parse.Node(pool=xsc.Pool(xml, html, chars)), ... filter=html.a/html.img ... ): ... print path[-1].attrs.src, "-->", path[-2].attrs.href http://www.python.org/images/python-logo.gif --> http://www.python.org/ http://www.python.org/images/trans.gif --> http://www.python.org/#left%2Dhand%2Dnavigation http://www.python.org/images/trans.gif --> http://www.python.org/#content%2Dbody http://www.python.org/images/donate.png --> http://www.python.org/psf/donations/ http://www.python.org/images/worldmap.jpg --> http://wiki.python.org/moin/Languages http://www.python.org/images/success/tribon.jpg --> http://www.python.org/about/success/tribon/The XIST element
ll.xist.ns.specials.zhas been moved to thell.xist.ns.docmodule.The function
ll.xist.xsc.docprefixeshas been dropped. A new functionll.xist.xsc.docpoolhas been added.The module
ll.xist.parsershas been renamed toparse.The module
ll.xist.presentershas been renamed topresent.The classes
ll.xist.converters.Converterandll.xist.publishers.Publisherhas been moved toll.xist.xsc. The modulesll.xist.convertersandll.xist.publishersno longer exist.The walk methods
walknodeandwalkpathhave been renamed towalknodesandwalkpathsand the implemention has been moved from the nodes classes intoWalkFilter.WalkFilterhas been moved toll.xist.xfind.A new selector has been added to
ll.xist.xfind:AnySelectoroutputs all nodes.Added a new function
misc.modulethat creates a module from source code.ll.url.Pathhas been simplified: Path segments are strings instead of tuples now.The old
URLmethodimport_has been removed. The new functionmisc.modulecan now be used for that.The two classes
ll.make.PoolActionandll.make.XISTPoolActionhave been dropped. You can usemake.ObjectAction(misc.Pool).call()andmake.ObjectAction(xsc.Pool).call()for that.The class
XISTParseActionhas been removed. This action can be replaced by a combination ofObjectAction,CallActionandCallAttrAction.Two new UL4 functions
absandutcnowhave been added.A few methods have been added to UL4 date objects:
mimeformat,day,month,year,hour,minute,second,microsecond,weekdayandyearday.Use autoboxing in the Java code generated by
ll.xist.ns.jsp.fromul4.All code has been switched to using the
formatmethod instead of using the%operator.ssh URLs in
ll.urlnow use the standaloneexecnetpackage.ssh URLs now support a
niceargument instead ofssh_config.
Changes in 3.7.6 (released 05/14/2010)
Fixed a bug in
ll.xist.ns.htmlspecials.autopixel.
Changes in 3.7.5 (released 04/19/2010)
ll.orasql.PrimaryKeyhas a new methoditercolumnsthat returns an iterator over the columns this primary key consists of.
Changes in 3.7.4 (released 03/25/2010)
Fixed a bug in
ll.xist.ns.rss20.guid. TheisPermaLinkattribute was aURLAttr, but must be aTextAttr.
Changes in 3.7.3 (released 02/27/2010)
Fixed a bug in the generated JSP code for the
defopcode inll.xist.ns.jsp.fromul4.
Changes in 3.7.2 (released 02/26/2010)
Fixed two bugs in the XML codecs:
An externally specified encoding wasn't honored in the incremental decoder.
Fixed reset() for incremental codecs: If encoding has been changed during parsing in the incremental codecs it now gets reset to its proper initial value.
Fixed a bug in the handling of the UL4 opcode
addlistinll.xist.ns.jsp.fromul4.Added missing processing instruction class for the UL4
deftag to thell.xist.ns.ul4namespace module.The generated JSP code for the
loadvaropcode now uses the Java methodUtils.getItem, so that non-existent variables no longer get treated asNone/null.
Changes in 3.7.1 (released 02/08/2010)
ll.xist.ns.jsp.fromul4now outputs the correct code for calling theformatmethod on date objects (This requires version exp-22 of the UL4 Java package).
Changes in 3.7 (released 09/10/2009)
In UL4 templates it's now possible to define locale templates via
<?def tmpl?>templatecode<?end def?>.Python 2.6 is required now.
ll.orasqlandll.nightshadeare now part of the distribution.ll.makehas a new Action class:ObjectActionsimply returns an existing object.The following classes have been removed from
ll.make:EncodeAction,DecodeAction,EvalAction,GZipAction,GUnzipAction,JavascriptMinifyAction,XISTBytesAction,XISTStringAction,JoinAction,UnpickleAction,PickleAction,TOXICAction,TOXICPrettifyAction,SplatAction,UL4CompileAction,UL4RenderAction,UL4DumpAction,UL4LoadAction,XISTTextActionandXISTConvertAction. All of these actions can be executed by usingCallActionorCallAttrAction.ll.make.PipeActionhas been renamed toTransformAction.The new
ll.make.PipeActionpipes the input through an external command.ll.make.FileActionnow automatically wraps thekeyargument into anURLobject.ll.make.FileActionhas two new methodschmodandchownthat return aModeActionandOwnerActionfor modifying the file created by theFileAction.ll.make.Actionhas three new methods:call,getattrandcallattrcreate aCallAction,GetAttrActionorCallAttrActionobject respectively.The division operator is no longer implemented for
Actionobjects inll.make.Two new UL4 functions have been added:
floatandiscolor.Two new scripts have been added:
ulscan be used to list any directory given as an URL.ucatcan be used to output any file or directory.The script
ucpnow changes the user and group only if a user or group is given.A bug in the 64-bit support for
sgmlophas been fixed.Fixed a bug in the remote
statmethod for ssh URLs (it seems that theposix.stat_resulttuple objects can no longer be pickled).There's a new function
misc.itersplitatfor splitting a string at specified positions.For ssh URLs a keyword argument
ssh_configis supported now instead ofidentity(This mirrors the corresponding change in the py library)
Changes in 3.6.6 (released 07/09/2009)
Fixed handling of empty pid files in
ll.sisyphus(Fixes issue #11 reported by Jarek Zgoda).
Changes in 3.6.5 (released 06/02/2009)
Fix UL4 templates that produce no output: As the generated Python sourcecode didn't contain any
yieldstatements, the resulting function was an ordinary function instead of a generator.
Changes in 3.6.4 (released 03/19/2009)
A new UL4 method
joinhas been added. It works like the Python string method join.ll.mischas three new functions:gzipundgunzipcan be used for compressing and uncompressing byte strings with gzip.jsmincan be used to minify Javascript source.Parsing an empty string with
tidy=Trueinll.xist.parsers.parsestringnow works again.
Changes in 3.6.3 (released 03/02/2009)
The xfind operators
attrhasvalue,attrhasvalue_xml,attrcontains,attrcontains_xml,attrstartswith,attrstartswith_xml,attrendswith,attrendswith_xml,hasidandhasclassnow support multiple values. The operator matches the node if it matches with any of the given values.A new function
reversedis now available in UL4 templates. It returns an iterator that will output the items of any sequence in reverse order.
Changes in 3.6.2 (released 02/16/2009)
Inside UL4 templates rendering other templates can now be done with the new
rendermethod. This method returns the template output as a string. Passing parameters can be done via keyword arguments or with the**syntax like when using therendertag.A new version of the
intfunction has been added to UL4: When called with two arguments, the first must be a string, and the second is treated as the base for the conversion.
Changes in 3.6.1 (released 01/27/2009)
Generating the Python source from an UL4 template is now 20-25% faster.
Fixed a buffer overrun in the C portions of the url module.
Added a class
addattrtoll.xist.xsc. This can be used to extend XML attributes viawithblocks.Added the function
ll.xist.ns.jsp.fromul4which can turn an UL4 template into JSP source code.
Changes in 3.6 (released 12/31/2008)
The following
Colorclass methods have been dropped:fromrgba,fromrgba4,fromrgba8,fromint4,fromint8.The following
Colorproperties have been dropped:r4,g4,b4,a4,r8,g8,b8,a8,r,g,b,aint4,int8,rgb4,rgba4,rgb8, andrgba8. The new methodsr,g,bandareturn the 8 bit component values.The class methods
fromhsvaandfromhlsahave been renamed tofromhsvandfromhls.The property
csshas been dropped. Instead the CSS string is returned by__str__.Dividing colors now does a scalar division. Blending colors is now done with the modulo operator.
Support for color objects has been added to UL4.
The XPIT templating language and
ll.make.XPITActionhave been removed.Fixed a bug in
ll.make.CacheAction.get: The action must return real data when called withbigbangas the timestamp.ll.make.UL4RenderActionhas been fixed.
Changes in 3.5 (released 12/05/2008)
A new function
jsonhas been added to UL4: This function returns a JSON dump of the object passed in (this requires eithersimplejsonor Python 2.6).The UL4 function
csvescapehas been renamed tocsv.A new option
--showregistration/-rhas been added to make scripts.ll.makenow supports Growl notifications on Mac OS X. To activate it set theLL_MAKE_GROWLenvironment variable to1or use the-gor--growloptions.ll.makehas a new action classJavascriptMinifyActionfor minimizing Javascript source.ll.color.Colorhas been rewritten to create immutable objects with the components being 8 bit values (i.e. 0-255) instead of floating point values between 0 and 1. An alpha component has been added.A
strongelement has been added to thell.xist.ns.docnamespace.
Changes in 3.4.4 (released 09/16/2008)
Fixed a bug in
ll.make.JoinAction.execute.
Changes in 3.4.3 (released 09/09/2008)
css.applystylesheetscould no longer handle style declarations containing comments. This has been fixed now.
Changes in 3.4.2 (released 09/03/2008)
Parsing didn't work when
tidywas set to true and abaseargument was given. This has been fixed now.
Changes in 3.4.1 (released 08/29/2008)
Bugs with thread local storage have been fixed so using
xsc.Pool,xsc.buildand URL contexts inwithblocks in multithreaded applications should work now.
Changes in 3.4 (released 08/19/2008)
Templates can no longer be passed as a separate dictionary to UL4 templates but are passed as variables like other data objects too.
Strings in UL4 have gained a new method
capitalize.Printing XML escaped strings in UL4 has now gained its own tag and opcode.
<?printx foo?>is equivalent to<?print xmlescape(foo)?>.Exception handling in UL4 has been rewritten to allow proper error reporting when calling nested templates.
UL4 has gained a new function
zip. It can be called with two or three arguments and does whatitertools.zipdoes.UL4 has gained another new function:
typereturns the type of its argument as a string.UL4 now supports tuple unpacking in
<?for?>tags with three variables.UL4 has a new tag for comments:
<?note This is comment?>.A new script
db2ul4.pyhas been added that can render UL4 templates with database content.In UL4s
<?render?>tags it's now possible to pass along a complete argument dictionary via the**argsyntax just like in Python. This syntax can even be used multiple times in the call. This syntax is available in dictionary literals too, i.e.{1:2, 3:4}and{**{1:2}, **{3:4}}are equivalent.A new UL4 function
gethas been added that works similar to the dictionary methodget, but works with global variables.The missing processing instruction
renderhas been added toll.xist.ns.ul4.xml_codecnow partially works, even if the C module is missing. As long as you explicitly specify an encoding on parsing and publishing it should work.A new processing instruction class
ll.xist.AttrProcInsthas been introduced. When anAttrProcInstnode is the first node in an attribute, it takes over publishing of the attribute. In all other cases the processing instruction disappears completely. UL4 uses this to implement "conditional attributes" (via the new classesattr_ifandattr_ifnn).Building trees with
withblocks has changed slightly. Nodes used inwithblocks and with+are now passed to awithhandler instead of building the tree directly. This fixes a problem when nestedconvertcalls usewithblocks.The element
ll.xist.ns.form.memohas been renamed totextareaandll.xist.ns.form.edithas been renamed totext. Classesll.xist.ns.form.buttonandll.xist.ns.form.filehave been added.Iterating through the inputs in
ll.makeactions has been fixed (i.e. the additional inputs will be output too).ll.make.Project.findpathshas been fixed to work with non-ll.make.Actioninputs. (This means that now you have to pass a real registered target action tofindpathsnot just its key).ll.makehas gained a new action:XISTStringActionpublishes an XIST node as a unicode string.XISTPublishActionhas been renamed toXISTBytesAction.Fixed a bug in the caching logic in
ll.make.CacheAction.ll.make.CallMethActionhas been renamed toCallAttrActionbecause it can be used to e.g. call functions in a module too.The properties
showaction,showstepandshownoteofll.make.Projectobject can now be assigned booleans as well (which results in all or no actions being shown.The version number for
cssutilshas been bumped to 0.9.5.1.
Changes in 3.3.2 (released 07/15/2008)
Dictionaries in UL4 have gained a new method
get.The version number for
cssutilshas been bumped again (to 0.9.5rc2 or a later 0.9.5 version).Fixed a bug in the parsing of slice expressions in UL4.
ll.makehas gained a newUL4RenderActionaction.Fixed a bug in the formatting for the
getslice2opcode for UL4.
Changes in 3.3.1 (released 07/14/2008)
Fixed a bug in the implementation of the "not" operator in UL4.
When the UL4 compiler encounters unclosed blocks, it will now include the start location of the block in the error message.
Changes in 3.3 (released 07/11/2008)
XIST has gained its fourth templating language:
UL4the "Universal Layout Language". This templating language is similar in capabilities to Djangos templating language. HoweverUL4templates are compiled to a bytecode format, which makes it possible to implement template renderers in other languages and makes the template code "secure" (i.e.template code can't open or delete files).ll.makehas gained new actions:GZipAction,GUnzipAction,CallFuncAction,CallMethAction,UL4CompileAction,UL4DumpActionandUL4LoadAction.The version number for
cssutilshas been bumped to 0.9.5rc1.Nodes of type
ll.xist.xsc.Commentandll.xist.xsc.DocTypeinside of attributes are now simply ignored when publishing instead of generating an exception.All actions in
ll.makeno longer check whether their inputs are action objects. Non-action objects are simply treated as ancient input data. This also means that most action classes have aninputparameter in their constructor again, as this input could now be a constant.Most attributes of action objects in
ll.makecan now be action objects themselves, so for example the name of the encoding to be used in anEncodeActioncan be the output of another action.ll.make.ImportActionhas been dropped as now the module object can be used directly (e.g. as the input for anXISTPoolActionobject).ll.misc.xmlescapenow escapes'as'for IE compatibility.Functions
ll.misc.xmlescape_textandll.misc.xmlescape_attrhave been added that implement the functionality from XIST 3.2.5 and earlier.The default parser for XIST is expat now. To switch back to sgmlop simply pass an
SGMLOPParserobject to the parsing functions:>>> from ll.xist import parsers >>> node = parsers.parsestring("<a>", parser=parsers.SGMLOPParser())TOXIC has been split into a compiler module
ll.toxiccand an XIST namespacell.xist.ns.toxic. TOXIC now supports output for SQL Server. The functionxml2oraas been renamed tocompile(and has a newmodeargument for specifying the database type).The
targetrootparameter forll.make.XISTConvertAction.__init__has been renamed toroot.
Changes in 3.2.7 (released 05/16/2008)
Added the missing file
_misc_include.cto the distribution archives.
Changes in 3.2.6 (released 05/07/2008)
A new action class
EvalActionhas been added toll.make.ll.xist.helpers.escapetextandll.xist.helpers.escapeattrhave been merged into one function that escapes all special characters (including'and") and has been renamed/moved toll.misc.xmlescape.Python versions of all the functions in the module
ll.mischave been added. Those versions will be used in case the C module is not available.
Changes in 3.2.5 (released 04/11/2008)
A refcounting bug in the attribute parsing code of
sgmlophas been fixed.The helper function
cssescapereplacehas been removed, as it's no longer needed.Pure Python versions of
helpers.excapetextandhelpers.escapeattrhave been added, in case the C module is not available.
Changes in 3.2.4 (released 04/02/2008)
The following functions have been added to
ll.xist.css:parsestring,parsestream,parsefile,parseurlandwrite. They parse CSS resources and are similar to the XML/HTML parsing functions in that they apply the specified base URL to all URLs in the style sheet.cssutils0.9.5b2 is required now.ll.xist.css.iterrulesandll.xist.css.applystylesheetsnow support specifying whether the preferred stylesheets or an alternate stylesheet group should be used.ll.xist.xsc.ProcInst.__mul__andll.xist.xsc.ProcInst.__rmul__now return a fragment containing the node repeated a number of times instead of one processing instruction node containing repeated content.The constructor for
ll.xist.parsers.ExpatParsernow takes two additional arguments:xmldeclIf this is true the XML declaration will appear in the resulting XIST tree.
doctypeIf this is true the doctype declaration will appear in the resulting XIST tree (however any internal DTD subset will be dropped).
Changes in 3.2.3 (released 03/04/2008)
cssutils0.9.5 is used now. This simplifies the implementation ofcss.selector.A function
ll.xist.css.geturlshas been added. This returns a list of all the URLs in acssutilsstylesheet.toxic.xml2oranow treats unknown processing instructions as text. This makes it possible to e.g. output an XML header via toxic.The pseudo-elements in
ll.xist.ns.jspare no longer in a namespace, so they will always be published without any prefixes.
Changes in 3.2.2 (released 02/25/2008)
A new method
replaceurlshas been added toll.xist.xsc.StyleAttr. With this method all URLs in astyleattribute can be replaced.Fixed a bug in
ll.xist.parsers.SGMLOPParser.begin: The encoding wasn't passed properly to the XML decoder.ll.xist.xsc.ProcInst.publishnow calls thecheckvalidmethod too.
Changes in 3.2.1 (released 02/05/2008)
It's now possible to force the publisher to output certain
xmlnsattributes via theshowxmlnsargument to thePublisherconstructor.
Changes in 3.2 (released 02/01/2008)
The core package has been moved into XIST, installing XIST now only requires one package.
ll.toxichas been moved into XIST and is now available asll.xist.ns.toxic.When a
ll.make.XISTParseActionobject is executed the content of the pool will now be extended by the content of the pool from theXISTPoolActioninstead of being replaced.ll.make.Poolandll.xist.xsc.Poolno longer use aWeakValueDictionary, but a simpledict. This means they can now store any object. A methodclearhas been added, which removes all registered objects.Fixed a bug in
ll.xist.css.iterrulesthat surfaced when abaseargument was given.Fixed a second bug in
ll.xist.css.iterruleswhere thehrefof alinkelement wasn't applied to the URLs in the stylesheet.
Changes in 3.1 (released 01/18/2008)
Fixed the problem that the source distibution didn't include header files.
If an
URLAttrattribute contains a processing instruction XIST will no longer transform the URL in any way.Fixed a parser bug where attributes were dropped when the attribute value was empty.
Putting a module into a
Poolobject now copies thexmlnsattribute too. This makes it possible to usePoolobjects as conversion targets.
Changes in 3.0 (released 01/07/2008)
Namespaces have been greatly simplified. There are no namespace modules any longer. An element class can be assigned a namespace by setting the
xmlnsclass attribute to the namespace name. Global attributes can be assigned a namespace by setting thexmlnsattribute on the attribute class itself (not on theAttrsclass). The classesPrefixesandNSPoolare gone too. Instead a new classPoolis used to specify which classes should be used for parsing.Dependency on PyXML has finally been dropped. XIST now uses its own XML parsing API. Two parsers are available: One based on expat and one based on a custom version of sgmlop.
Tree traversal has been rewritten again. XFind expressions involving multiple uses of
//now work correctly. The methodwalknow doesn't yieldCursorobjects, but simple path lists (actually it's always the same list, if you want distinct lists usewalkpath). Applying XFind expressions to nodes directly is no longer supported, you have to callwalk,walknodeorwalkpathwith the XFind expression instead. Many XFind operators have been renamed and/or reimplemented (see the documentation for thexfindmodule for more information).The methods
__getitem__,__setitem__and__delitem__forFragandElementnow support the new walk filters, so you can do:del node[html.p]to delete allhtml.pchild elements ofnode;del node[html.p[2]]to delete only the thirdhtml.p;node[xfind.hasclass("note")] = html.p("There was a note here!")to replace several child nodes with a new one;for c in node[xfind.empty]: print c.bytes()to print all empty (element) children ofnode;del node[node[0]]to delete the first child node (which is silly, but illustrates that you can pass a node to get/replace/delete that node);
A new module
ll.xist.csshas been added which contains CSS related functionality: The generator functioniterrulescan be passed an XIST tree and it will produce all CSS rules defined in anyhtml.linkorhtml.styleelements or imported by them (via the CSS rule@import). This requires thecssutilspackage.The function
applystylesheetsmodifies the XIST tree passed in by removing all CSS (fromhtml.linkandhtml.styleelements and their@imported stylesheets) and putting the styles intostyleattributes of the affected elements instead.The function
selectorreturns a tree walk filter from a CSS selector passed in as a string.Constructing trees can now be done with
withblocks. Code looks like this:with xsc.Frag() as node: +xml.XML() +html.DocTypeXHTML10transitional() with html.html(): with html.head(): +meta.contenttype() +html.title("Example page") with html.body(): +html.h1("Welcome to the example page") with html.p(): +xsc.Text("This example page has a link to the ") +html.a("Python home page", href="http://www.python.org/") +xsc.Text(".") print node.conv().bytes(encoding="us-ascii")Also the function
xsc.appendhas been renamed toaddand supportswithblocks now instead of XPython.A subset of ReST is supported now for docstrings when using the
ll.xist.ns.docmodule. The module attribute__docformat__is now honored (Set it to"xist"to get XIST docstrings).Many classes in the
ll.xist.ns.dochave been renamed to more familiar names (from HTML, XHTML 2 or ReST).The
mediaattribute ofhtml.linkandhtml.stylenow has a methodhasmedia.The node method
asByteshas been renamed tobytesandbyteshas been renamed toiterbytes.The node method
asStringhas been renamed tostringand a new methoditerstringhas been added.ll.xist.ns.xml.XML10is gone now. Usell.xist.ns.xml.XMLinstead.xsc.tonodenow will raise an exception when it can't handle an argument instead of issuing a warning.A class attribute
emptyinside element classes will now no longer get converted intomodel.ll.xist.ns.doc.pyrefnow copes better with decorated methods.The deprecated
ElementmethodshasAttr,hasattr,isallowedattr,getAttr,getattr,setDefaultAttr,setdefaultattr,attrkeys,attrvalues,attritems,iterattrkeys,iterattrvalues,iterattritems,allowedattrkeys,allowedattrvalues,allowedattritems,iterallowedattrkeys,iterallowedattrvalues,iterallowedattritemsandcopyDefaultAttrshave been removed. The deprecatedAttrsmethodcopydefaultshas been removed too.The namespace module
ll.xist.ns.condhas been removed.When calling the function
ll.xist.parsers.parseURLthe argumentsheadersanddataare now passed along to the parser's method only if they are specified. This makes it possible to pass ssh URLs toll.xist.parsers.parseURL.The methods
withnamesandwithoutnameshave been split into two that take Python names and two that take XML names. Multiple arguments are used now (instead of one argument that must be a sequence). Passing a namespace to remove all attributes from the namespace is no longer supported.The
Attrsmethodsupdatenewandupdatexistinghave been removed.
Changes in 2.15.5 (released 07/17/2007)
The Python quotes example no longer contains the XML source or the generated HTML.
Changes in 2.15.4 (released 07/16/2007)
The Python quotes example now always parses the file from the original URL.
The Python quotes and the media example now print the result to
stdout.
Changes in 2.15.3 (released 07/16/2007)
Use a consistent license (MIT) everywhere. This should make XIST Debian compatible.
Change the Python quotes example, so that it works even if there's no
python-quotes.xmlin the current directory.
Changes in 2.15.2 (released 01/24/2007)
Fixed a bug in
presenters.CodePresenter.__str__.Fixed base URL handling for tidy parsing.
Updated examples.
Updated
xiterandxattrsimplementations forNodeandNamespaceto conform to the newest version of IPython.
Changes in 2.15.1 (released 09/25/2006)
Fixed a few bugs in the
sgmlopfunction declarations.Readded the spacer pixel.
Changes in 2.15 (released 09/24/2006)
XIST has been made compatible with Python 2.5: Code has been updated to use the proper C API for memory management and PEP 353 support has been added. XIST now includes its own fixed version of
sgmlop.The
ll.xist.xsc.Attrsmethodswithandwithouthave been renamed towithnamesandwithoutnamesfor Python 2.5 compatibility.ll.xist.ns.htmlspecials.pixelno longer handles colors via different GIFs. It uses thebackground-colorin thestyleattribute instead. The same change has been implemented forll.xist.ns.htmlspecials.autopixel. It's now possible to overwrite the defaultsrcattribute value ofroot:px/spc.gifeither via the XML attribute or via the converter context.The node method
asTexthas been made a function, moved into thehtmlnamespace and renamed toastext. Furthermore elinks is used for plain text formatting now instead of w3m.
Changes in 2.14.2 (released 07/04/2006)
Fixed a bug in the
presentAttrmethod ofll.xist.presenters.TreePresenter.
Changes in 2.14.1 (released 06/29/2006)
Fixed a bug in the
presentEntitymethod ofll.xist.presenters.CodePresenter.Updated installation instructions.
Changes in 2.14 (released 06/28/2006)
Namespaces for RSS 0.91, RSS 2.0 and Atom 1.0 have been added.
A new namespace
ll.xist.ns.detoxhas been added that is similar toll.toxicbut can be used to generate Python code instead of PL/SQL code. Usingdetoxtemplates is about 50 times faster than using XIST trees directly and about 10 times faster than Kid.Presenters are now compatible to IPython
ipipemodule. This means that you can browse XIST trees interactively if you have IPython installed.NormalPresenterand theNodemethodsreprandasreprhave been removed.A new processing instruction
ll.xist.ns.specials.urlhas been added that does the same URL transformation asll.xist.xsc.URLAttrdoes.On publishing
ll.xist.ns.html.htmlnow only adds alangandxml:langattribute, if neither of them exists.setuptoolsis now supported for installation.
Changes in 2.13 (released 10/31/2005)
ll.xist.xsc.Namespace.tokenizerequires aunicodeobject as input now. This makes it possible to use encodings that are not ASCII compatible (such as UTF-16). Theencodingargument is gone.ll.xist.xsc.Node.asStringuses theencodingargument to determine which characters have to be output as character references now. (You'll still get a unicode object as the result.)A new processing instruction class
ll.xist.ns.specials.literalhas been added, that will output its content literally when published. This can be used for embedding preformatted XML (e.g. from a database) into an XIST tree.
Changes in 2.12 (released 10/13/2005)
Changes in 2.11 (released 07/29/2005)
A script
xml2xsc.pyhas been added, that can be used to parse an XML file and generate a rudimentary XIST namespace from it.A
DocTypefor XHTML 1.1 has been added (suggested by Elvelind Grandin).Line number information is now added when parsing HTML.
The
sortedmethod now supports the same arguments (cmp,keyandreverse) aslist.sortandsortedin Python 2.4.The
walkdoesn't yield the node directly, but yields aCursorobject now, with has several ways of referencing the node.New methods
walknode,walkpathandwalkindexhave been added.Presenters use an iterator API instead of a stream API now. Dumping an XML tree presentation to the terminal can now start immediately instead of having to wait for the complete string to be formatted.
Fixed a bug with element/attribute names that contained a
.character. (This brokell.xist.ns.fo.)Fixed a bug with
xmlnsattributes in nested elements. When an element ended the parser restored the wrong prefix mapping.The
python-quotesdemo has been updated to use the current version of AMK's XML file.Removed iterator stuff from
ll.xist.xfind, as this is now part of thellpackage/module.The function
ToNodehas been renamed totonode.ll.xist.Contextno longer subclasseslist.ll.xist.ns.doc.explainwill now try to output the objects in the order in which they appear in the Python source.The node methods
findandfindfirsthave been removed.ll.xist.ns.condnow uses a sandbox dictionary in a converter context for evaluating expression.
Changes in 2.10 (released 05/20/2005)
The content of the processing instruction
ll.xist.ns.code.pyexecwill not be executed at construction time, but at conversion time. The code inll.xist.ns.code.pyexecorll.xist.ns.code.pyevalwill no longer be executed in thell.xist.sandboxmodule (which has been removed), but in a sandbox dictionary in the converter context of thell.xist.ns.codenamespace.The tests have been ported to py.test.
The method
mappedis now callable without arguments. In this case a converter will be created on the fly. You can pass constructor arguments for this converter tomappedas keyword arguments.The publishing API has changed again:
ll.xist.publishers.Publisher.publishno longer accepts an argumentstreamto which the byte strings are written, but it is a generator now. The publisher methodswriteandwritetexthave been renamed toencodeandencodetextand return the encoded byte string, instead of writing it directly to the stream. There's a new generator methodbytesfor nodes now, which can be passed the same arguments asasBytes. These changes should help when using XIST in WSGI applications.The iterator returned from
Element.__getitem__,Frag.__getitem__and thewalkmethod now supports__getitem__itself, so you can writetable[html.tr][0]to get the first row from a table orpage.walk(xsc.FindTypeAll(html.td))[-1]to get the last table cell from a complete HTML page.Several bugs in the namespaces
ll.xist.ns.meta,ll.xist.ns.formandll.xist.ns.specialshave been fixed.The namespace modules
ll.xist.ns.cssandll.xist.ns.cssspecialshave been removed.
Changes in 2.9 (released 04/21/2005)
XIST trees can now be pickled. The only restriction is that global attributes must come from a namespace that has been turned into a module via
makemod, so that this module can be imported on unpickling.Two arguments of the
walkmethod have been renamed:filtermodehas been renamed toinmodeandwalkmodehas been renamed tooutmode. For these modes two new values are supported:ll.xist.xsc.walkindexThe value passed to the filter function or yielded from the iterator is a list containing child indizes and attribute names that specify the path to the node in question.
ll.xist.xsc.walkrootindexThe filter function will be called with two arguments: The first is the root node of the tree (i.e. the node for which
walkhas been called), the second one is an index path (just like forll.xist.xsc.walkindex). If used as anoutmodea tuple with these two values will be yielded.
- Attribute mappings now support
__getitem__,__setitem__and __delitem__with list arguments, i.e. you can do:>>> from ll.xist.ns import html >>> e = html.a("gurk", href=("hinz", "kunz")) >>> print e.attrs[["href", 0]] hinz >>> e.attrs[["href", 0]] = "hurz" >>> print e["href"] hurzkunz >>> del e.attrs[["href", 0]] >>> print e["href"] kunzXML attributes can now be accessed as Python attributes, i.e.:
>>> from ll.xist.ns import html >>> e = html.a("spam", href="eggs") >>> print e.attrs.href eggs(Don't confuse this with
e.Attrs.hrefwhich is the attribute class.)
- Attribute mappings now support
FragandElementnow supportNodesubclasses as arguments to their__getitem__method: An iterator for all children of the specified type will be returned.The encoding used for parsing now defaults to
None. When reading from an URL and no default encoding has been specified the one from theContent-Typeheader will be used. If this still doesn't result in a usable encoding,"utf-8"will be used when parsing XML and"iso-8859-1"will be used when parsing broken HTML.All error and warning classes from
ll.xist.errorshave been merged intoll.xist.xsc. This avoids import problems with circular imports.The attributes
showLocationandshowPathofll.xist.presenters.TreePresenterhave been lowercased and presenters are properly reset after they've done their job.The class attribute
xmlnamewill no longer be turned into a list containing the Python and the XML name, but will be the XML name only. You can get the Python name offoofromfoo.__class__.__name__.DeprecationWarnings fornameandattrHandlershave finally been removed.Instances of
ll.xist.xsc.Entitysubclasses can now be compared.__eq__simply checks if the objects are instances of the same class.
Changes in 2.8.1 (released 03/22/2005)
Added a note about the package init file to the installation documentation.
Changes in 2.8 (released 01/03/2005)
XIST requires Python 2.4 now.
ll.xist.ns.specials.xhas been renamed toll.xist.ns.specials.ignore.ll.xist.utils.findAttrhas been renamed toll.xist.utils.findattr.ll.xist.xfind.itemno longer handles slices.XFind has been enhanced to support item and slice operators, i.e. if
foois an XFind operator,foo[0]is an operator that will produce the first node fromfoo(if there is one). Negative values and slices are supported too.Operators can be chained via division:
html.a/html.bis an operator that can be passed around and applied to a node.XIST requires the new core module and makes use of the new "cooperative displayhook" functionality defined there: If you install the displayhook you can tweak or replace
ll.xist.presenters.hookpresenterto change the output.
Changes in 2.7 (released 11/24/2004)
The transparent pixel used by
ll.xist.ns.htmlspecials.pixelhas been renamed tospc.gifto avoid problems with IE.Removed a debug print in
ll.xist.xfind.Finder.__getitem__.ll.xist.xfindnow has a new functionitem, that can be used to get a certain item or slice from an iterator.xfind.firstandxfind.lasthave been changed to usexfind.item, so you now have to pass a default value to get the old behaviour.Obsolete options in
ll.xist.optionshave been removed (andreprEncodinghas been renamed toreprencoding).
Changes in 2.6.2 (released 06/06/2005)
Fixed a bug in
ll.xist.parsers.Parser.parse.
Changes in 2.6.1 (released 11/02/2004)
Fixed a bug in
ll.xist.xfind.Finder.__floordiv__.Restricted characters as defined in XML 1.1 will now be published as character references.
Changes in 2.6 (released 10/26/2004)
ToNodenow tries iterating through the value passed in, so it's now possible to pass iterators and generators (and generator expressions in Python 2.4) toFragandElementconstructors.A new API named XFind has been added for iterating through XML trees. XFind expressions look somewhat like XPath expressions but are pure Python expressions. For example finding all images inside links in an HTML page can be done like this:
from ll.xist import parsers, xfind from ll.xist.ns import html node = parsers.parseURL("http://www.python.org/", tidy=True) for img in node//html.a/html.img: print img["src"]The module
ll.xist.xfindcontains several operators that can be used in XFind expressions.Parsing broken HTML is now done with the HTML parser from libxml2. The parsing functions no longer accept options for tidy, only the boolean value of the
tidyargument is used.The publishing API has been simplified: Publication can now be done with a call to
ll.xist.publishers.Publisher.publish, passing in all.xist.xsc.Node. Writing strings to the publisher output is now done withll.xist.publishers.Publisher.write. The methodsbeginPublicationandendPublicationhave been removed.The presentation API has been simplified in the same way: You'll get a presentation by calling:
string = presenter.present(node). The methodsbeginPresentationandendPresentationhave been removed.The parser now has the option to ignore illegal elements, attributes, processing instructions and entities. The default behaviour is to raise an exception, but this can now be reconfigured via Python's warning framework.
The classmethod
tokenizefromll.toxichas been moved toll.xist.xsc.Namespace, so it's now possible to tokenize an XML string for other processing instructions as well.A new class
ll.xist.xsc.NSPoolhas been added. AnNSPoolcontains a pool of namespaces from which the parser selects the appropriate namespace once anxmlnsattribute is encountered.</item>The script
xscmake.py(which has been unmaintained for a while now) has been removed.</item>Elements
hostname,tty,promptandinputwere added toll.xist.ns.doc.The method
ll.xist.xsc.Attrs.setnow returns the new attribute object.The
visitmethod has been removed.ll.xist.xsc.FindOldhas been removed.ll.xist.ns.xml.headerhas been renamed toll.xist.ns.xml.declaration.
Changes in 2.5 (released 06/30/2004)
Specifying content models for elements has seen major enhancements. The boolean class attribute
emptyhas been replaced by an objectmodelwhosecheckvalidmethod will be called for validating the element content.A new module
ll.xist.simshas been added that provides a simple schema validation. Schema violations will be reported via Pythons warning framework.All namespace modules have been updated to use
simsinformation. The SVG module has been updated to SVG 1.1. The docbook module has been updated to DocBook 4.3.It's possible to switch off validation during parsing and publishing.
ll.xist.xsc.Fragandll.xist.xsc.Elementboth have a__call__method with the same arguments as their constructors. Those methods will append content nodes (and set attributes forll.xist.xsc.Element) and returnself, so they can be used when creating an object tree. This makes it possible to put the attributes close to the tag name, instead of putting them at the end after the content.Instead of:
node = html.table( html.tr( html.td("foo"), html.td("bar"), ), html.tr( html.td("spam"), html.td("eggs") ), class_="example"you can now use the following:
node = html.table(class_="example")( html.tr( html.td("foo"), html.td("bar"), ), html.tr( html.td("spam"), html.td("eggs") ) )Experimental support for Holger Krekel's XPython has been added. Code might look like this:
from ll.xist import xsc, converters from ll.xist.ns import html, meta import random c = converters.Converter() <c>: <html.html()>: <html.head()>: <meta.contenttype()>: pass <html.title()>: xsc.append("The title") <html.body(class_="foo")>: <html.h1()>: flag = random.choice((0, 1)) if flag: xsc.append("The foo page", class_="foo") else: xsc.append("The bar page", class_="bar") <html.p()>: if flag: xsc.append("The foo content") else: xsc.append("The bar content") print c.lastnode.asBytes()Creating global attributes has been simplified. Passing an instance of
ll.xist.xsc.Namespace.Attrsto anElementconstructor now does the right thing:from ll.xist.ns import html, xml node = html.html( html.head(), xml.Attrs(lang="de"), lang="en", )Creating skeleton implementations of XIST namespaces is no longer done via XML conversion (i.e. the namespace module
ll.xist.ns.xndl), but through the new modulell.xist.xnd. The scriptdtdxsc.pywill automatically generatesimsinformation.ll.xist.xsc.CharRefnow inherits fromll.xist.xsc.Texttoo, so you don't have to special caseCharRefs any more. When publishing,CharRefs will be handled likeTextnodes.ll.xist.ns.meta.contenttypenow has an attributemimetype(defaulting to"text/html") for specifying the MIME type.ll.xist.ns.htmlspecials.capshas been removed.Registering elements in namespace classes has been rewritten to use a cache now.
Pretty printing has been changed: Whitespace will only be added now if there are no text nodes in element content.
Two mailing lists are now available: One for discussion about XIST and one for XIST announcements.
Changes in 2.4.1 (released 01/05/2004)
Changed the xmlname of
ll.xist.ns.jsp.directive_pageback again (it'sdirective.pageonly for the XML form, which we don't use anyway.)Drop the default value for
ll.xist.ns.jsp.directive_page.Attrs.language, as this attribute can only be used once.If an
ll.xist.xsc.Prefixesobject has a prefix mapping for a namespace it will return this prefix too, if asked for a prefix for a subclass of this namespace.
Changes in 2.4 (released 01/02/2004)
The class
ll.xist.parsers.Handlerhas been renamed toParserand has been made reusable, i.e. it is possible to instantiate a parser once and use it multiple times for parsing. All the classes derived fromxml.sax.xmlreader.InputSourcehave been dropped and the methods for parsing strings, URLs and files have been implemented as methods of the parser. Most of the arguments that had to be passed to the various parsing functions are passed to the parser constructor now. The basic parsing functionality is implemented by parsing streams instead ofInputSourceobjects.Similar to the changes for parsing, publishers have been changed to be reusable and most arguments to the publishing functions are available as arguments to the publisher constructor.
Now converter contexts are no longer bound to an element class, but to the context class defined by the element class, i.e. the attribute
Contextof the argument forConverter.__getitem__will be used as the dictionary key. This makes it possible to use a class and it subclasses interchangeably (as long as the base class defines its ownContextclass and the subclasses don't overwrite it).Added a find functor
FindTypeAllAttrsthat searches content and attributes.Fixed the XML name for
ll.xist.ns.jsp.directive_page.All character references in
ll.xist.ns.ihtmlthat exist inll.xist.ns.charstoo have been removed.
Changes in 2.3 (released 12/08/2003)
It's now possible to parse XML without generating location information for each node, by passing
loc=Falseto the constructor of theHandler.The
HTMLParserno longer complains about global attributes orxmlns.XIST now supports uTidylib in addition to mxTidy. uTidylib is found it is preferred over mxTidy.
It's possible now to pass arguments to tidy simple by passing an argument dictionary for the
tidyargument in the parsing functions.The methods
parsedandcheckvalidhave been separated.ll.xist.ns.htmlspecials.pixelandll.xist.ns.htmlspecials.autopixelnow check whether theircolorattribute is ok.The base URL is now set correctly when parsing from an URL even if the original URL does a redirect. (This requires
ll.urlversion 0.11.3).Namespace handling has been rewritten again, to be more standards compliant: Now there is no prefixes for entities and processing instructions any longer. Prefix mappings can be created much simpler, and they no longer contain any namespace stack for parsing, as this is now done by the parser itself.
xsc.NamespaceAttrMixInis gone too.The processing instructions
exec_andeval_fromll.xist.ns.codehave been renamed topyexecandpyevalandimport_has been removed.CharRefs fromll.xist.ns.htmlhave been moved to a new module namedll.xist.ns.chars.The method names
beginPublication,endPublicationanddoPublicationhave been lowercased.
Changes in 2.2 (released 07/31/2003)
Namespace handling has been completely rewritten. Namespaces are now classes derived from
ll.xist.xsc.Namespace. Defining element classes can be done inside or outside the namespace class. If the element classes are defined outside the namespace class, they can be moved inside the namespace with a simple attribute assignment:class foo(xsc.Element): empty = False class xmlns(xsc.Namespace): xmlname = "foo" xmlurl = "http://www.foo.com/ns/foo" xmlns.foo = fooThe methods
elementkeys,iterelementkeys,elementvalues,iterelementvalues,elementitemsanditerelementitemscan be used for iterating through the element classes and their names. You can use the methodelementto get an element class with a certain name:>>> from ll.xist.ns import html >>> html.element("div") <element class ll.xist.ns.html/div at 0x824363c>For processing instructions, entities and character references similar methods are available.
The method
updatecan be used to add many element classes to a namespace at once, simply by passing a dictionary with those classes (usevars()to add everything that's defined inside your module). The methodupdatenewdoes the same, but copies only those attributes that don't exist in the namespace,updateexistingcopies only those that do exist. You can turn a namespace into a module withmakemod:from ll.xist import xsc class foo(xsc.Element): empty = False class xmlns(xsc.Namespace): xmlname = "foo" xmlurl = "http://www.foo.com/ns/foo" xmlns.makemod(vars())Put the above code into
foo.pyand you can do the following:>>> import foo >>> foo <namespace foo/xmlns name=u'foo' url=u'http://www.foo.com/ns/foo' with 1 elements from 'foo.py' at 0x81bfc14>
getnshas been dropped, so you always have to pass in aNamespaceclass where a namespace is required.For the
ll.xist.ns.jsp.directive_pageelement automatic generation of the correctcharsetoption in thecontentTypeattribute is only done when there is acontentTypeattribute, ascontentTypeis optional.The converter has a new property
node.nodecan't be passed toconvbut will be set toselfbyconvautomatically. This makes it possible to access the "document root" during conversion.ll.xist.ns.htmlspecials.autoimgno longer touches existing width and height attributes. This means that %-formatting of the existing attributes is no longer done.Added a new class
ll.xist.ns.htmlspecials.autopixelthat works likell.xist.ns.htmlspecials.pixelbut inherits the size for the image specified via thesrcattribute.FragandElementnow support extended slices.FragandElementnow support the methodsextendand__iadd__.For walking the tree the method
walkhas been completely rewritten and a new methodvisithas been added. For more info see the docstrings.Nodenow has two new methodscopyanddeepcopyand supports thecopymodule from the Python standard library.Calling
mappedthroughconvhas been removed. You again have to callmappeddirectly and pass a node and a converter.The HTML handling of the
HTMLParserhas been improved (it now uses code fromxml.sax.drivers2.drv_sgmlop_html(which is part of PyXML.The core functionality found in the script
dtd2xsc.pyhas been moved to a class methodll.xist.ns.xndl.fromdtdin thell.xist.ns.xndlnamespace.ll.xist.parsers.ExpatParseris now a real subclass instead of an alias forxml.sax.expatreader.ExpatParserIt reports unknown entity references to the application (if loading of external entities is switched off, which is done byll.xist.parsers.Handlerand only outside of attributes).Namespaces have been added for Zope's TAL and METAL specifications.
A namespace has been added for XSL-FO.
Changes in 2.1.4 (released 06/13/2003)
Remove the checks for attributes in attributes and moved the publication code for the full element into a separate method. This allows JSP tag library namespaces to simply overwrite
publishto publish the element even inside attributes. (This is the same fix as in release 1.5.10).
Changes in 2.1.3 (released 05/07/2003)
The methods
sorted,reversedandshuffledhave been rewritten so they no longer usesys.maxint. This change fixes those methods for 64 bit platforms (reported by Giles Frances Hall)
Changes in 2.1.2 (released 02/27/2003)
ll.xist.ns.struts_config11.plug_innow allows content (as the DTD states). (This is the same fix as in release 1.5.8.)
Changes in 2.1.1 (released 02/11/2003)
Added a few elements and attributes to
ll.xist.ns.doc:username, which is used for the name of a user account,xref, which is used for internal cross references and the attributeidforsection, which specifies the target for anxref.
Changes in 2.1 (released 12/09/2002)
Added a new namespace module
ll.xist.ns.xndlthat contains the "XIST namespace definition language", i.e. elements that describe an XIST namespace and can be used by various scripts to generate skeleton namespace modules. The first of these script is the DTD to namespace converterdtd2xsc.py.Added a new namespace module
ll.xist.ns.tldthat contains the definition for Java Server Pages Tag Library descriptors and a scripttld2xsc.pythat uses this namespace to generate namespace modules fromtldfiles.Attrnow supports the methodfiltered. This is used bywithoutnow. The arguments forwithouthave changed, because handling global attributes was too "magic". A new methodwithhas been added, with does the opposite ofwithout, i.e. it removes all attributes that are not specified as parameters.The Python name of each
Nodesubclass is now available as the class attributepyname.To continue the great renaming
withSephas been renamed towithsep.The namespace name for the
ll.xist.ns.struts_htmlmodule has been fixed.The argument
defaultEncodingfor the various parsing functions has been renamed toencoding.
Changes in 2.0.8 (released 11/20/2002)
ll.xist.ns.doc.getDochas been renamed togetdoc.The CSS parser was dropping the
%from percentage values. This has been fixed.
Changes in 2.0.7 (released 11/12/2002)
xsc.Element.__nonzero__can no longer fall back toxsc.Frag.__nonzero__. (this is the same fix as in 1.5.7).
Changes in 2.0.6 (released 11/11/2002)
Performance optimizations.
Changes in 2.0.5 (released 11/11/2002)
Fixed a bug in
ll.xist.ns.specials.autoimg: Attributes were not converted before the size check was done (this is the same fix as in 1.5.5).
Changes in 2.0.4 (released 11/08/2002)
Fixed a regression bug in
ll.xist.ns.jsp.directiveand several documentation issues.
Changes in 2.0.3 (released 10/30/2002)
Fixed a few bugs in
HTMLParser.Added DocBook conversion for several elements in
ll.xist.ns.doc.Now the
__init__.pyfile for thellpackage is included.
Changes in 2.0.2 (released 10/21/2002)
Fixed a bug in
Frag.__rmul__(by reusing__mul__).Fixed a bug with the backwards compatible prefix mapping: Defining element classes in
execprocessing instructions didn't work, because the prefixes object used for parsing wouldn't be updated when the namespace object is defined inside the processing instruction. Now using the default for theprefixesargument in calls to the parsing functions uses one global sharedPrefixesinstances where all the namespaces that are newly defined will be registered too.
Changes in 2.0.1 (released 10/17/2002)
Fixed
xscmake.pyby removing the prefix handling.OldPrefixeswill always be used for parsing now.
Changes in 2.0 (released 10/16/2002)
XIST now requires at least Python 2.2.1.
Attribute handling has been largely rewritten. Instead of a class attribute
attrHandlers, the attributes are now defined through a nested class namedAttrsinside the element. This class must be derived fromll.xist.Element.Attrs(or one of its subclasses if you want to inherit attributes from this class). Defining attributes is done through classes nested inside this attributes class and derived from any of the known attribute classes (likeTextAttr,URLAttretc.). The class name will be the attribute name (and can be overwritten with a class attributexmlname. This makes it possible to have docstrings for attributes. Furthermore it's possible to define an attribute default value via the class attributedefault, allowed values for the attribute viavalues, which is a list of allowed values, and whether the attribute is required or not viarequired.XIST now has real namespace support. The new class
ll.xist.xsc.Prefixescan be used to define a mapping between prefixes and namespace names. This can be used for parsing and publishing. Namespace support is even available for entities and processing instruction.Global attributes are supported now. Namespace modules for the
xmlandxlinknamespaces have been added (andll.xist.xsc.XMLwas moved toll.xist.ns.xml).A new namespace module for SVG 1.0 has been added:
ll.xist.ns.svg.The HTML specific parts of
ll.xist.ns.specialshave been split off into a separate modulell.xist.ns.htmlspecials.Comparison of attributes with strings has been removed. You have to use
__unicode__or__str__now before comparing.The
HTMLParsernow removes unknown attributes instead of complaining.There is a new parser class
BadEntityParser, which is a SAX2 parser that recognizes the character entities defined in HTML and tries to pass on unknown or malformed entities to the handler literally.To give all nodes a chance to do something after they have been parsed (e.g. to prepend the base URL for
URLAttrnodes), the parser now calls the methodparsedimmediately after node creation. This is used for the new classStyleAttr, which uses theCSSTokenizer, to prepend the base URL to all URLs found in a style attribute.The pixel images have been moved to the directory
pxto make image URLs shorter.
Changes in 1.6.1 (released 08/25/2003)
Updated to work with newer versions of
ll.ansistyle.Updated the namespaces
ll.xist.ns.struts_htmlandll.xist.ns.struts_config11to the state of Struts 1.1 final.
Changes in 1.6 (released 07/02/2003)
Removed the default value for the
classNameattribute inll.xist.ns.struts_config11.action.Added an attribute
typetoll.xist.ns.struts_config11.action_mapping.
Changes in 1.5.13 (released 07/01/2003)
Implemented
ll.xist.xsc.Namespace.__eq__, so that replacing a namespace in the registry really works.Added an attribute
targettoll.xist.ns.html.area.
Changes in 1.5.12 (released 06/17/2003)
Fixed a bug in the new
ll.xist.ns.jsp.
Changes in 1.5.11 (released 06/13/2003)
Updated
ll.xist.ns.jspto JSP 1.2.
Changes in 1.5.10 (released 06/13/2003)
Remove the checks for attributes in attributes and moved the publication code for the full element into a separate method. This allows JSP tag library namespaces to simply overwrite
publishto publish the element even inside attributes.
Changes in 1.5.9 (released 04/30/2003)
Reregistering a namespace now properly overwrites the old version in
xsc.namespaceRegistry.
Changes in 1.5.8 (released 02/27/2003)
ll.xist.ns.struts_config11.plug_innow allows content (as the DTD states).
Changes in 1.5.7 (released 11/12/2002)
xsc.Element.__nonzero__can no longer fall back toxsc.Frag.__nonzero__.
Changes in 1.5.6 (released 11/11/2002)
Performance optimizations.
Changes in 1.5.5 (released 11/11/2002)
Fixed a bug in
ll.xist.ns.specials.autoimg: Attributes were not converted before the size check was done.
Changes in 1.5.4 (released 09/30/2002)
xscmake.pynow tries to strip off a trailingxscfrom the filename before it falls back to the extensionhtml(The builtin extension mapping is still tried first).
Changes in 1.5.3 (released 09/25/2002)
Added new processing instruction class
ll.xist.ns.php.expressionthat generates a PHPprintstatement from its content.
Changes in 1.5.2 (released 09/19/2002)
Removed the
valuemagic fromll.xist.ns.form.checkboxas this conflicted with dynamicvaluevalues.
Changes in 1.5.1 (released 09/17/2002)
Comparison of attributes with strings has been removed. You have to use
__unicode__or__str__instead.The
HTMLParsernow removes unknown attributes instead of complaining.There is a new parser class
BadEntityParser, which is a SAX2 parser that recognizes the character entities defined in HTML and tries to pass on unknown or malformed entities to the handler literally.To give all nodes a chance to do something after they have been parsed (e.g. to prepend the base URL for
URLAttrnodes), the parser now calls the methodparsed()immediately after node creation. This is used for the new classStyleAttr, which uses theCSSTokenizer, to prepend the base url to all urls found in a style attribute.The
HTMLParsernow removes unknown attributes instead of complaining.There is a new parser class
BadEntityParser, which is a SAX2 parser that recognizes the character entities defined in HTML and tries to pass on unknown or malformed entities to the handler literally.To give all nodes a chance to do something after they have been parsed (e.g. to prepend the base URL for
URLAttrnodes), the parser now calls the methodparsedimmediately after node creation. This is used for the new classStyleAttr, which uses theCSSTokenizer, to prepend to base URL to all URLs found in a style attribute.
Changes in 1.4.3 (released 04/29/2002)
New namespace module
xist.ns.struts_config11allows to parse and modify Struts configuration files conforming to the Struts 1.1 DTD.
Changes in 1.4.2 (released 03/22/2002)
Updated
xscmake.pyto be compatible with the newurlmodule.xist.ns.jsp.directive_pagenow automatically sets thecontentTypeon publishing.
Changes in 1.4.1 (released 03/21/2002)
Removed
TidyURLInputSource. Now it's possible to pass atidyflag to the remaining functionsparseString,parseFileandparseURLto specify whether the source should be tidied.To prevent an element from being registered in a
Namespacethe class attributeregistercan be used now. This makes it possible to have a name for the element even when it's not registered.xist.ns.formelements now have all the attributes that the corresponding elements fromxist.ns.htmlhave.Removed the old
xist.urlfrom the Windows distribution.
Changes in 1.4 (released 03/18/2002)
Reimplemented URL handling again. Now the new global module
urlis used for that.
Changes in 1.3.1 (released 03/14/2002)
Added a method
prettytoNodefor generating a pretty printable version of the node.xsc.Node.nameno longer is a class method, but a class attribute, that will be set at class instantiation time by the meta class.
Changes in 1.3 (released 02/12/2002)
Ported to Python 2.2.
Nodeis now derived fromobject,Fragfromlistand there's a new classAttrswhich is derived fromdictfor the attribute mappings. All presenters have been adapted to work withAttrs. In addition to the usual dictionary methods and operatorsAttrshas a methodwithoutthat returns a copy of theAttrsinstance with some specified attributes removed.All the node classes now have a new method
walkthat generates all nodes in the tree using the new generator feature of Python 2.2.Also a new method
walkPathhas been added that works the same aswalkbut yields the complete path to each node as a list.Added a class
blocktoxist.ns.jsp. The content of theblockinstance will simply be enclosed in a{}block.xist.ns.phpgot such a class too.Added a new module
xist.ns.ihtmlfor i-mode HTML.Added new modules
xist.ns.cssandxist.ns.cssspecialsfor generating CSS.Now the various attributes of the
Converterobject are collected in aConverterStateobject and it's possible to push and pop those states, i.e. it's now easy to temporarily modify a converter object during aconvertcall and revert back to a previous state afterwards.parseURLandparseTidyURLnow have an additional parameterheaderswhich is a list of string pairs specifying additional headers to be passed in with the request.parseStringhas an additional parametersystemIdwhich will be the system id of theInputSource.The distribution now includes the makefile and the XML source files so now the distribution can rebuild ifself.
Various other small bugfixes and enhancements.
Changes in 1.2.5 (released 12/03/2001)
Added a new element
contentscripttypetoxist.ns.metathat generates a<meta http-equiv="Content-Script-Type" ...>element.xist.ns.doc.explainnow generates anchor elements for the class, function and method description, so now the links on the XIST webpages work.Docstrings and documentation has been reworked. Now
xist.ns.doc.pyrefno longer implies a font change. Use the classesxist.ns.doc.module,xist.ns.doc.class,xist.ns.doc.method,xist.ns.doc.functionandxist.ns.doc.argto mark up your Python identifiers.Added the attributes
typeandkeytoxist.ns.struts_config.data_source.
Changes in 1.2.4 (released 11/23/2001)
Added the deprecated attributes
starttoxist.ns.html.olandvaluetoxist.ns.html.li.
Changes in 1.2.3 (released 11/22/2001)
Added missing
asPlainStringmethods toCommentandDocType.
Changes in 1.2.2 (released 11/16/2001)
xist.url.URL.fileSizeandxist.url.URL.imageSizenow use the warning framework to report errors.There is a new presenter named
CodePresenterthat dumps the tree as Python source code.The filenames of the pixel images used by
xist.ns.specials.pixelhave changed. These images are now included.
Changes in 1.2.1 (released 10/08/2001)
URLs that are completely dynamic will now be left in peace when parsing or publishing.
Changes in 1.2 (released 10/03/2001)
xist.ns.meta.keywordsandxist.ns.meta.descriptionno longer callasPlainStringon their content. This makes it possible to e.g. generate the keywords via JSP:>>> from xist import parsers >>> from xist.ns import meta, jsp >>> s = '<keywords>' + \ ... '<?jsp:expression "foo"?>' + \ ... '</keywords>' >>> e = parsers.parseString(s) >>> print e.conv().asBytes() <meta name="keywords" content="<%= "foo" %>" />
When an element occurs inside an attribute during publishing, there won't be an exception raised any more. Instead the content of the element will be published. This fixes problems with abbreviation entities inside attributes.
xist.parsers.TidyURLInputSourcenow uses the new experimental eGenix mx Extension package, which includes a Python port of tidy.__repr__now uses the new classpresenters.PlainPresenterwhich gives a little more info than the default__repr__.URL handling has been changed again. Upto now,
URLAttrhad an additional instance attributebase, which was the "base" file/URL from which the attribute was parsed. Now the base URL will be directly incorporated into the URL. You can pass the base URL to all the parsing functions. Similar to that when publishing you can specify a base URL. All URLs in the tree will be output relative to this base URL. Joining URLs is now done via__div__and no longer via__add__. This makes it more consistent withfileutils. The plan is to make URLs string like immutable objects and to merge them withfileutils.Filename.xist.ns.specials.phphas been moved to its own module (xist.ns.php). This module provided additional convenience processing instructions (just likexist.ns.jspdoes).
Changes in 1.1.3 (released 09/17/2001)
The global namespace registry now keeps a sequential list of all registered namespaces, which will be used by the parser when searching for names. This gives a predictable search order even without using
Namespacesand itspushNamespacemethod: modules imported last will be searched first.Processing instructions are now allowed inside attributes when publishing.
xist.ns.docbooklitehas been renamed toxist.ns.doc. It can now generate HTML and Docbook output and has improved a lot. The XIST web pages now use this for automatic documentation generation. The doc example has been removed.xist.url.URLnow has a new methodinfothat returns the headers for the file/URL.xist.url.URLnow has a methodsfileSizeandimageSizetoo.xist.ns.jsp.directive_pagenow has new attributesession.
Changes in 1.1.2 (released 08/21/2001)
__repr__now uses the new classpresenters.PlainPresenterwhich gives a little more info than the default__repr__.
Changes in 1.1.1 (released 08/01/2001)
Small bugfix in
presenters.strProcInst.Fixed
xist.ns.struts_html.optionto allow content.
Changes in 1.1 (released 07/19/2001)
Sequences in constructor arguments for
FragandElementare again expanded and it's again possible to pass dictionaries in anElementconstructor to specify attributes. As sequences are always unpacked, the methodextendis gone. This works forappendandinserttoo.NodeandFragimplement__mul__and__rmul__, so you can do stuff like:html.br()*5
This returns a
Fragwith five times to same node.Arguments for the converter constructor can be passed to
xist.xsc.Node.convnow, so it's possible to do stuff like this:from xist.ns import code print code.Eval("return converter.lang").conv(lang="en").asBytes()which will print
en.The option
XHTMLfor the publishers has been changed to lowercase.xist.ns.html.htmlwill automatically generate alangandxml:langattribute when the converter has a language set.
Changes in 1.0 (released 06/18/2001)
New module for WML 1.3.
The publishing interface has changed internally and publishing should be faster now.
Publishers now support a new parameter:
usePrefix, which specifies if namespace prefixes should be output for the element names.Part of the implementation of the publishing stuff has been moved to C, so now you'll need a C compiler to install XIST.
When publishing
", it will now only be replaced with"inside attributes.All the
asHTMLmethods now have an additional argumentconverter. This makes it possible to implement different processing modes or stages for new elements. All currently implemented elements and entities ignore this argument, but pass it on in the call to their childrens'asHTMLmethod. As the nameasHTMLno longer makes sense,asHTMLhas been renamed toconvert.There is now a tool
dtd2xsc.pyin thescriptsdirectory that creates a skeleton XIST module from a DTD (this requires xmlproc from the PyXML package).New preliminary module for DocBook 4.12. (Incomplete:
convertmethods and Unicode character entities are missing; any volunteers for implementing 375 classes?)New module
ruby.pythat implements the W3C Ruby draft.sql.pyhas been removed from XIST, but is available as a separate module.The parsing interface has been changed. Parsing is now done with the functions
parseFile,parseString,parseURLandparseTidyURLin the moduleparsers. It's now possible to specify which parser should be used for parsing by passing a SAX2 parser instance to any of these functions. XIST now includes a rudimentary SAX2 driver forsgmlopand a rudimentary HTML parser that emits SAX2 events.The python-quotes example has been updated to work with expat.
Added a new example: media.
All abbreviation entities have been moved to a new module
abbr.py.All the modules that provide new elements and entitites have been moved to a subpackage
ns.FragandElementnow have new methodssorted,reversed,filteredandshuffledthat return sorted, reversed, filtered and shuffled versions of theFrag/Elementobject.New namespace modules
ns/jsp.pyandns/struts_html.pyhave been added that allow you to use JSP and Struts tags with XIST.A new method
asTextwas added, that returns the node as a formatted plain ASCII text (this requires that w3m is installed.)make.pyhas been renamed toxscmake.pyand moved to thescriptsdirectory, it will be installed as a callable script withpython setup.py install_scripts.xscmake.pyhas a new option--files/-f. The argument is a file containing a list of filenames (one name per line) that should be converted.xscmake.pyhas a new option--parser/-rfor specifying which parser to use. Allowed values aresgmlopandexpat.xscmake.pyhas a new option--namespace/-nthat can be used for appendingNamespaceobjects to theNamespacesobject used byxscmake.py:xscmake.py -n html -n spam eggs.xsc
With this call the parser will find element classes from the module with the prefix name
spambefore those fromhtmland those before anything else.xist.url.URLno longer has an attributeext.fileandextare merged.The special treatment of sequences as constructor arguments to
FragandElementhas been removed, so XIST will no longer remove one level of nesting. If you still want that, use a*argument.FragandElementnow have a new methodmapped, that recursively maps the nodes through a function. This is likeconvertbut via an external function.Attribute handling has been improved thanks to a suggestion by Hartmut Goebel:
Element.__getitem__now always works as long as the attribute name is legal. If the attribute is not set, an empty attribute will be returned. All empty attributes will be considered as being not set and sohasAttrreturns0for them, andpublishdoesn't publish them. This simplifies several very common cases:Copying an attribute from one element to another works regardless of whether the attribute is set or not;
Testing for an attributes presence can now be done much simpler:
if element["attrname"]instead ofif element.hasAttr("attrname")(which still works, and should be a little faster);When you construct an XIST tree and the presence or absence of an attribute is tied to a condition, you can construct the attribute in advance and use it afterwards in the tree construction:
if condition: align = "right" else: align = None node = html.div("spam", align=align)So, when the
conditionis false, the node will not have the attributealignset.
xist.ns.cond.If(andxist.ns.cond.ElIf) can now be used to test for attributes of the converter. I.e. it's possible to write the following XML:<if lang="en">Title <elif lang="de">Überschrift </if>
URL handling has be completely changed and is much, much simpler now. There are no more path markers. To specify an URL that is relative to the current directory use the scheme
root(e.g.root:main.css).
Changes in 0.4.7 (released 11/24/2000)
Fixed a bug in the entity handling.
Added a few deprecated elements and attributes to the
htmlmodule.Improved the publishing of attributes. Now all attribute values will be published. For boolean attributes no value will be published for
XHTML==0and the attribute name will be used forXHTML==1orXHTML==2.Element.compactnow works (better) ;).Incorparated many bug fixes from Hartmut Goebel.
Implemented
xsc.Element.copyDefaultAttrs, which copies unset attributes over from a dictionary (simplifies implementingspecials.plaintableandspecials.plainbody).providers.Provider.pushNamespacenow handles multiple arguments which may beNamespaceobjects or modules (in which case,module.namespacewill be pushed).providers.Providers.popNamespacecan now pop multiple namespaces at once.providers.TidyURIProvidernow usesos.popen3for piping the file through tidy, so now there will be no more temporary files. The call to tidy now includes options that hopefully make the output more suited to XIST.Incorparated a new
url.pyby Hartmut Goebel, that fixes many problem (e.g. optimizinghttp://server/foo/bar/../../baz.gifnow works.)make.pyincludes a new option--pathfor adding directories tosys.path.
Changes in 0.4.6 (released 11/03/2000)
Now uses
sgmlop.XMLParserinstead ofsgmlop.SGMLParser, so case is preserved.Fixed another regression from the URL to string conversion change.
Changes in 0.4.5 (released 11/01/2000)
Converting URLs to nodes is now done in
ToNode, soURLobjects can be used everywhere.Fixed a few bugs in
Text._strtextandURLAttr._str.
Changes in 0.4.4 (releases 10/27/2000)
Now testing if characters can be encoded with the specified encoding is done directy. This means, that escaping unencodable characters now works even with exotic encodings (tested with JapaneseCodecs 1.0.1.
The
URLAttrconstructor now can handle a single parameter of the typeURL.The URL to string conversion function have changed:
URL.asStringreturns the URL with path markers,URL.asPlainStringreturns the URL without path markers.Added the
i18nattribute to thefontelement.Fixed the clashes between the class names for the elements and entities
subandsupinhtml.py.Several small enhancements and bug fixes contributed by Hartmut Goebel.
Changes in 0.4.3 (released 10/19/2000)
Now processing instruction classes are registered in the same way as elements and entities are.
The leaf nodes (
Text,Comment,ProcInst) are now considered immutable. This means that theirasHTMLmethod can simply returnself, because now those nodes can be shared between trees. Functionality for manipulation the objects is provided by a mixin class very similar toUserString. All this results in a speedup of about 10% for the python-quotes example.Small optimizations in the
asHTMLmethods ofElementandFragoptimized away many calls toappend,extendandToNodeand result in a speedup of about 30% for the python-quotes example. One consequence of this is thatNullobjects will no longer be ignored.
Changes in 0.4.2 (released 09/24/2000)
New elements
keywordsanddescriptioninmeta.py.Fixed a bug in
Namespace.register, now settingname=Noneto prevent an element from being registered works again.
Changes in 0.4.1 (released 09/21/2000)
A new module named
meta.pyhas been created, that simplifies generating meta tags.Various small bugfixes.
Changes in 0.4 (released 09/19/2000)
XIST now requires at least Python 2.0b1.
A new bugfixed version of the sgmlop source is available from the FTP site.
XIST now completely supports Unicode. For output any encoding known to Python can be used, so now you can output your HTML in ASCII, Latin-1, UTF-8, UTF-16, ...
All publishers have been updated to support Unicode. The publishing interface has been streamlined (
encodingandXHTMLparameters are now attributes of the publisher).asStringwill now always return a Unicode string. If you want a byte string useasBytesinstead, where the encoding can be specified as an argument.There an additional publisher class
FilePublisher, which can be used for publishing to a file (or anything else that has awriteand awritelinesmethod, and is supported by the stream writer available throughcodecs.lookup).Element and attribute names are no longer converted to lowercase. If you have an attribute name which clashes with a Python keyword (e.g.
class) append an underscore (_), which will be removed before accessing the attribute. This is the "official" Python method for handling these cases.Elements and entities are no longer registered one by one. Now you can build
Namespaceobjects which are used for searching and there arepushNamespaceandpopNamespacefunctions inXSC.xsc. For more info, see the source.Image size calculation has been removed from
html.imgandhtml.input. Usespecials.autoimgandspecials.autoinputfor that.__getitem__,__setitem__and__delitemofFragandElementnow accepts a list as an argument. The method will be applied recursively, i.e.e[[0, 1, "foo", 2]is the same ase[0][1]["foo"][2].The deprecated module
db.pyno longer exists. Useful functions and elements fromdb.pyhave been moved tosql.pyandform.pyrespectively.When using
xsc.makethe encoding and XHTML parameters to use can now be specified on the command line (e.g.--encoding utf-8 --xhtml 2)Handling of multiline
<?xsc-eval?>and<?xsc-exec?>has been enhanced, although XIST will not be able to guess the correct indentation in all cases. As a workarround simply add a Python comment to the beginning. So the following won't work:<?xsc-exec for i in xrange(10): do(i) ?>But this will:
<?xsc-exec # for i in xrange(10): do(i) ?>Make functionality has been moved to
make.py, as certain modules can't be used as the main script, because reimporting them in processing instructions won't work. Now you can simply call:make.py --import xist.html --import spam eggs.xsc
There is a new module
cond.py, that contains elements that can be used for conditionals:<?xsc-exec a=42?> <if cond="a==21"> <b>foo</b> <elif cond="a==42"/> <i>bar</i> <else/> baz </if>
Changes in 0.3.9 (released 08/10/2000)
sgmlop will now be found either via
import sgmlopor viafrom xml.parsers import sgmlop.
Changes in 0.3.8 (released 07/14/2000)
Fixed a bug in
URLAttr.publish, which preventedURLAttrfrom working at all.
Changes in 0.3.7 (released 07/06/2000)
Fixed a bug in
html.imgandhtml.input. Now image size calculation works again.Changes in 0.3.6 (released 07/04/2000)
Fixed a bug in
Node._matches, which resulted in a non workingfind.
Changes in 0.3.5 (released 07/02/2000)
The documentation example has been enhanced. Now documenting methods works.
When the member
elementname: in the element class is set before callingregisterElement, this element name will be used for the element. This allows custom names even when usingregisterAllElements.Comparison of scheme and server in URLs is done case insensitive (as RFC 2068 requires.)
Image size calculation is now done in
asStringand not inasHTML. This allows to write faster code. Old method:e = html.div(html.img(...),gurk.hurz()).asHTML().asString()
New method:
e = html.div(html.img(...),gurk.hurz().asHTML()).asString()
Image size calculation is now done for
<input type="image">. Thesizeattribute is set to the image width.Manipulating the path in an URL is now done via the usual
__setitem__/__getitem__stuff, which keeps the path in a consistent state:>>> from xist.URL import URL >>> u = URL("/foo/*/../bar/baz.gif") >>> del u[1] >>> u URL(scheme='server', path=['bar'], file='baz', ext='gif')findNodes(which has been shortened tofind) has an additional argumenttest, which can be a test function that will be called when the node passes all other tests.asStringno longer generates a string directly, but uses the new methodpublish, which has an additional argumentpublisher, to which the strings to be output are passed.
Changes in 0.3.4 (released 05/31/2000)
Location information is now copied over in
clone,asHTMLandcompactwhere appropriate, so you know even in the HTML tree where something came from.xsc.repransican now have three values:- 0
coloring is off
- 1
coloring is on for a dark background
- 2
coloring is on for a light background
All
repransivariables are now arrays with two strings, the first for dark, the second for light.
Changes in 0.3.3 (released 05/30/2000)
The workaround for the trailing CDATA bug in sgmlop has been removed, so now you'll need a newer version of sgmlop (included in PyXML 0.5.5.1).
Changes before 0.3.3
These changes predate written history.