MCPcopy Create free account
hub / github.com/mhammond/pywin32 / GetActiveEditorDocument

Function GetActiveEditorDocument

Pythonwin/pywin/framework/scriptutils.py:139–149  ·  view source on GitHub ↗

Returns the active editor document and view, or (None,None) if no active document or its not an editor document.

()

Source from the content-addressed store, hash-verified

137 pass
138
139def GetActiveEditorDocument():
140 """Returns the active editor document and view, or (None,None) if no
141 active document or its not an editor document.
142 """
143 view = GetActiveView()
144 if view is None or isinstance(view, TreeView):
145 return (None, None)
146 doc = view.GetDocument()
147 if hasattr(doc, "MarkerAdd"): # Is it an Editor document?
148 return doc, view
149 return (None, None)
150
151def GetActiveFileName(bAutoSave = 1):
152 """Gets the file name for the active frame, saving it if necessary.

Callers

nothing calls this directly

Calls 2

GetActiveViewFunction · 0.85
GetDocumentMethod · 0.45

Tested by

no test coverage detected