Crashfix: pokemon_sprite() no longer exists.
[zzz-spline-gts.git] / splinext / gts / __init__.py
1 from pkg_resources import resource_filename
2
3 from pylons import session, tmpl_context as c
4
5 from spline.lib.plugin import PluginBase
6 from spline.lib.plugin import PluginBase, PluginLink, Priority
7 import splinext.gts.controllers.gts
8 import splinext.gts.controllers.gts_browse
9
10 def add_routes_hook(map, *args, **kwargs):
11 """Hook to inject some of our behavior into the routes configuration."""
12 # These are the GTS URLs
13 map.connect('/pokemondpds/worldexchange/{page}.asp', controller='gts', action='dispatch')
14 map.connect('/pokemondpds/common/{page}.asp', controller='gts', action='dispatch')
15
16 # Web-side stuff
17 map.connect('/gts', controller='gts_browse', action='list')
18
19
20 class GTSPlugin(PluginBase):
21 def controllers(self):
22 return dict(
23 gts = splinext.gts.controllers.gts.GTSController,
24 gts_browse = splinext.gts.controllers.gts_browse.GTSBrowseController,
25 )
26
27 def hooks(self):
28 return [
29 ('routes_mapping', Priority.NORMAL, add_routes_hook),
30 ]