From be4411c287763b346a5ea70c66426ac49051a03d Mon Sep 17 00:00:00 2001 From: Sanket Dasgupta Date: Sun, 23 Apr 2017 21:35:44 +0530 Subject: [PATCH] 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 --- bonobo/ext/opendatasoft.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bonobo/ext/opendatasoft.py b/bonobo/ext/opendatasoft.py index 71b3600..44b1746 100644 --- a/bonobo/ext/opendatasoft.py +++ b/bonobo/ext/opendatasoft.py @@ -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