"Importing modules as" doesn't seem to work with the urls tuple, it
raises an ImportError (#2). In fact, you can still use the original
name of the module(#3). Has anyone else found this to be the case?

###### actions.py
import web
class hello:
  def GET(self, name):
      i = web.input(times=1)
      if not name: name = 'world'
      for c in xrange(int(i.times)): print 'Hello,', name+'!'


###### code.py
import web

# 1
# This works.
import actions
urls = (
  '/(.*)', 'actions.hello',
)

# 2
# This doesn't work.
# import actions as foo
# urls = (
#   '/(.*)', 'foo.hello',
# )

# 3
## But this does!
# import actions as foo
# urls = (
#   '/(.*)', 'actions.hello',
# )

web.webapi.internalerror = web.debugerror
if __name__ == "__main__": web.run(urls, globals())
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to