.. _NEWS: History ======= This document describes the new features, bug fixes and changes in each version of XIST. For a description of how to update your code to each versions of XIST see :ref:`MIGRATION`. Changes in 5.75.1 (released 2024-04-11) --------------------------------------- * Added support for the HTML pseudo class ``:disabled`` to :func:`ll.xist.css.applystylesheets`. Now the following works:: >>> from ll.xist.ns import html >>> from ll.xist import css >>> e = html.html( ... html.style(''' ... button {color: blue;} ... button:disabled {color: red;} ... '''), ... html.button('gurk', disabled=True) ... ) ... >>> css.applystylesheets(e) >>> e.string() '' Changes in 5.75 (released 2023-11-21) ------------------------------------- * In UL4 ```` and ```` can now be nested, and otherwise can contain anything up to the matching ```` or ```` tag, but only if the initial ```` or ```` tag contains only whitespace (e.g. ```` etc.). This makes it possible to have source code examples in ```` or ```` tags. * Added a new class :class:`BoundTemplate` to :mod:`ll.ul4c`: This is an UL4 template bound to an object. Calling or rendering a :class:`BoundTemplate` instance passes the object to which the template is bound as the first positional argument. * Add attribute ``namespace`` to UL4 templates. * Add method ``timestamp`` to UL4 type ``datetime``. * The UL4 function ``getattr`` now returns an ``UndefinedKey`` object when accessing an undefined attribute and no default value is passed. * The result of calling ``dir()`` on an object in UL4 can now be customized by implementing ``ul4_dir()``. * Updated UL4 and UL4ON test infrastructure to work around problems with gradle. * Replace a check for the ElementTree method :meth:`getchildren` with a check for :meth:`findall` in :func:`xml2xsc.iterpath` since :meth:`getchildren` has been removed in Python 3.9. * Copied the implementation of :func:`cgi.parse_header` to :mod:`ll.misc` since :func:`cgi.parse_header` will be deprecated in Python 3.13. (:func:`cgi.parse_header` is used by :mod:`ll.url`, :mod:`ll.xist.ns.html` and :mod:`ll.xist.ns.jsp`). Changes in 5.74 (released 2023-03-01) ------------------------------------- * Fixed handling of the ``cond`` attribute in the PySQL command ``commit`` and ``rollback``. * Bumped required :mod:`cssutils` version to at least 2.6.0. * :mod:`ll.xist.css` now ignores the CSS pseudo classes ``:valid`` and ``:invalid``. * Since the Java and Javascript versions of UL4 now supports ``format(float)`` this is now checked by the tests. * The UL4 function ``format(float)`` now honors the specified language and uses the correct decimal separator. * Running the UL4 tests for Java now is done via Gradle, so the tests no longer require Java UL4 and all its dependencies on the ``CLASSPATH``. (Instead a full Java UL4 checkout is required in ``~/checkouts/LivingLogic.Java.ul4``.) Changes in 5.73.2 (released 2022-08-16) --------------------------------------- * Fixed handing of the CSS selectors ``:nth-child(odd)`` and ``:nth-child(even)`` in :func:`ll.xist.css.selector`. Changes in 5.73.1 (released 2022-08-10) --------------------------------------- * Fixed handling of the PySQL variable ``connection`` on ``connect`` and ``disconnect`` calls. Changes in 5.73 (released 2022-08-10) ------------------------------------- * :mod:`ll.pysql` now supports Postgres. To connect to a Postgres database pass a connectstring to :class:`connect` starting with ``postgres:``, for example:: connect("postgres:host=localhost dbname=test user=me password=secret") This will create a Postgres database connection via:: psycopg.connect( "host=localhost dbname=test user=me password=secret", cursor_factory=extras.DictCursor ) All other connectstrings will be interpreted as Oracle connectstrings. An Oracle connectstring may start with the prefix ``oracle:`` which will be stripped off, before passing it to :func:`cx_Oracle.connect` or :func:`ll.orasql.connect`. Note that Postgres currently doesn't support the :class:`drop_types` command. * Some PySQL commands have been renamed: :class:`resetsequence` to :class:`reset_sequence`, :class:`checkerrors` to :class:`check_errors`, :class:`raiseexceptions` to :class:`raise_exceptions`, :class:`pushraiseexceptions` to :class:`push_raise_exceptions` and :class:`popraiseexceptions` to :class:`pop_raise_exceptions`. * The PySQL commands :class:`procedure` and :class:`sql` have an additional argument ``argtypes`` that can be used to add casts to the parameter values in the call to convert the value to the proper Postgres datatype (to guide Postgres to find the correct overloaded version of the procedure). * When a :class:`var` object is passed a second time in PySQL, now instead of the variable's value a proper variable object will be passed to the :class:`procedure` or :class:`sql` call. This means if the variable gets changed by the call, the new value will be picked up by the local variable. If you want to pass the variable's value instead as a simple IN parameter, simply pass the local variable instead. * The argument ``raiseexceptions`` to various PySQL commands has been renamed to ``raise_exceptions``. Changes in 5.72 (released 2022-08-04) ------------------------------------- * :class:`ll.ul4c.TextAST` objects now always store the final text string instead of slicing it from the source code on every call. * UL4 AST classes store source offsets in the UL4ON dump now as two :class:`int`\s instead of a :class:`slice` object. The Java and Javascript implementations directly use these two ints instead of converting them to a :class:`slice` object. This reduces memory usage in the Java version. However the Python version still stores :class:`slice` objects internally. Changes in 5.71 (released 2022-07-08) ------------------------------------- * Fixed :func:`ll.xist.xfind.selector` when running under Python 3.9. * Restored support for :meth:`ll.xist.xsc._Node_Meta.__or__` for XIST classes under Python 3.9. * :class:`ll.xist.xfind.Selector` now implements the reflected operators too. This reenables certain argument combinations as :meth:`ll.xist.xsc._Node_Meta.__or__` isn't available on Python 3.10. * :class:`ll.xist.xfind.NotCombinator` now converts its argument to a :class:`~ll.xist.xfind.Selector` object, instead of expecting it to already be one. * Publishing of ```` and :: html.script("&").string(xhtml=2) outputs ```` as before. Changes in 5.70 (released 2022-03-11) ------------------------------------- * Fixed a bug in the PySQL command :class:`~ll.pysql.commit`: Removed the useless argument ``sql``. * Fixed a bug in the method :meth:`ll.orasql.Connection.getobject` (which we only keep for backwards compatibility). * Fixed a bug in parsing UL4 source code: UL4 would treat a tag name that starts with a valid prefix as a valid tag name, although it shouldn't (i.e. it treated ```` as ````). * Added new UL4 AST classes: :class:`~ll.ul4c.RenderOrPrintAST`, :class:`~ll.ul4c.RenderOrPrintXAST`, :class:`~ll.ul4c.RenderXOrPrintAST` and :class:`~ll.ul4c.RenderXOrPrintXAST`. Changes in 5.69 (released 2021-11-17) ------------------------------------- * The UL4 function ``urlquote()`` now uses :func:`urllib.parse.quote` instead of :func:`urllib.parse.quote_plus`. This means that the space character will get encoded as ``%20`` instead of ``+``. * :class:`ll.xist.xsc._Node_Meta` no longer overwrites :meth:`__or__` (since in Python 3.10 this now returns a union type). Instead :func:`ll.xist.xfind.selector` converts a union type into a :class:`ll.xist.xfind.IsInstanceSelector`. * Added the method ``keys`` to UL4 ``dict`` objects (The method was already documented). Changes in 5.68.1 (released 2021-09-23) --------------------------------------- * Fixed a bug in :mod:`ll.pysql` that resulted in the local variable ``connection`` being wrapped in a tuple. Changes in 5.68 (released 2021-08-04) ------------------------------------- * UL4 templates now support the ```` tag. It can be used to "comment out" template code. ````/```` tags nest. * Added the following three methods to :class:`ll.orasql.Table`: * :meth:`ll.orasql.Table.fks` returns all foreign keys for the table; * :meth:`ll.orasql.Table.uniques` returns all unique constraints for the table; * :meth:`ll.orasql.Table.checks` returns all check constraints for the table. * Fixed scoping problems in literal Python blocks in PySQL scripts: List comprehension were not able to access local variables. * Removed the ancient XIST namespace modules :mod:`ll.xist.ns.kid` and :mod:`ll.xist.ns.ihtml`. Changes in 5.67.2 (released 2021-06-30) --------------------------------------- * Fixed handling of values for the ``--define``/``--D`` option of :mod:`ll.pysql`. Changes in 5.67.1 (released 2021-06-28) --------------------------------------- * Fixed a typo in the tag ``external`` when logging exceptions in Sisyphus jobs. Changes in 5.67 (released 2021-06-25) ------------------------------------- * Added the options ``--sentry_environment``, ``--sentry_release`` and ``--sentry_debug`` to Sisyphus jobs. * Sisyphus jobs now warning when the modulde :mod:`sentry_sdk` can not be imported. * For Sisyphus jobs it's now possible to log to the :class:`ll.sisyphus.EMailLogger`, :class:`ll.sisyphus.MattermostLogger` and :class:`ll.sisyphus.SentryLogger` by using the tag ``external``. * The Sispyhus log message for setting up the Sentry logging is now a delayed message. * The method :meth:`ll.orasql.Connection.getobject` has been renamed to :meth:`ll.orasql.Connection.object_named`. * The method :meth:`ll.orasql.Connection.objects_name` has been added that returns all database objects with the specified name. Changes in 5.66.1 (released 2021-06-24) --------------------------------------- * When a sisyphus job logs to Sentry, flush messages after logging them to make sure that they arrive even in forking mode. Changes in 5.66 (released 2021-06-15) ------------------------------------- * UL4 now use functions and methods with positional-only parameters, so Python 3.8 is required now. * UL4 functions and methods have been updated to use positional-only or keyword-only arguments to match the signature of the corresponding Python function/method. * Some functions now use positional-only arguments: * ``ll.misc.item(iterable, index, /, default=None)`` * ``ll.misc.first(iterable, /, default=None)`` * ``ll.misc.last(iterable, /, default=None)`` * ``ll.misc.count(iterable, /)`` * ``ll.misc.isfirst(iterable, /)`` * ``ll.misc.islast(iterable, /)`` * ``ll.misc.isfirstlast(iterable, /)`` * ``ll.misc.monthdelta.__init__(self, months=0, /)`` * ``ll.ul4on.dumps(obj, /, indent)`` * ``ll.ul4on.dump(obj, /, stream, indent)`` * ``ll.ul4on.load(stream, /, registry=None)`` * ``ll.ul4on.loads(dump, /, registry=None)`` * ``ll.ul4on.loadclob(clob, /, bufsize=1024*1024, registry=None)`` as well as the UL4 function ``enumfl(iterable, /)``. * Subclasses of :class:`ll.ul4c.AST` have been renamed so that their name matches the name of the corresponding class in the Java implementation. (For example :class:`ll.ul4c.Add` has been renamed to :class:`ll.ul4c.AddAST`). * The UL4 function ``type()`` now returns "type objects" instead of simple strings. A type object can be used for checking whether an object is an instance of a certain type (via the newly introduced function ``isinstance()``). Some type objects can also be used to create new instances of that type (by calling the type object). * The following builtin UL4 functions are now callable type objects: ``bool``, ``int``, ``float``, ``str``, ``date``, ``datetime``, ``timedelta``, ``monthdelta``, ``list``, ``set``, ``dict`` and ``color.Color``. * The following modules have been added to the builtin UL4 objects: ``ul4`` contains all UL4 AST classes (``ul4.Template`` is callable to create an UL4 template from source), ``ul4on`` contains the functions ``dumps()`` and ``loads()`` and the types ``Encoder`` and ``Decoder``, ``operator`` contains the type ``attrgetter`` and ``math`` contains the constants ``e``, ``pi`` and ``tau`` as well as the functions ``cos()``, ``sin()``, ``tan()``, ``sqrt()`` and ``isclose()``. ``color`` contains the type ``Color`` and the functions ``css`` and ``mix``. * Naming of attributes that are used by UL4 to implement UL4 functionality has been made more uniform. This affects the following attributes: The methods :meth:`ul4_getattr`, :meth:`ul4_setattr` and :meth:`ul4_hasattr` for implementing object attribute access from UL4; the methods :meth:`ul4_call`, :meth:`ul4_render` and :meth:`ul4_renders` for making objects callable or renderable from UL4; the class attribute ``ul4_attrs`` for exposing a number of readonly attributes to UL4 and the attribute ``ul4_context`` that is used for marking a callable as needing the context as an argument in the call. * Now the ``ul4_attr`` attribute of objects gets honored in the implementation of the ``dir()`` function in UL4. * Support for using custom tag delimiters for UL4 templates has been removed, i.e. now the tag delimiters will always be ````. * :class:`ll.ul4on.Decoder` gained a new method :meth:`~ll.ul4on.Decoder.forget_persistent_object`. * :class:`ll.sisyphus.Job`\s can now log to Sentry__. __ https://sentry.io/ * :class:`ll.sisyphus.Task`\s constructor and the method :class:`ll.sisyphus.Job.task` now take arbitrary additional keyword arguments. Those will be passed as additional breadcrumb data when logging to Sentry. * :meth:`ll.sisyphus.Job.tasks` now takes an additional argument ``data`` that is responsible for returning additional data for the task. * The following methods of :class:`ll.color.Color` have been renamed: :meth:`abslum` to :meth:`abslight` and :meth:`rellum` to :meth:`rellight`. * The following methods have been added to :class:`ll.color.Color`: :meth:`~ll.color.Color.hue`, :meth:`~ll.color.Color.light`, :meth:`~ll.color.Color.sat`, :meth:`~ll.color.Color.withhue`, :meth:`~ll.color.Color.withsat`, :meth:`~ll.color.Color.withlum`, :meth:`~ll.color.Color.abslum`, :meth:`~ll.color.Color.rellum` and :meth:`~ll.color.Color.invert`. They have also been made available to UL4. The color method :meth:`~ll.color.Color.combine` and the functions :func:`ll.color.css` and :func:`ll.color.mix` are now also available to UL4. Changes in 5.65 (released 2021-01-13) ------------------------------------- * :mod:`ll.ul4on` now supports "persistent" objects, i.e. objects that can be uniquely identified across several unrelated decoding calls. Loading a persistent object that has been loaded before will reinitialize the existing object instead of creating a new one. * In sisyphus jobs, when the value of the ``nextrun`` parameter was a :class:`datetime.timedelta` object, it was interpreted relative to the start of the run, not relative to now. This has been fixed. * The modules :mod:`ll._xml_codec` and :mod:`ll.xist.sgmlop` have been updated to directly support and produce :pep:`393` style unicode strings. (:mod:`ll._misc` already supported them). * A method ``date`` has been added to ``date`` and ``datetime`` objects in UL4 templates. Changes in 5.64 (released 2020-10-30) ------------------------------------- * It is now possible to specify a custom port for ``ssh`` URLs. * A second URL scheme ``ssh-nocheck`` has been added for ``ssh`` URLs. Using ``ssh-nocheck`` disables the host key check when establishing the ``ssh`` connection. * With these changes it is now possible to do the following:: >>> from ll import url >>> u = url.URL("ssh-nocheck://www.example.org:2222/~/foo.txt") >>> with url.Context(): ... data = u.open("rb").read() Changes in 5.63.1 (released 2020-10-26) --------------------------------------- * Add a workaround for Python issue #41889 (https://bugs.python.org/issue41889) to :class:`~ll.misc.Enum` and :class:`~ll.misc.IntEnum`. Changes in 5.63 (released 2020-09-08) ------------------------------------- * All PySQL commands now support the argument ``cond``. * Added a PySQL command ``constraint_exists`` that checks the existance of database constraints. Changes in 5.62 (released 2020-07-13) ------------------------------------- * Update HTML for the documentation to use our own (RTD based) theme instead of using and overwriting the RTD theme. Changes in 5.61.2 (released 2020-07-09) --------------------------------------- * Fixed a regression in :mod:`ll.sisyphus` from 5.61.1: Stay in delayed logs mode after a successful job run. Changes in 5.61.1 (released 2020-07-09) --------------------------------------- * Fixed handling of the ``--exit_on_error`` option in :mod:`ll.sisyphus`. * Rewrote handling of delayed logs in :mod:`ll.sisyphus` to work better in forking mode. Changes in 5.61 (released 2020-07-07) ------------------------------------- * Updated handling of custom data types when calling functions or procedures in :mod:`ll.orasql` to work with :mod:`cx_Oracle` 8.0. * Reordered table comments, column comments and the primary key of a table in the output of :meth:`ll.orasql.Connection.objects` so that these objects have the same order as in :meth:`ll.orasql.Table.referencedby`. Changes in 5.60 (released 2020-07-03) ------------------------------------- * The handling of delayed logs and uneventful runs in :mod:`ll.sisyphus` has been changed: "Delayed logs" mode is now always active. If only delayed log messages are output they will never be written to the logfiles. If a job run is uneventful (i.e. :meth:`~ll.sisyphus.Job.execute` returns ``None``) no log messages will be written. If the job run is successful only the job result will be written. The option and the class/instance attribute ``delaylogs`` no longer exist. * Added a new option and class/instance attribute ``exit_on_error`` which will stop job execution in repeat mode when an exception occurs. Changes in 5.59 (released 2020-06-30) ------------------------------------- * :mod:`ll.orasql` now requires :mod:`cx_Oracle` 8.0. * :meth:`ll.orasql.Connection.objects` now outputs :class:`TableComment` objects too. * Fixed :meth:`ll.orasql.Table.comment` when the table was owned by a different user. Changes in 5.58 (released 2020-06-12) ------------------------------------- * For running healthchecks for sisyphus jobs it's no longer neccessary (or even allowed) to implement the :meth:`healthcheck` method. Instead the job writes a healthfile at the end of each run, and the age and content of this file will be used to determine the health of the job. The option ``--maxhealthcheckage`` can be used to configure the maximum allowed age. * Logging to emails was broken when sisyphus jobs were running in fork mode (the default): The child process was collecting log messages for the email, but the parent process didn't, so it never sent an email. This has been fixed now: Both processes write log messages to files, and those will be used after the job run to create the email. * Now links will be created for every possible result status of a job run. So it's immediate clear when the last successful job run was, when the last job run failed with an exception, was canceled or timed out. * The filenames for log files can no longer be changed via options or job attributes, instead one of the following methods must be overwritten: * :meth:`basedir` * :meth:`logfilename` * :meth:`currentloglinkname` * :meth:`lastsuccessfulloglinkname` * :meth:`lastfailedloglinkname` * :meth:`lastinterruptedloglinkname` * :meth:`lasttimeoutloglinkname` * :meth:`healthfilename` * :meth:`emailfilename` Those methods must return an absolute path as a :class:`pathlib.Path` object. Changes in 5.57 (released 2020-04-14) ------------------------------------- * Added a "delayed logs" mode to :mod:`ll.sisyphus`. This makes it possible to delay output of any log messages until something interesting happens. When nothing interesting happens, log messages will be thrown away. * Use :mod:`pathlib` internally for handling log file names in :mod:`ll.sisyphus`. * When a :mod:`ll.sisyphus` job compresses log files the compressed log file now retains the modification timestamp of the original log file. * The API for :class:`ll.ul4on.Encoder` and :class:`ll.ul4on.Decoder` has been updated to support multiple calls for encoding/decoding an UL4ON dump to multiple strings or streams that nonetheless keep the state for the encoding/decoding machinery. * UL4ON functionality is now available to UL4 templates in a ``ul4on`` "module". This module provides the functions/types ``loads``, ``dumps``, ``Decoder`` and ``Encoder``. * The parameter ``string`` for the UL4 function ``fromul4on`` has been renamed to ``dump``. Changes in 5.56 (released 2019-12-12) ------------------------------------- * :class:`ll.orasql.Comment` has been renamed to :class:`ll.orasql.ColumnComment`. * Added a class :class:`ll.orasql.TableComment` for table comments. * Added a method :meth:`ll.orasql.Table.comment` that returns the :class:`ll.orasql.TableComment` object for this table. * UL4 templates now support global variables. To be able to pass global variables to UL4 templates the following methods have been added to :class:`ll.ul4c.Template`: :meth:`render_with_globals`, :meth:`renders_with_globals` and :meth:`call_with_globals`. Changes in 5.55 (released 2019-11-11) ------------------------------------- * Added an option ``--ignoreerrors`` to ``orareindex``. * UL4 dictionaries now have a method ``pop()``. * Added an UL4 function ``scrypt`` implementing the scrypt hashing function (see https://en.wikipedia.org/wiki/Scrypt). * Added a new method :meth:`ll.orasql.Table.compression` that returns the table compression (``None``, ``"BASIC"`` or ``"ADVANCED"``). * Added a new method :meth:`ll.orasql.Column.compression` that returns the column compression for LOB columns (``None``, ``"LOW"``, ``"MEDIUM"`` or ``"HIGH"``). * :meth:`ll.orasql.Table.createsql` now can handle table and LOB column compression. * Added a method :meth:`loadcontentitems` to the class :class:`ll.ul4on.Decoder` which can be used to load the content of an object as ``(key, value)`` pairs. Changes in 5.54.1 (released 2019-10-24) --------------------------------------- * Fixed wrong HTTP header when posting sisyphus log entries to Mattermost. Changes in 5.54 (released 2019-10-24) ------------------------------------- * The tab width used by :func:`ll.xist.ns.html.astext` is now configurable and long words will no longer be broken across multiple lines. This should prevent long URLs from being broken. * ``ll.misc.sysinfo`` now exposes its attributes to UL4. * :mod:`ll.sisyphus` log entries can now be logged to a Mattermost chat channel. Changes in 5.53 (released 2019-09-30) ------------------------------------- * Fixed a bug in the handling of users and job classes (i.e. objects that don't have an owner) in :meth:`ll.orasql.OracleURLConnection.walk`. * Added an option ``--healthcheck`` to :mod:`ll.sispyhus` jobs: Starting a job with this option runs a separate method :meth:`healthcheck` that is used to check that the job is doing what it's supposed to be doing. Changes in 5.52.1 (released 2019-09-05) --------------------------------------- * Fixed handling of indentation when an UL4 ```` contains a ```` call. Changes in 5.52 (released 2019-07-29) ------------------------------------- * The method :meth:`getobject` for :class:`ll.orasql.Synonym` has been renamed to :meth:`object`. * A new method :meth:`ll.orasql.Privilege.object` has been added. This method returns the object for which the :class:`ll.orasql.Privilege` grants a privilege. E.g. if the :class:`~ll.orasql.Privilege` ``p`` grant the ``SELECT`` privilege on a table, ``p.object()`` will return that table. * A new method :meth:`ll.orasql.OwnedSchemaObject.synonyms` has been added. This generater yields all the synonyms for the object it is called on. * A new method :meth:`ll.orasql.OwnedSchemaObject.privileges` has been added. This generater yields all the privileges for the object it is called on. * A new method :meth:`ll.orasql.Connection.synonyms` has been added. * :meth:`ll.orasql.Synonym.createsql` now omits the schema name from the name for the object if it's the current user. Changes in 5.51 (released 2019-07-26) ------------------------------------- * :meth:`ll.orasql.Synonym.names` and :meth:`ll.orasql.Synonym.objects` can now filter on the owner of the object (i.e. the object for which the :class:`~ll.orasql.Synonym` is a synonym) via the new parameter ``object_owner``. * Fixed the ``repr`` output of UL4 dictionary comprehensions. Changes in 5.50 (released 2019-07-16) ------------------------------------- * There's a new option ``-a``/``--ascii`` for running PySQL scripts: With this PySQL will not use unicode characters for drawing fancy boxes. * Fixed a bug in the filename handling of PySQL, so that showing source in stacktraces works again: as we're changing directories now, using relative paths no longer worked. * PySQL no longer uses exception chaining for displaying the location and the include chain of an error, as this is now part of the normal stacktrace anyway. * Fixed logic for showing line numbers for locations in PySQL scripts. * Fixed a bug in the PySQL command ``resetsequence``. * Added classes :class:`ll.misc.Enum` and :class:`ll.misc.IntEnum` that are subclasses of :class:`enum.Enum` and :class:`enum.IntEnum`, but show the module and fully qualified class name in the :func:`repr` output for classes and instances. Changes in 5.49 (released 2019-07-04) ------------------------------------- * Privileges returned by :meth:`ll.orasql.Privilege.objects` will now have a stable sort order. Changes in 5.48 (released 2019-07-03) ------------------------------------- * Filename printed by a PySQL script will now always be relative to the current directory at the start of the script. * Fixed a bug in the filename handling of the PySQL command ``file``. Changes in 5.47 (released 2019-07-01) ------------------------------------- * Include commands in PySQL scripts now actually change the current directory so that literal Python blocks execute with the current directory set to the directory of the PySQL file containing the Python block. * The PySQL commands ``procedure`` and ``sql`` now report new variable values. Changes in 5.46 (released 2019-06-26) ------------------------------------- * The method :meth:`ll.scripts.rul4.Globals.log` now supports the keywords arguments ``sep``, ``end`` and ``flush`` with the same meaning as for :func:`print`. * Exception chaining in :meth:`ll.scripts.rul4.Globals.error` has been fixed. * For :func:`ll.xist.ns.html.astext` default styles have been added for ``em``, ``strong`` and ``i``. * :func:`ll.xist.ns.html.astext` now honors all styles passed as keyword arguments not just those for ``h1``, ``h2``, ``h3``, ``h4``, ``h5``, ``h6``, ``dl``, ``dt``, ``dd``, ``ol``, ``ol_li``, ``ul``, ``ul_li``, ``pre``, ``blockquote``, ``div``, ``p``, ``hr``, ``address``, ``th``, ``td``, ``b``, ``u`` and ``code``. * :func:`ll.xist.ns.html.astext` now supports callables for the ``prefix`` and ``suffix`` style parameter. If a callable is passed it will be called with the node in question and the resulting string is used as the prefix/suffix. For example it's possible to output links in Markdown syntax like this:: >>> from ll.xist.ns import html >>> e = html.p( ... "We ", ... html.em("love"), ... " ", ... html.a("Python", href="http://www.python.org/"), ... "!" ... ) >>> html.astext( ... e, ... a=dict( ... display="inline", ... prefix="(", ... suffix=lambda n: f")[{n.attrs.href}]" ... ) ... ) 'We *love* (Python)[http://www.python.org/]!' Changes in 5.45 (released 2019-06-24) ------------------------------------- * UL4 AST nodes for blocks now have additional attributes ``startpos`` and ``stoppos``. ``startpos`` is the position of the start tag and ``stoppos`` is the position of the end tag. The attributes ``line`` and ``col`` have been renamed to ``startline`` and ``startcol`` and attributes ``stopline`` and ``stopcol`` have been added. Furthermore two attributes ``startsource`` and ``stopsource`` have been added. They return the source code of the start tag and the end tag. So for example for the loop ```` the ``startsource`` is ```` and the ``stopsource`` is ```` (and ``source`` is ````). Additionally attributes ``startsourceprefix``, ``startsourcesuffix``, ``stopsourceprefix`` and ``stopsourcesuffix`` have been added. In exception messages ``startsource`` is now used as the exception location. This means when a for loop iterates over something that is not iteratable the location marked will now be the loop start tag instead of the complete loop. (For non-block nodes ``startpos`` is the same as ``pos``, ``startsource`` is the same as ``source``, ``startsourceprefix`` is the same as ``sourceprefix`` and ``startsourcesuffix`` is the same as ``sourcesuffix``.) Changes in 5.44 (released 2019-06-07) ------------------------------------- * :meth:`ll.orasql.Connection.objects` now outputs :class:`Job` objects too. Since Oracle provides no dependency information about jobs, :class:`Job` objects will always be output last (in "create" mode; in "drop" mode they will be output first). * :meth:`ll.orasql.Job.references` will now yield the appropriate :class:`ll.orasql.JobClass` object (if the job class isn't a system job class). * :meth:`ll.orasql.JobClass.referencedby` will now yield all :class:`ll.orasql.Job` objects that use this job class. * The ``owner`` argument for various :mod:`ll.orasql` methods now supports passing a set or tuple of owner names. * PySQL scripts now can contains PySQL commands in "function call form", i.e. ``checkerrors()`` instead of ``{'type': 'checkerrors'}``. * PySQL scripts can now contains literal Python source code (between lines with ``#>>>`` and ``#<<<``, e.g.:: #>>> ``cursor`` .cursor() cursor.execute("drop user foo cascade") #<<< * Comments in PySQL scripts are supported now (via lines starting with ``#``). * Since PySQL scripts can open their own database connections the ``connectstring`` argument for the ``pysql`` script is now optional. * The PySQL command ``compileall`` has been removed. This same effect can simply be achieved by calling ``utl_recomp.recomp_parallel()`` or ``dbms_utility.compile_schema()``. * Added several new PySQL commands: :class:`~ll.pysql.commit` and :class:`~ll.pysql.rollback`, :class:`~ll.pysql.drop_types`, :class:`~ll.pysql.user_exists`, :class:`~ll.pysql.object_exists` and :class:`~ll.pysql.env`. * The ``--commit`` argument for the pysql script (with the options ``record``, ``once`` and ``never``) has been replaced with a flag option ``--rollback``. Automatically committing after every record is no longer available. * The PySQL terminator comment (``-- @@@``) can now no longer be specified via a command line option. * The ``-v``/``--verbose`` option for :mod:`ll.pysql` now supports new output modes (``file`` and ``log``) and full mode now outputs much more information. * The :class:`~ll.url.URL` methods :meth:`~ll.url.URL.owner` and :meth:`~ll.url.URL.group` now will return the ``uid`` or ``gid`` respectively when the user or group name can't be determined instead of raising a :exc:`KeyError`. * Fixed SQL statement for dropping :class:`ll.orasql.Job` objects. Changes in 5.43 (released 2019-05-07) ------------------------------------- * The functions :func:`ll.xist.css.iterrules` and :func:`ll.xist.css.applystylesheets` now treat ``