Skip to main content

TGPriFlash is a TurboGears flash implementation that supports multiple priority levels.

Install

Install with setuptools:

$ easy_install TGPriFlash

or download from http://pypi.python.org/pypi/TGPriFlash

Usage

Out of the box, 3 levels are defined (FLASH_INFO, FLASH_WARNING, FLASH_ALERT) but you can ignore these and use any integer values you like as the flash priority levels.

To “magically” replace (aka monkey patch) turbogears.flash() with this one, just add this import to your start-project.py:

import tg_pri_flash.flash

Within your project you can import turbogears.flash as normal:

from turbogears import flash

You’ll want to replace the tg_flash line in your master template:

<div py:if="tg_flash" class="flash" py:content="tg_flash"></div>

with something like this:

<div py:if="tg_flash and tg_flash[1]==0" class="flash_ok" py:content="tg_flash[0]"></div>
<div py:if="tg_flash and tg_flash[1]==1" class="flash_warning" py:content="tg_flash[0]"></div>
<div py:if="tg_flash and tg_flash[1]==2" class="flash_alert" py:content="tg_flash[0]"></div>

You would then define CSS definitions for each of the classes.

In your controller you can call flash() with a second argument, a positive integer:

flash( _(u"There was an error"), 2 )

or, using the built-in constants:

from tg_pri_flash.flash import FLASH_ALERT
flash( _(u"There was an error"), FLASH_ALERT )

Metadata

Release files for TGPriFlash 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TGPriFlash 0.1.2
File Size Uploaded Provenance Actions
TGPriFlash-0.1.2.tar.gz 6.7 kB Without provenance Details for TGPriFlash-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for TGPriFlash 0.1.2
File Interpreter ABI Platform Actions
TGPriFlash-0.1.2-py2.4.egg Legacy Egg format - - Details for TGPriFlash-0.1.2-py2.4.egg

Total release size: 12.3 kB

Release files / TGPriFlash-0.1.2.tar.gz

Download URL TGPriFlash-0.1.2.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d5e9d78b33763ad9377201763f4a9b4a0ea460044eb738c324a6b55bda676123
BLAKE2b-256 checksum
How to use checksums
17dda34e5768ab3d6f703e00ef4e69690c0183b1aa8704ca35f2b76cd541ebed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / TGPriFlash-0.1.2-py2.4.egg

Download URL TGPriFlash-0.1.2-py2.4.egg
Size 5.6 kB
Tags Egg
SHA-256 checksum
How to use checksums
173e9d661081d00190e85b30be8b51f46b56fca3974bffa394d9992f4e6e9d0b
BLAKE2b-256 checksum
How to use checksums
1f61b0762a41fc6ffdba435b1a8f67398d28b544de454c54e3592b9018fd9542
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for TGPriFlash 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

0.1.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page