Instantiate OfficeConverter just once

This commit is contained in:
Roberto Rosario
2011-11-21 08:22:00 -04:00
parent 9212a7027f
commit c598e4ceb3
2 changed files with 4 additions and 3 deletions

View File

@@ -14,8 +14,7 @@ from converter.literals import TRANSFORMATION_RESIZE, \
from converter.literals import DIMENSION_SEPARATOR
from converter.literals import FILE_FORMATS
from converter.utils import cleanup
from converter.office_converter import OfficeConverter
from converter.runtime import office_converter
HASH_FUNCTION = lambda x: hashlib.sha256(x).hexdigest()
@@ -52,7 +51,6 @@ def convert(input_filepath, output_filepath=None, cleanup_files=False, mimetype=
if os.path.exists(output_filepath):
return output_filepath
office_converter = OfficeConverter()
office_converter.convert(input_filepath, mimetype=mimetype)
if office_converter:
try:

View File

@@ -0,0 +1,3 @@
from converter.office_converter import OfficeConverter
office_converter = OfficeConverter()