From 36801bda6a0daed4362ca702b73defa2b7f3a13d Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Tue, 19 Apr 2011 15:14:47 -0400 Subject: [PATCH] alphabetically sort list of files when loading command modules --- irc/command_handler.py | 1 + 1 file changed, 1 insertion(+) diff --git a/irc/command_handler.py b/irc/command_handler.py index de264bc..5f05e0d 100644 --- a/irc/command_handler.py +++ b/irc/command_handler.py @@ -10,6 +10,7 @@ commands = [] def init_commands(connection): """load all valid command classes from irc/commmands/ into the commands variable""" files = os.listdir(os.path.join("irc", "commands")) # get all files in irc/commands/ + files.sort() # alphabetically sort list of files for f in files: if f.startswith("_") or not f.endswith(".py"): # ignore non-python files or files beginning with "_"