svgui/pyjs/lib/pyjslib.py
changeset 1865 0bd5b3099144
parent 1859 1df77c809257
child 1870 4d070115b552
equal deleted inserted replaced
1864:9e64afb38963 1865:0bd5b3099144
  1165     }
  1165     }
  1166     return false;
  1166     return false;
  1167     """)
  1167     """)
  1168 
  1168 
  1169 
  1169 
  1170 def getattr(obj, name, default_):
  1170 def getattr(obj, name, default_=None):
  1171     JS("""
  1171     JS("""
  1172     if ((!pyjslib.isObject(obj))||(pyjslib.isUndefined(obj[name]))){
  1172     if ((!pyjslib.isObject(obj))||(pyjslib.isUndefined(obj[name]))){
  1173         if (pyjslib.isUndefined(default_)){
  1173         if (pyjslib.isUndefined(default_)){
  1174             throw pyjslib.AttributeError(obj, name);
  1174             throw pyjslib.AttributeError(obj, name);
  1175         }else{
  1175         }else{