Added python only converter backend supporting resizing, zooming and rotation

This commit is contained in:
Roberto Rosario
2011-07-16 04:03:17 -04:00
parent 7a5f0fed0b
commit 7289cafdfd
5 changed files with 45 additions and 73 deletions
+1 -25
View File
@@ -2,13 +2,6 @@ class ConverterBase(object):
"""
Base class that all backend classes must inherit
"""
def identify_file(self, input_filepath, *args, **kwargs):
raise NotImplementedError("Your %s class has not defined a identify_file() method, which is required." % self.__class__.__name__)
def identify_document(self, document, *args, **kwargs):
raise NotImplementedError("Your %s class has not defined a identify_document() method, which is required." % self.__class__.__name__)
def convert_file(self, input_filepath, *args, **kwargs):
raise NotImplementedError("Your %s class has not defined a convert_file() method, which is required." % self.__class__.__name__)
@@ -20,23 +13,6 @@ class ConverterBase(object):
def get_available_transformations(self):
raise NotImplementedError("Your %s class has not defined a get_available_transformations() method, which is required." % self.__class__.__name__)
def get_transformation_string(self, transformation_list):
transformations = []
warnings = []
transformation_choices = self.get_available_transformations()
for transformation in transformation_list:
try:
if transformation['transformation'] in transformation_choices:
transformations.append(
transformation_choices[transformation['transformation']]['command_line'] % eval(
transformation['arguments']
)
)
except Exception, e:
warnings.append(e)
return u' '.join(transformations), warnings
def get_page_count(self):
raise NotImplementedError("Your %s class has not defined a get_page_count() method, which is required." % self.__class__.__name__)