Bug 32654 - API: extend @%@ syntax to include default value and/or True/False handling
API: extend @%@ syntax to include default value and/or True/False handling
Status: NEW
Product: UCS
Classification: Unclassified
Component: UCR
UCS 4.4
Other Linux
: P5 enhancement (vote)
: UCS 3.x
Assigned To: UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-20 11:44 CEST by Philipp Hahn
Modified: 2020-06-22 17:14 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2013-09-20 11:44:30 CEST
May template files use the easier @%@ UCR syntax to reference a UCR variable, which often breaks the syntax when the variable is unset.

Because of that the Python-variant using @!@ is used in many cases, because there unset variables can be handled better. This is a lot more complicated, error prone and also requires a fork of a Python process for each @!@ block (see bug #29484).

@%@ should be extended to allow some more output handling, e.g.
  @%@foo?bar@%@
    Print content of UCRV $foo or fallback to string literal 'bar'.
  @%@foo?n?True=y@%@
  @%@foo?n?False=y@%@
    Use is_true() and is_false() and either print 'y' or 'n'.

'?' and '=' are good candidates, since UCRV names can't contains those two characters.
Together with UCRV types (Bug #8768) this could be even improved further for list handling.
Comment 1 Florian Best univentionstaff 2016-09-08 14:46:10 CEST
Bug #19768 and Bug #31606 would benefit from this.
Comment 2 Philipp Hahn univentionstaff 2017-01-11 12:21:45 CET
See Bug #38938 for an alternative for default handling