From e5d33198417aca8ae5bdee0045dcdb914fa68112 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 23 Jun 2021 21:11:17 +0200 Subject: [PATCH] =?UTF-8?q?ajout=20m=C3=A9thode=20v=C3=A9rification=20slas?= =?UTF-8?q?hCommand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/core.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/utils/core.py b/src/utils/core.py index c5bd7f8..fd3545d 100644 --- a/src/utils/core.py +++ b/src/utils/core.py @@ -125,3 +125,18 @@ def getChangelogs(version = 'latest'): except: pass return [changements["html_url"], changements["tag_name"][1:], changements["body"]] + +def isSlash(arg): + """Regarde si la commande viens d'un slash ou pas, retourne l'argument sans le 'True' si c'est le cas""" + fromSlash = False + fullarg = arg + if len(arg) > 0: + if arg[-1] == True or arg[-1] == None: + fromSlash = arg[-1] + fullarg = arg[:-1] + if len(fullarg) == 0: + arg = None + else: + arg = arg[0] + + return (arg, fromSlash, fullarg)