Пример #1
0
 def parse_label(self, label):
     """ Extract a label. """
     x = int(label.get('x'))
     y = int(label.get('y'))
     text = label.get('text')
     align = label.get('align')
     rotation = float(label.get('rotation'))
     parsed_label = Label(x, y, text, align, rotation)
     parsed_label.styles = label.get('styles') or {}
     return parsed_label
Пример #2
0
 def parse_label(self, label):
     """ Extract a label. """
     x = int(label.get('x'))
     y = int(label.get('y'))
     text = label.get('text')
     font_size = label.get('font_size')
     font_family = label.get('font_family')
     align = label.get('align')
     baseline = label.get('baseline')
     rotation = float(label.get('rotation'))
     parsed_label = Label(x, y, text, font_size, font_family, align, baseline, rotation)
     parsed_label.styles = label.get('styles') or {}
     return parsed_label
 def parse_label(self, label):
     """ Extract a label. """
     if label is None:
         return None
     x = int(label.get("x"))
     y = int(label.get("y"))
     text = label.get("text")
     font_size = label.get("font_size")
     font_family = label.get("font_family")
     align = label.get("align")
     baseline = label.get("baseline")
     rotation = float(label.get("rotation"))
     parsed_label = Label(x, y, text, font_size, font_family, align, baseline, rotation)
     parsed_label.styles = label.get("styles") or {}
     return parsed_label
Пример #4
0
 def parse_label(self, label):
     """ Extract a label. """
     if label is None:
         return None
     x = int(label.get('x'))
     y = int(label.get('y'))
     text = label.get('text')
     font_size = label.get('font_size')
     font_family = label.get('font_family')
     align = label.get('align')
     baseline = label.get('baseline')
     rotation = float(label.get('rotation'))
     parsed_label = Label(x, y, text, font_size, font_family, align,
                          baseline, rotation)
     parsed_label.styles = label.get('styles') or {}
     return parsed_label