From fefe1ca4612517689d8dd7b579551a5a8e7df988 Mon Sep 17 00:00:00 2001 From: SuperSonic Date: Sat, 7 Sep 2019 16:43:11 +0800 Subject: [PATCH] v6.5.1_RC2 --- libs/i18n/__init__.py | 2 +- libs/i18n/en.py | 4 +++- libs/i18n/zh_TW.py | 4 +++- libs/yuuki.py | 18 ++++++++++++++---- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/libs/i18n/__init__.py b/libs/i18n/__init__.py index a82e0eb..2385a53 100644 --- a/libs/i18n/__init__.py +++ b/libs/i18n/__init__.py @@ -18,7 +18,7 @@ class Yuuki_LangSetting: return self.support[lang].i18nText[text] return self.support[self.default].i18nText[text] except KeyError: - return text + "\n\n{\n\tLanguage Package is not Work.\n\tPlease inform the Admin of the Yuuki.\n}" + return text + "\n\n{\n\tLanguage Package not work.\n\tPlease inform the Admin of the Yuuki.\n}" def _(self, text, lang=None): return self.gettext(text, lang) diff --git a/libs/i18n/en.py b/libs/i18n/en.py index cd63453..4839284 100644 --- a/libs/i18n/en.py +++ b/libs/i18n/en.py @@ -27,6 +27,7 @@ class English: "LINE System UserID:\n": "LINE System UserID:\n", "SecurityService of %s was disable": "SecurityService of %s was disable", "DO NOT KICK, thank you ^^": "DO NOT KICK, thank you ^^", + "Notice: Unknown command line argument(s)": "Notice: Unknown command line argument(s)", "DO NOT ENABLE THE GROUP URL STATUS, see you...": "DO NOT ENABLE THE GROUP URL STATUS, see you...", "Do not invite anyone...thanks": "Do not invite anyone...thanks", "The User(s) was in our blacklist database.": "The User(s) was in our blacklist database.", @@ -36,10 +37,11 @@ class English: "Kick Limit.": "Kick Limit.", "Cancel Limit.": "Cancel Limit.", "Testing...": "Testing...", - "Speed:\n%ss": "Speed:\n%ss", + "Speed:\n %s com/s": "Speed:\n %s com/s", "Bye Bye": "Bye Bye", "Not Found": "Not Found", "Okay": "Okay", + "Unknown": "Unknown", "Exit.": "Exit.", "Added": "Added" } diff --git a/libs/i18n/zh_TW.py b/libs/i18n/zh_TW.py index 88a4ad1..6ff6c20 100644 --- a/libs/i18n/zh_TW.py +++ b/libs/i18n/zh_TW.py @@ -27,6 +27,7 @@ class Traditional_Chinese: "LINE System UserID:\n": "LINE用戶識別碼:\n", "SecurityService of %s was disable": "%s的安全防護模式被已關閉", "DO NOT KICK, thank you ^^": "請不要踢人,謝謝 =3=", + "Notice: Unknown command line argument(s)": "提醒:未知的指令參數", "DO NOT ENABLE THE GROUP URL STATUS, see you...": "請不要開啟群組網址,再見了 0.0", "Do not invite anyone...thanks": "請不要邀請任何人,感謝配合 OwO", "The User(s) was in our blacklist database.": "這個臭小子在我們的黑名單中 =.=", @@ -36,10 +37,11 @@ class Traditional_Chinese: "Kick Limit.": "踢人次數已達上限", "Cancel Limit.": "取消次數已達上限", "Testing...": "測試中...", - "Speed:\n%ss": "速度為:\n%ss", + "Speed:\n %s com/s": "速度為:\n%s 指令/秒", "Bye Bye": "掰掰 ><", "Not Found": "404 不存在 0.0...", "Okay": "好的", + "Unknown": "未知", "Exit.": "已退出", "Added": "已增加" } diff --git a/libs/yuuki.py b/libs/yuuki.py index e5e7c89..ed5e471 100644 --- a/libs/yuuki.py +++ b/libs/yuuki.py @@ -19,7 +19,7 @@ class Yuuki_Settings: config = { "name": "Yuuki", - "version": "v6.5.1_RC1", + "version": "v6.5.1_RC2", "project_url": "https://tinyurl.com/syb-yuuki", "man_page": "https://tinyurl.com/yuuki-manual", "privacy_page": "OpenSource - Licensed under MPL 2.0", @@ -437,7 +437,7 @@ class Yuuki: Time1 = time.time() self.sendText(self.sendToWho(ncMessage), _("Testing...")) Time2 = time.time() - self.sendText(self.sendToWho(ncMessage), _("Speed:\n%ss") % (Time2 - Time1,)) + self.sendText(self.sendToWho(ncMessage), _("Speed:\n %s com/s") % (Time2 - Time1,)) elif self.YuukiConfigs["name"] + '/SecurityMode' == msgSep[0]: if ncMessage.message.from_ in self.Admin: if len(msgSep) == 2: @@ -458,16 +458,26 @@ class Yuuki: _("SecurityService of %s was disable") % (self.YuukiConfigs["name"],)) elif ncMessage.message.from_ in GroupPrivilege: status = [] + unknown_msg = [] + unknown_msgtext = "" for code in msgSep: try: status.append(int(code)) except: - pass + unknown_msg.append(code.replace(" ", "")) self.configSecurityStatus(ncMessage.message.to, status) + if unknown_msg != []: + for count, msg in enumerate(unknown_msg): + if count+1 == len(unknown_msg) and count != 0: + unknown_msgtext += msg + elif count != 0: + unknown_msgtext += (msg + ", ") if status != []: self.sendText(self.sendToWho(ncMessage), _("Okay")) else: self.sendText(self.sendToWho(ncMessage), _("Not Found")) + if unknown_msgtext != "": + self.sendText(self.sendToWho(ncMessage), _("Notice: Unknown command line argument(s)") + "\n({})".format(unknown_msgtext)) elif self.YuukiConfigs["name"] + '/DisableAll' == ncMessage.message.text: if ncMessage.message.toType == MIDType.GROUP: GroupInfo = self.getClient(self.MyMID).getGroup(ncMessage.message.to) @@ -511,7 +521,7 @@ class Yuuki: status_added.append(member.mid) for userId in self.data.getGroup(GroupInfo.id)["Ext_Admin"]: if userId not in status_added: - status += "Unknown: {}\n".format(userId) + status += "{}: {}\n".format(_("Unknown"), userId) self.sendText(self.sendToWho(ncMessage), status + _("\nExtend Administrator(s)")) else: self.sendText(self.sendToWho(ncMessage), _("Not Found"))