def _load_results(self, context): try: results, content_type = BaseHandler._load_results(self, context) except Exception: logger.exception('[ImagesHandler] Exception during _load_results', extra=log_extra(context)) self._error(500) return None, None return results, content_type
def topic(self, coords): return (BaseHandler.translate_crop_coordinates( original_width=coords['original_width'], original_height=coords['original_height'], width=coords['width'], height=coords['height'], crop_left=coords['crop_left'], crop_top=coords['crop_top'], crop_right=coords['crop_right'], crop_bottom=coords['crop_bottom']), coords)
def topic(self, coords): return (BaseHandler.translate_crop_coordinates( original_width=coords['original_width'], original_height=coords['original_height'], width=coords['width'], height=coords['height'], crop_left=coords['crop_left'], crop_top=coords['crop_top'], crop_right=coords['crop_right'], crop_bottom=coords['crop_bottom'] ), coords)
def setUp(self, *args, **kwargs): super(TranslateCoordinatesTestCase, self).setUp(*args, **kwargs) coords = self.get_coords() self.translate_crop_coordinates = BaseHandler.translate_crop_coordinates( original_width=coords['original_width'], original_height=coords['original_height'], width=coords['width'], height=coords['height'], crop_left=coords['crop_left'], crop_top=coords['crop_top'], crop_right=coords['crop_right'], crop_bottom=coords['crop_bottom'])
def setUp(self, *args, **kwargs): super(TranslateCoordinatesTestCase, self).setUp(*args, **kwargs) coords = self.get_coords() self.translate_crop_coordinates = BaseHandler.translate_crop_coordinates( original_width=coords['original_width'], original_height=coords['original_height'], width=coords['width'], height=coords['height'], crop_left=coords['crop_left'], crop_top=coords['crop_top'], crop_right=coords['crop_right'], crop_bottom=coords['crop_bottom'] )
def setUp(self): super().setUp() coords = self.get_coords() crop_coords = BaseHandler.translate_crop_coordinates( original_width=coords["original_width"], original_height=coords["original_height"], width=coords["width"], height=coords["height"], crop_left=coords["crop_left"], crop_top=coords["crop_top"], crop_right=coords["crop_right"], crop_bottom=coords["crop_bottom"], ) self.translate_crop_coordinates = crop_coords
def topic(self): ctx = Context(None, Config(), None) application = ThumborServiceApp(ctx) handler = BaseHandler(application, MagicMock()) handler._transforms = [] return handler
def _error(self, status, msg=None): return BaseHandler._old_error(self, status, msg)
def _store_results(self, context, results): if results is not None: BaseHandler._store_results(self, context, results)
def _write_results_to_client(self, context, results, content_type): if results is not None: BaseHandler._write_results_to_client(self, context, results, content_type)