def GetActiveEditorDocument():
 view = GetActiveView()
 if ((view is None) or isinstance(view, TreeView)):
  return (None, None)
 doc = view.GetDocument()
 if hasattr(doc, 'MarkerAdd'):
  return (doc, view)
 return (None, None)

def GetActiveEditorDocument ( ) : view = GetActiveView ( ) if ( ( view is None ) or isinstance ( view , TreeView ) ) : return ( None , None ) doc = view . GetDocument ( ) if hasattr ( doc , 'MarkerAdd' ) : return ( doc , view ) return ( None , None )
returns the active editor document and view .