The week in review...
I had two chumps come in to put two new doors in as part of the kitchen renovation, and they did an absolutely "stellar" job, including leaving a hole in the wall, using white painted wood when we wanted unpainted wood, and generally making a fucking mess.
I've just about managed to clean up the hole in the wall with judicious use of "husfix rapid" which they were kind enough to give us, but I'm really not happy with the 7000KR (~Ãrn mynamespace.two()
except:
return "there was an error processing your request (:"
... of course, that's not gonna work.
Queue some hours (days, actually) - of reading, searching, trying exotic tricks like the (apparantly old) knee module, trying __import__() magic, and other various hacks - before finally stumbling across this gem:
http://stackoverflow.com/questions/211100/pythons-import-doesnt-work-as-expected
Namely:
def my_import(name):
mod = __import__(name)
components = name.split('.')
for comp in components[1:]:
mod = getattr(mod, comp)
return mod
So, now I have:
try:
mname = "lc." + str(one)
mod = my_import(mname)
if two == False:
two = "index"
f = getattr(mod, two)
return f()
except:
return "Sorry, I wasn't able to process your request."
Great stuff!