def init_scene(t, layout, ts): global _QApp if not ts: ts = TreeStyle() if layout and not ts.layout_fn: ts.layout_fn = layout elif not layout and not ts.layout_fn: cl = t.__class__ try: ts_template = _DEFAULT_STYLE[cl] except KeyError, e: pass else: apply_template(ts, ts_template)
def init_tree_style(t, ts): custom_ts = True if not ts: custom_ts = False ts = TreeStyle() if not ts.layout_fn: cl = t.__class__ try: ts_template = _DEFAULT_STYLE[cl] except KeyError, e: pass else: if not custom_ts: apply_template(ts, ts_template) else: ts.layout_fn = ts_template.get("layout_fn", None)