Gramex 1.50 Release Notes

Gramex has a new test framework

Gramex now has a test framework. This automates Gramex apps testing.

Translations are easier

$.translate() from g1 makes it easy to translate any content in a page. For example:

<ul>
  <li lang-target="de">This is translated into <em>German</em></li>
  <li lang-target="nl">This is translated into <em>Dutch</em></li>
</ul>
<script>
  $("[lang-target]").translate({ url: "./translate" });
</script>

… renders:

Gramex translate auto-detects the source languages if you leave the source blank. This helps when the source data has multiple languages (e.g. customer survey responses) and needs to be translated.

A few bugs have been fixed.

UI components have new colors, utilities and libraries

FontAwesome 5 free is now available, in addition to FontAwesome 4. FontAwesome 5 is the new default in gramex init. To use it:

<link
  rel="stylesheet"
  href="ui/@fortawesome/fontawesome-free/css/all.min.css"
/>

UI components now support:

The new UI theme picker looks like this:

Theme picker

g1 upgraded to 0.13

g1 is upgraded from 0.12 to 0.13. This release features:

CORS and FormHandler validation docs

Encrypt service is deprecated

The encrypt: service is no longer used. Gramex internally uses Tornado signed values for encryption instead.

The encrypt: service provided a way for Gramex services to share secret information. For example, between CaptureHandler and the page, or between alerts and CaptureHandler. This used RSA private keys. But this is a complex mechanism. Instead, we now use Tornado’s built-in mechanism that uses the cookie_secret setting in the application.

Bugfixes

Stats

Upgrade

To upgrade Gramex, run:

pip install --verbose gramex==1.50
gramex setup --all                      # Set up UI components, puppeteer, etc