-
Notifications
You must be signed in to change notification settings - Fork 2
/
terrain.py
31 lines (25 loc) · 689 Bytes
/
terrain.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from lettuce import *
import ConfigParser
Config = ConfigParser.ConfigParser()
Config.read("config.ini")
world.config = Config
assert world.config.get('bitly', 'host') is not None
assert world.config.get('geonames', 'host') is not None
world.provider = None
Routes = ConfigParser.ConfigParser()
Routes.read("routes.ini")
world.routes = Routes
@world.absorb
def cfg(name, provider=None):
if provider is None:
provider = world.provider
assert provider is not None
return world.config.get(provider, name)
@world.absorb
def route(name):
return world.routes.get("routes", name)
@before.all
def clear_world_state():
world.params = {}
world.auth = None
world.values = {}