Commit 547f270f by Gregory Martin

Final cleanup

parent b340f9c7
...@@ -8,6 +8,7 @@ Meant to enforce a lack of DB connection, so information about sequential IDs in ...@@ -8,6 +8,7 @@ Meant to enforce a lack of DB connection, so information about sequential IDs in
import logging import logging
import os import os
import subprocess
import sys import sys
import yaml import yaml
...@@ -16,6 +17,8 @@ from boto.exception import S3ResponseError ...@@ -16,6 +17,8 @@ from boto.exception import S3ResponseError
from boto.s3.key import Key from boto.s3.key import Key
from os.path import expanduser from os.path import expanduser
from video_worker.reporting import Output
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
homedir = expanduser("~") homedir = expanduser("~")
...@@ -73,7 +76,6 @@ class ForceColorspaceEncode(object): ...@@ -73,7 +76,6 @@ class ForceColorspaceEncode(object):
) )
encoding.run_file() encoding.run_file()
x += 100 x += 100
break
class FileReEncode(object): class FileReEncode(object):
...@@ -140,11 +142,19 @@ class FileReEncode(object): ...@@ -140,11 +142,19 @@ class FileReEncode(object):
sys_cmd += " -crf 27 -movflags faststart {new_filepath}".format( sys_cmd += " -crf 27 -movflags faststart {new_filepath}".format(
new_filepath=new_filepath new_filepath=new_filepath
) )
return_code = os.system(sys_cmd)
if return_code != 0: Output.status_bar(
print('[SCRIPT] Encode Error : {code}'.format(code=return_code)) process=subprocess.Popen(
return sys_cmd,
print('[SCRIPT] Encode Complete : {code}'.format(code=return_code)) stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True,
universal_newlines=True
)
)
# to be polite
print
print('[SCRIPT] Encode Complete')
def upload_file(self): def upload_file(self):
""" """
...@@ -170,8 +180,8 @@ class FileReEncode(object): ...@@ -170,8 +180,8 @@ class FileReEncode(object):
""" """
Delete working files Delete working files
""" """
print('[SCRIPT] Cleaning Workdir')
for file in os.listdir(self.workdir): for file in os.listdir(self.workdir):
print file
os.remove(os.path.join(self.workdir, file)) os.remove(os.path.join(self.workdir, file))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment