From 11657edd4519e0432aa75324fdb0f9e9640b6494 Mon Sep 17 00:00:00 2001 From: BoYanZh <32470225+BoYanZh@users.noreply.github.com> Date: Mon, 5 Oct 2020 02:48:10 +0800 Subject: update: gitea worker and minor fix --- util.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'util.py') diff --git a/util.py b/util.py index e1c9e2d..bd916df 100644 --- a/util.py +++ b/util.py @@ -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 -- cgit v1.2.3