Skip to content

Commit

Permalink
update docs for 4.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
lehenbauer committed Sep 9, 2021
1 parent 0f41193 commit 7ac3881
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Doc/reference/tohil_python_functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Tohil Python Functions
Tohil has a number of functions and data types that it provides
when the tohil package has been imported.

.. function:: tohil.alias(name, callback)

Identical to `register_callback` and under consideration to replace it
as the command used to alias Tcl commands to Python commands, although
backwards compatibility would be maintained.

.. function:: tohil.call(* args[, to=type])

Invoke a Tcl command while specifying each argument explicitly,
Expand Down
2 changes: 1 addition & 1 deletion Doc/tools/templates/indexcontent.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% block body %}
<h1>{{ docstitle|e }}</h1>
<p>
{% trans %}Welcome! This is the documentation for Tohil {{ release }}. Tohil, a feathered serpent, joins Python and Tcl at the hip.{% endtrans %}
{% trans %}Welcome! This is the documentation for Tohil {{ release }}. Tohil, a feathered serpent, powerfully joins Python and Tcl.{% endtrans %}
</p>
<img src="_images/tohil-237px.png" width="247" height="240" alt="Tohil graphic">
<p><strong>{% trans %}Parts of the documentation:{% endtrans %}</strong></p>
Expand Down
70 changes: 70 additions & 0 deletions Doc/whatsnew/4.2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

.. 4.2.rst:
****************************
What's New In Tohil 4.2
****************************

Welcome to Tohil 4.2.

4.2 is primarily a maintenance release, but includes at least one really
nice new feature:

===================================================================================
Python code passed to tohil::exec is now unindented before being passed to Python
===================================================================================

Tohil's #1 new feature request! Up until now, the argument to ``tohil::exec``
had to obey Python indentation rules including there being no indentation at all
for the top level, leading to ugly stuff like:

::

tohil::exec {
def new_validate(self, data):
return json.loads(base64.b64decode(data))
}

^ The "def" here has to occur at the beginning of the line, i.e. not be preceded
by any spaces or
tabs, or Python will raise an exception. This nesting does not "read" well.

To make it easier to make your code read well and comply with Python indentation rules,
if the first nonblank line starts with whitespace, tohil::exec will un-indent the code block
such that the first line is not indented at all and following lines are undented
to match, all done lickety split, natively in C.

So you can now nest your embedded Python code in a more standard way:

::

tohil::exec {
def new_validate(self, data):
return json.loads(base64.b64decode(data))
}

=======================================
Additional Improvements
=======================================

* Added ``-nonevalue`` option to ``tohil::call``, allowing the "none" sentinel
to be specified arbitrarily (Retains the default value of ``tohil::NONE``.)
* Cleaned up tohil namespace so ``dir(tohil)`` doesn't show modules tohil imported as
if it had created them.
* Made ``package forget tohil`` work.
* Added support for the Tcl ``unload`` command to be able to unload the Tohil shared
library. (Consider it risky, though.)

========================================
Bug Fixes
========================================

* Fixed crash when register_callback-registered functions raised a Python exception

=====================================
Improved Build Support
=====================================

* Added support for building tohil as a Debian package
* Homebrew formula for building with homebrew

1 change: 1 addition & 0 deletions Doc/whatsnew/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
.. toctree::
:maxdepth: 2

4.2.rst
4.1.rst
4.0.rst
3.2.rst
Expand Down

0 comments on commit 7ac3881

Please sign in to comment.