summaryrefslogtreecommitdiff
path: root/util.py
diff options
context:
space:
mode:
authorBoYanZh <32470225+BoYanZh@users.noreply.github.com>2020-10-05 02:48:10 +0800
committerBoYanZh <32470225+BoYanZh@users.noreply.github.com>2020-10-05 02:48:10 +0800
commit11657edd4519e0432aa75324fdb0f9e9640b6494 (patch)
tree10835cf76628dc6a5b6c07975e967e4c55769b87 /util.py
parentba5d08bcf2e545f03a174961c0e6f470f8b22d23 (diff)
update: gitea worker and minor fix
Diffstat (limited to 'util.py')
-rw-r--r--util.py11
1 files changed, 9 insertions, 2 deletions
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