- AuthorPosts
- November 23, 2008 at 9:47 pm #6657mashaMember
My EmEditor crashes when I try to access collections from Python macro:
#language=”Python”
Window.OutputBar.Visible = True
debug = Window.OutputBar.writeln
document = Window.document
debug(document.Config.Highlight) # ok, it prints>
# debug(document.Config.Highlight.XXXXXX) # ok, it raises an exception for no XXXXXX is there
# debug(document.Config.Highlight.List) # it crashes EmEditor :(I use Windows 2000, EmEditor 8.00 and ActivePython 2.5.1.1
Can you provide me an example of Python macro where a collection is enumerated ?
November 23, 2008 at 11:53 pm #6658mashaMemberSeems there is a bug related to Config object
I can enumerate windows and documents in Python but not the collections of the Config object.
The latest ActivePython 2.6.0.0 has the problem as well.#language=”Python”
Window.OutputBar.Visible = True
debug = Window.OutputBar.writeln# ok
for x in Window.shell.windows: debug(x); debug(x.Caption)# ok
for x in Window.editor.Documents: debug(x); debug(x.FullName)# crash
for x in Window.document.Config.Keyboard.List: debug(str(x))# crash
for x in Window.document.Config.Highlight.List: debug(x)November 24, 2008 at 7:14 pm #6662Yutaka EmuraKeymastermasha wrote:
Seems there is a bug related to Config object
I can enumerate windows and documents in Python but not the collections of the Config object.
The latest ActivePython 2.6.0.0 has the problem as well.#language=”Python”
Window.OutputBar.Visible = True
debug = Window.OutputBar.writeln# ok
for x in Window.shell.windows: debug(x); debug(x.Caption)# ok
for x in Window.editor.Documents: debug(x); debug(x.FullName)# crash
for x in Window.document.Config.Keyboard.List: debug(str(x))# crash
for x in Window.document.Config.Highlight.List: debug(x)This is a sensitive area because the list is very large. It might cause out of memory situations.
Did you try Versin 7 and was it OK?
Also, you might want to try something like:
list = Window.document.Config.Highlight.List
for x in list: debug(x)
November 24, 2008 at 10:18 pm #6667mashaMembertwo lines macro:
#language="Python"
list = Window.document.Config.Highlight.List
is enough to crash
I will try EmEditor 7.0 a bit later
- AuthorPosts
- You must be logged in to reply to this topic.