def calculate_size(self, size): """Uses the function 'calculate_size' to calculate a size""" if isinstance(size, basestring): if size.endswith('*cols') or size.endswith('*col'): return int(size.split('*')[0]) * self.character_width elif size.endswith('*rows') or size.endswith('*row'): return int(size.split('*')[0]) * self.row_height return calculate_size(size)
def calculate_size(self, size): """Uses the function 'calculate_size' to calculate a size""" if isinstance(size, str): if size.endswith('*cols') or size.endswith('*col'): return int(size.split('*')[0]) * self.character_width elif size.endswith('*rows') or size.endswith('*row'): return int(size.split('*')[0]) * self.row_height return calculate_size(size)
def make_widget_rect(self, widget, band_rect): """Returns the right widget rect on the PDF canvas""" widget_rect = { 'left': band_rect['left'] + calculate_size(widget.left), 'top': band_rect['top'] - calculate_size(widget.top), 'right': band_rect['left'] + calculate_size(widget.left) + calculate_size(widget.width), 'bottom': band_rect['top'] - calculate_size(widget.top) + calculate_size(widget.height), 'height': calculate_size(widget.height), 'width': calculate_size(widget.width), } return widget_rect
def make_widget_rect(self, widget, band_rect): """Returns the right widget rect on the PDF canvas""" widget_rect = { "left": band_rect["left"] + calculate_size(widget.left), "top": band_rect["top"] - calculate_size(widget.top), "right": band_rect["left"] + calculate_size(widget.left) + calculate_size(widget.width), "bottom": band_rect["top"] - calculate_size(widget.top) + calculate_size(widget.height), "height": calculate_size(widget.height), "width": calculate_size(widget.width), } return widget_rect
def calculate_size(self, size): """Uses the function 'calculate_size' to calculate a size""" return calculate_size(size)