Pārlūkot izejas kodu

alphabetically sort list of files when loading command modules

tags/v0.1
Ben Kurtovic pirms 13 gadiem
vecāks
revīzija
36801bda6a
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. +1
    -0
      irc/command_handler.py

+ 1
- 0
irc/command_handler.py Parādīt failu

@@ -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 "_"


Notiek ielāde…
Atcelt
Saglabāt