def get_val(self, s):
     #debug("get_val called %s" % s)
     if s == "type":
         ret = sembind.get_val(self.ptr, s)
         if ret == '3': return 'text'
         if ret == '4': return 'img'
         if ret == '5': return 'diag'
         if ret == '6': return 'table'
         return ret
     return sembind.get_val(self.ptr, s)
def compute_hints(x):
    k = int(x)
    item = sembind.get_item_by_id(int(x))
    if item:
        m = read_properties(sembind.get_val(item, "hints"))
        sembind.set_result("diagram_width", m.get('diagram_width', '0'))
        sembind.set_result("diagram_height", m.get('diagram_height', '0'))
 def get_var(self, s):
     if not self.vars:
         hints = sembind.get_val(self.ptr, "hints")
         self.vars = read_properties(hints)
     return self.vars.get(s, "")