Browse Source

fix arg handling in git.py

tags/v0.1
Ben Kurtovic 13 years ago
parent
commit
6066ded6dc
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      irc/commands/git.py

+ 3
- 2
irc/commands/git.py View File

@@ -15,7 +15,7 @@ def call(a, d):
if not check_user_is_admin(): if not check_user_is_admin():
return return


args = get_args()
get_args()
if not check_has_args(): if not check_has_args():
return return
@@ -40,10 +40,11 @@ def call(a, d):


def get_args(): def get_args():
"""get command arguments""" """get command arguments"""
global args
args = data.msg.strip().split(' ') # strip out extra whitespace and split the message into a list args = data.msg.strip().split(' ') # strip out extra whitespace and split the message into a list
while '' in args: # remove any empty arguments while '' in args: # remove any empty arguments
args.remove('') args.remove('')
return args[1:] # remove the command itself
args = args[1:] # remove the command itself


def check_user_is_admin(): def check_user_is_admin():
"""check if the user is a bot admin (and can use this command, as a result)""" """check if the user is a bot admin (and can use this command, as a result)"""


Loading…
Cancel
Save