Skip to content

Commit

Permalink
write tags to the expression functions help object
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Dec 3, 2019
1 parent 7fbf2c8 commit 314e233
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions resources/function_help/json/string_to_array
Expand Up @@ -7,6 +7,6 @@
{"arg":"delimiter","optional":true,"default":"','","description":"the string delimiter used to split the input string"},
{"arg":"empty_value","optional":true,"default":"''","description":"the optional string to use as replacement for empty (zero length) matches"}],
"examples": [ { "expression":"string_to_array('1,2,3',',')", "returns":"[ '1', '2', '3' ]"},
{ "expression":"string_to_array('1,,3',',','0')", "returns":"[ '1', '0', '3' ]"}
]
{ "expression":"string_to_array('1,,3',',','0')", "returns":"[ '1', '0', '3' ]"}],
"tags": [ "split", "convert", "seperate" ]
}
10 changes: 9 additions & 1 deletion scripts/process_function_template.py
Expand Up @@ -111,7 +111,15 @@ def quote(v):
)

if 'notes' in v:
cpp.write(",\n tr( \"{0}\" )".format(v['notes']))
cpp.write(",\n tr( \"{0}\" )".format(v['notes']))
else:
cpp.write(",\n QString()")

if 'tags' in v:
cpp.write(",\n QStringList()")

for t in v['tags']:
cpp.write("\n << QStringLiteral( \"{0}\" ) << tr( \"{0}\" )".format(t))

cpp.write("\n )")

Expand Down

0 comments on commit 314e233

Please sign in to comment.