diff options
| author | yo mama <pepper@scannerjammer.com> | 2015-09-22 16:46:02 -0700 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2015-09-22 16:46:02 -0700 |
| commit | 3311bc27f52dc00b9226deb7e683754fa4c8316b (patch) | |
| tree | a90d6fcc9899c5c20d55d2ad92b8bdb2daafc891 /lib/Pb/__init__.py | |
| parent | d3e7b5708deffbed864c916de22663f48333c58b (diff) | |
ok finishing server
Diffstat (limited to 'lib/Pb/__init__.py')
| -rw-r--r-- | lib/Pb/__init__.py | 16 |
1 files changed, 12 insertions, 4 deletions
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 |
