From 3311bc27f52dc00b9226deb7e683754fa4c8316b Mon Sep 17 00:00:00 2001 From: yo mama Date: Tue, 22 Sep 2015 16:46:02 -0700 Subject: ok finishing server --- lib/Pb/__init__.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lib/Pb/__init__.py') diff --git a/lib/Pb/__init__.py b/lib/Pb/__init__.py index 4a5c75d..1b3c79e 100644 --- a/lib/Pb/__init__.py +++ b/lib/Pb/__init__.py @@ -8,7 +8,7 @@ from subprocess import Popen,PIPE,call from Params import Params import sha import simplejson as json -from _S3 import _S3 +from S3Cli import S3Cli from Db import Db BASE_URL = "http://i.asdf.us" @@ -159,7 +159,7 @@ class Pb(object): _insert_data = { 'date' : self._now, 'remote_addr' : remote_addr, - 'username' : self.params.username, + 'username' : str(self.params.username), 'url' : self._db_url_param, 'directory' : self._hashdir, 'oldfile' : None, @@ -175,8 +175,8 @@ class Pb(object): def file_s3move(self): self._hashdir_create() - s3conn = _S3() - s3conn.s3move(self.filepath, "im/{}/{}".format(self._hashdir, self.filename)) + s3cli = S3Cli() + s3cli.s3move(self.filepath, "im/{}/{}".format(self._hashdir, self.filename)) self._file_clean_local(); def file_json(self): @@ -187,6 +187,14 @@ class Pb(object): 'height' : "%spx" % self.file_height, }) + def create(self): + #base methods + if self.__class__.__name__ == 'Pb': + return + self._file_dimensions() + self._file_size_get() + self._cleanup(); + from Pb.Grid import PbGrid from Pb.Break import PbBreak from Pb.Pattern import PbPattern -- cgit v1.2.3-70-g09d2