X-Git-Url: https://plomlompom.com/repos/?p=plomlombot-irc.git;a=blobdiff_plain;f=plomlombot.py;h=3b480682fc42062d6698f9fbdf9643bd54d55258;hp=c835d56b80581a38a97968ec9806cc6edde7ad89;hb=41e7b73c51b47de7e39ac60e204b5bd62b7f9b58;hpb=a07cd87563d4ce92084884ba918b300ba97471b2 diff --git a/plomlombot.py b/plomlombot.py index c835d56..3b48068 100755 --- a/plomlombot.py +++ b/plomlombot.py @@ -214,13 +214,13 @@ def handle_command(command, argument, notice, target, session): tokens = [] else: tokens = argument.split(" ") - if len(tokens) != 0: - if (len(tokens) == 1 and not tokens[0].isdigit()) or \ - tokens[0] not in {"search", "offset-search"} or \ - (tokens[0] == "offset-search" and - ((not len(tokens) > 2) or (not tokens[1].isdigit()))): - help() - return + if (len(tokens) == 1 and not tokens[0].isdigit()) or \ + (len(tokens) > 1 and + (tokens[0] not in {"search", "offset-search"}) or + (tokens[0] == "offset-search" and + ((not len(tokens) > 2) or (not tokens[1].isdigit())))): + help() + return if not os.access(session.quotesfile, os.F_OK): notice("no quotes available") return @@ -253,7 +253,7 @@ def handle_command(command, argument, notice, target, session): notice("skipped all quotes matching query") else: notice("found %s matches, showing max. 3, skipping %s" - %s (len(results), to_skip)) + % (len(results), to_skip)) for i in range(len(results)): if i >= to_skip and i < to_skip + 3: result = results[i]