opendatasoft.py: Add timezone arg

The timezone argument is needed for bonobo/examples/fablabs.py
to properly run.

Fixes https://github.com/python-bonobo/bonobo/issues/22
This commit is contained in:
Sanket Dasgupta
2017-04-23 21:35:44 +05:30
parent 26cc60312d
commit be4411c287

View File

@ -20,11 +20,12 @@ class OpenDataSoftAPI(Configurable):
netloc = Option(str, default='data.opendatasoft.com')
path = Option(path_str, default='/api/records/1.0/search/')
rows = Option(int, default=100)
timezone = Option(str, default='Europe/Paris')
kwargs = Option(dict, default=dict)
@ContextProcessor
def compute_path(self, context):
params = (('dataset', self.dataset), ('rows', self.rows), ) + tuple(sorted(self.kwargs.items()))
params = (('dataset', self.dataset), ('rows', self.rows), ('timezone', self.timezone)) + tuple(sorted(self.kwargs.items()))
yield self.endpoint.format(scheme=self.scheme, netloc=self.netloc, path=self.path) + '?' + urlencode(params)
@ContextProcessor