Ported GTS Phase I over from spline-pokedex.
[zzz-spline-gts.git] / spline / plugins / gts / __init__.py
1 from pkg_resources import resource_filename
2
3 from pylons import c, session
4
5 from spline.lib.plugin import PluginBase
6 from spline.lib.plugin import PluginBase, PluginLink, Priority
7 import spline.model as model
8 import spline.model.meta as meta
9
10 import spline.plugins.gts.controllers.gts
11 import spline.plugins.gts.model
12
13 def add_routes_hook(map, *args, **kwargs):
14 """Hook to inject some of our behavior into the routes configuration."""
15 # These are the GTS URLs
16 map.connect('/pokemondpds/worldexchange/{page}.asp', controller='gts', action='dispatch')
17 map.connect('/pokemondpds/common/{page}.asp', controller='gts', action='dispatch')
18
19
20 class GTSPlugin(PluginBase):
21 def controllers(self):
22 return dict(
23 gts = spline.plugins.gts.controllers.gts.GTSController,
24 )
25
26 def model(self):
27 return [
28 spline.plugins.gts.model.GTSPokemon,
29 ]
30
31 def template_dirs(self):
32 return [
33 (resource_filename(__name__, 'templates'), Priority.NORMAL)
34 ]
35
36 def hooks(self):
37 return [
38 ('routes_mapping', Priority.NORMAL, add_routes_hook),
39 ]