I guess I lost it.

On Apr 7, 4:12 am, AchipA <attila.cs...@gmail.com> wrote:
> Apropos, there was a patch to support per domain routes a week ago (or
> two), can you tell what's the status on that one ?
>
> On Apr 6, 9:40 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > OK. email me the patch.
>
> > Massimo
>
> > On Apr 6, 2:09 pm, Robin B <robi...@gmail.com> wrote:
>
> > > I thought it would be cool to have a routes.py for each application,
> > > so I put the following in web2py/routes.py, which combines the routes
> > > from each application/*/routes.py at boot time.
>
> > > web2py/routes.py:
>
> > > from gluon.fileutils import listdir
> > > import os,glob
> > > apps_with_routes = []
> > > app_routes = glob.glob('applications/*/routes.py')
> > > for ar in app_routes:
> > >   dir,r = os.path.split(ar)
> > >   dir,app = os.path.split(dir)
> > >   apps_with_routes.append(app)
>
> > > routes_in_list = routes_out_list = []
> > > for app in apps_with_routes:
> > >   module_name = 'applications.%s.routes' % app
> > >   m = __import__(module_name,globals(),locals(),[''])
> > >   routes_in_list.extend(list(m.routes_in))
> > >   routes_out_list.extend(list(m.routes_out))
>
> > > routes_in=set(routes_in_list)
> > > routes_out=set(routes_out_list)
>
> > > applications/welcome/routes.py:
>
> > > app = 'welcome'
> > > con = 'default'
> > > main = (app,con)
>
> > > routes_in=(
> > >    ('/','/%s/%s/index' % main),    # homepage
> > > )
> > > routes_out = [(x,y) for (y,x) in routes_in]
>
> > > Using an approach like this allows you to distribute a routes.py with
> > > your application code.
>
> > > Robin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to