pep8 much?
This commit is contained in:
parent
e77e45d8b8
commit
ed50bc746c
33 changed files with 92 additions and 99 deletions
|
@ -5,12 +5,12 @@ from util import hook, molecular
|
|||
import unicodedata
|
||||
|
||||
@hook.command()
|
||||
def namegen(inp, say = None, nick = None, input=None, notice=None):
|
||||
def namegen(inp, say=None, nick=None, input=None, notice=None):
|
||||
".namegen [modules] -- Generates some names using the chosen modules. '.namegen list' will display a list of all modules."
|
||||
|
||||
gen = molecular.Molecule()
|
||||
|
||||
all_modules = gen.list_modules() # get a list of available name files
|
||||
all_modules = gen.list_modules() # get a list of available name files
|
||||
|
||||
# return a list of all available modules
|
||||
if inp == "list":
|
||||
|
@ -21,13 +21,13 @@ def namegen(inp, say = None, nick = None, input=None, notice=None):
|
|||
|
||||
modules = []
|
||||
|
||||
selected_modules = inp.split(' ') # split the input into a list of modules
|
||||
selected_modules = inp.split(' ') # split the input into a list of modules
|
||||
|
||||
for module in selected_modules: # loop over the "selected_modules" list, and load any valid modules
|
||||
for module in selected_modules: # loop over the "selected_modules" list, and load any valid modules
|
||||
if module in all_modules:
|
||||
gen.load(module.encode('ascii'))
|
||||
|
||||
if not gen.name(): # lets try making a name to see if any modules actually got loaded
|
||||
if not gen.name(): # lets try making a name to see if any modules actually got loaded
|
||||
return "No valid modules specified :("
|
||||
|
||||
# time to generate some names and put them in a list
|
||||
|
|
Reference in a new issue