diff options
author | BoYanZh <32470225+BoYanZh@users.noreply.github.com> | 2020-10-05 02:48:10 +0800 |
---|---|---|
committer | BoYanZh <32470225+BoYanZh@users.noreply.github.com> | 2020-10-05 02:48:10 +0800 |
commit | 11657edd4519e0432aa75324fdb0f9e9640b6494 (patch) | |
tree | 10835cf76628dc6a5b6c07975e967e4c55769b87 /util.py | |
parent | ba5d08bcf2e545f03a174961c0e6f470f8b22d23 (diff) |
update: gitea worker and minor fix
Diffstat (limited to 'util.py')
-rw-r--r-- | util.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1,5 +1,5 @@ import logging - +import re class Logger(): _instance = None @@ -27,4 +27,11 @@ def first(iterable, condition=lambda x: True): try: return next(x for x in iterable if condition(x)) except StopIteration: - return None
\ No newline at end of file + return None + +def getProjRepoName(arg): + id_, name, projNum, *_ = arg + eng = re.sub('[\u4e00-\u9fa5]', '', name) + eng = ''.join( + [word[0].capitalize() + word[1:] for word in eng.split()]) + return f"{eng}{id_}-p{projNum}"
\ No newline at end of file |