From b31953b52692e6061c4a986570620124e2ee355f Mon Sep 17 00:00:00 2001 From: pepperpepperpepper Date: Wed, 9 Mar 2016 18:55:15 -0800 Subject: ok awesome --- photoblaster/_file.py | 9 ++- photoblaster/modules/pbconcat/__init__.py | 20 +++++-- photoblaster/server.py | 1 + share/frontend/imconcat/index.html | 97 +++++++++++++++++++++---------- 4 files changed, 89 insertions(+), 38 deletions(-) diff --git a/photoblaster/_file.py b/photoblaster/_file.py index ba8c0a6..3db52b8 100644 --- a/photoblaster/_file.py +++ b/photoblaster/_file.py @@ -27,15 +27,20 @@ class File(object): self.extension = extension self._directory = directory self._filename = None - self._creation_time = str(int(time.time())) + self._make_creation_time() self.set_filename( namepart=namepart, username=username ) + self._storage = "local" + self._make_hashdir() + + def _make_creation_time(self): + self._creation_time = str(int(time.time())) + def _make_hashdir(self): self._hashdir = sha.new( self.get_filepath() ).hexdigest()[:2] - self._storage = "local" @classmethod def from_url(cls, url, **kwargs): diff --git a/photoblaster/modules/pbconcat/__init__.py b/photoblaster/modules/pbconcat/__init__.py index 586fe43..68ebc6d 100644 --- a/photoblaster/modules/pbconcat/__init__.py +++ b/photoblaster/modules/pbconcat/__init__.py @@ -1,9 +1,9 @@ +import os from photoblaster.modules import ModuleBase from photoblaster.config import BIN_CONVERT, BIN_COMPOSITE, \ DEFAULT_FINALFORMAT, PBCONCAT_DIMENSIONS_LIMIT, PBCONCAT_FRAMES_LIMIT from photoblaster._file import File from subprocess import call -import copy _DEFAULT_DIRECTION = 'right' @@ -12,11 +12,19 @@ class SizeNotOkError(Exception): class PbConcatFile(File): + def __init__( + self, + filepath=None + ): + self._make_creation_time() + self._filename = os.path.basename(filepath) + self._directory = os.path.dirname(filepath) + self._make_hashdir() + self._storage = "local" @classmethod def from_file(cls, _file): - obj = copy.copy(_file) - obj.__class__ = PbConcatFile + obj = cls(filepath=_file.get_filepath()) return obj def get_frames(self): @@ -210,13 +218,17 @@ class PbConcat(ModuleBase): def _finalize_image(self): if len(self.get_output_file().get_frames()) > 1: - self.get_output_file().compile_frames(module=self) + return self.get_output_file().compile_frames(module=self) + self.get_output_file().get_frames()[0].set_filepath( + self.get_output_file().get_filepath() + ) def create(self): self._match_dimensions() self._make_frames_count_equal() self._merge_frames() self._finalize_image() + super(PbConcat, self).create() def _add_canvas(self, image, canvas_color="transparent"): diff --git a/photoblaster/server.py b/photoblaster/server.py index 081e16a..56cdd1b 100644 --- a/photoblaster/server.py +++ b/photoblaster/server.py @@ -217,6 +217,7 @@ class Server(object): return send_from_directory(WORKING_DIR, path) def _find_class_by_name(self, pb_classname): + sys.stderr.write("looking for %s\n" % pb_classname) pb_classname = self._classname_aliases.get(pb_classname, None) or \ pb_classname try: diff --git a/share/frontend/imconcat/index.html b/share/frontend/imconcat/index.html index 89a896b..e244c9e 100644 --- a/share/frontend/imconcat/index.html +++ b/share/frontend/imconcat/index.html @@ -34,24 +34,6 @@ margin-bottom: 10px; background-color: #222; } -// .logo-row{ -// display: inline; -// } -// div.logo-row{ -// max-width: 544px; -// width: 544px; -// } -// img.logo-row{ -// vertical-align: top; -// } -// #logo-scratch{ -// position:relative; -// top: -52px; -// } -// #logos{ -// width: 100%; -// -// } .btn{ margin-top: 10px; background-color: gray; @@ -84,6 +66,15 @@ #final_image > img{ width: 100%; } + #send_to_input{ + margin-top: 10px; + } + .dontshowme{ + display: none; + } + #error_message{ + color: red; + } @@ -97,6 +88,7 @@ imlandscape imbreak shader + ascii

@@ -109,25 +101,31 @@