mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-21 15:14:13 +00:00
As per Luks suggestions.
This commit is contained in:
@@ -25,7 +25,7 @@ if version_info[3] == 'final':
|
||||
else:
|
||||
version_string = '%d.%d.%d' % version_info[:3]
|
||||
else:
|
||||
version_string = '%d.%d.%d_%s%d' % version_info
|
||||
version_string = '%d.%d.%d%s%d' % version_info
|
||||
__version__ = version_string
|
||||
|
||||
api_versions = ["0.10.0", "0.11.0", "0.12.0"]
|
||||
|
||||
@@ -476,12 +476,15 @@ def func_firstalphachar(parser, text, nonalpha="#"):
|
||||
def func_initials(parser, text):
|
||||
return "".join(a[:1] for a in text.split(" ") if a[:1].isalpha())
|
||||
|
||||
def func_trunc(parser, text, length):
|
||||
def func_firstwords(parser, text, length):
|
||||
if len(text) <= length:
|
||||
return text
|
||||
else:
|
||||
return text[:length].rsplit(' ', 1)[0]
|
||||
|
||||
def func_truncate(parser, text, length):
|
||||
return text[:length].rtrim()
|
||||
|
||||
register_script_function(func_if, "if", eval_args=False)
|
||||
register_script_function(func_if2, "if2", eval_args=False)
|
||||
register_script_function(func_noop, "noop", eval_args=False)
|
||||
@@ -520,4 +523,5 @@ register_script_function(func_performer, "performer")
|
||||
register_script_function(func_matchedtracks, "matchedtracks")
|
||||
register_script_function(func_firstalphachar, "firstalphachar")
|
||||
register_script_function(func_initials, "initials")
|
||||
register_script_function(func_trunc, "trunc")
|
||||
register_script_function(func_firstwords, "firstwords")
|
||||
register_script_function(func_truncate, "truncate")
|
||||
|
||||
Reference in New Issue
Block a user