From 8dfcfb320acd2cb313bd47e95ed87820bd0002ea Mon Sep 17 00:00:00 2001 From: pepperpepperpepper Date: Sun, 29 Nov 2015 18:03:28 -0800 Subject: finished local version --- photoblaster/config.py | 2 +- photoblaster/modules/base.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/photoblaster/config.py b/photoblaster/config.py index 698927f..b4ad22e 100644 --- a/photoblaster/config.py +++ b/photoblaster/config.py @@ -1,6 +1,6 @@ import os LOCAL = True -if os.environ["PB_PRODUCTION"]: +if os.environ.get("PB_PRODUCTION"): LOCAL = False diff --git a/photoblaster/modules/base.py b/photoblaster/modules/base.py index dcb6a89..ada2504 100644 --- a/photoblaster/modules/base.py +++ b/photoblaster/modules/base.py @@ -211,8 +211,11 @@ class Pb(object): self._file_clean_local() def file_dict(self): + url = "%s/im/%s/%s" % (BASE_URL, self._hashdir, self.filename) + if LOCAL: + url = "/im/cache/%s" % self.filename return { - 'url': "%s/im/%s/%s" % (BASE_URL, self._hashdir, self.filename), + 'url': url, 'size': self.file_size, 'width': "%spx" % self.file_width, 'height': "%spx" % self.file_height, -- cgit v1.2.3-70-g09d2