-
Type: Improvement
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: QualifiedToSchedule
-
Component/s: Dev Tools
-
Tags:
The current syntax is powerful but not user-friendly:
other_versions = %(nuxeo-snapshot)s/%(nuxeo-tag)s/%(nuxeo-next_snapshot)s,%(marketplace-dam-snapshot)s/%(marketplace-dam-tag)s/%(marketplace-dam-next_snapshot)s
This is based on PEP 498 Literal String Interpolation:
- https://www.python.org/dev/peps/pep-0498/
- https://docs.python.org/2/library/configparser.html#ConfigParser.SafeConfigParser
1) Allow line return:
other_versions = %(nuxeo-snapshot)s/%(nuxeo-tag)s/%(nuxeo-next_snapshot)s, %(marketplace-diff-snapshot)s/%(marketplace-diff-tag)s/%(marketplace-diff-next_snapshot)s, %(marketplace-dam-snapshot)s/%(marketplace-dam-tag)s/%(marketplace-dam-next_snapshot)s
or use a trick:
other_versions.1 = %(nuxeo-snapshot)s/%(nuxeo-tag)s/%(nuxeo-next_snapshot)s other_versions.2 = %(marketplace-diff-snapshot)s/%(marketplace-diff-tag)s/%(marketplace-diff-next_snapshot)s other_versions.3 = %(marketplace-dam-snapshot)s/%(marketplace-dam-tag)s/%(marketplace-dam-next_snapshot)s
2) Look if the syntax can be simplified as in Python 3.6:
other_versions = {nuxeo-snapshot}/{nuxeo-tag}/{nuxeo-next_snapshot}, {marketplace-diff-snapshot}/{marketplace-diff-tag}/{marketplace-diff-next_snapshot}, {marketplace-dam-snapshot}/{marketplace-dam-tag}/{marketplace-dam-next_snapshot}