summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Pb/__init__.py11
-rw-r--r--lib/Server/__init__.py2
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/Pb/__init__.py b/lib/Pb/__init__.py
index bfb9d36..c717cc4 100644
--- a/lib/Pb/__init__.py
+++ b/lib/Pb/__init__.py
@@ -178,18 +178,17 @@ class Pb(object):
s3cli.s3move(self.filepath, "im/{}/{}".format(self._hashdir, self.filename))
self._file_clean_local();
- def file_json(self):
- return json.dumps({
+ def file_dict(self):
+ return {
'url' : "%s/im/%s/%s" % (BASE_URL, self._hashdir, self.filename),
'size' : self.file_size,
'width' : "%spx" % self.file_width,
'height' : "%spx" % self.file_height,
- })
+ }
def create(self):
- #base methods
- if self.__class__.__name__ == 'Pb':
- return
+ #base methods FIXME move into File class
+
self._file_dimensions()
self._file_size_get()
self._cleanup();
diff --git a/lib/Server/__init__.py b/lib/Server/__init__.py
index 6e6d8a7..91bc880 100644
--- a/lib/Server/__init__.py
+++ b/lib/Server/__init__.py
@@ -42,7 +42,7 @@ class Server(object):
pb.create();
pb.file_s3move()
pb.db_send();
- return pb.file_json();
+ return jsonify(pb.file_dict());
#FIXME handle BadParamsError and PbError separately
except Exception as e: