Enhancement Request: Please add insertIconFromFile() to the commander.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
leo-editor |
Confirmed
|
Wishlist
|
Edward K. Ream |
Bug Description
insertIconFromF
I want to use it in a Leo-Editor script. It does what I want and it seems to work correctly. Because it is not included in the approved Leo-Editor script API by being callable via the commander I must use the following ugly and probably brittle means:
import leo.core.
icon1 = '/home/
lec.editCommand
-------
Is there currently a better way for me to use insertIconFromF
Changed in leo-editor: | |
status: | New → Confirmed |
assignee: | nobody → Edward K. Ream (edreamleo) |
I also want to use insertIconFromF ile() in a Python script that uses leoBridge to modify a Leo-Editor file. leoEditCommands fails because this module does not allow g.app to be None. I'm not qualified to say whether or not this should be considered a bug.
This does not work. Importing module leo.core.
Can anyone please tell me how to use leoBridge to insert an icon on a node in a Leo-Editor file?
Attached is a simple test case. The pathnames in this test case need to be modified to run in your environment. Then you can run the test case as shown below:
2013-03-24 17:51:26 /home/ldi/ bzr/leo_ diff leoEditCommands as lec ldi/bzr/ LeoLatest/ leo/core/ leoEditCommands .py", line 220, in <module> command( 'open-url' ) ldi/bzr/ LeoLatest/ leo/core/ leoGlobals. py", line 2743, in __call__ '@command decorator inside leoGlobals.py') ldi/bzr/ LeoLatest/ leo/core/ leoGlobals. py", line 2866, in error print(color= g.actualColor( 'red'), *args,* *keys) ldi/bzr/ LeoLatest/ leo/core/ leoGlobals. py", line 2799, in actualColor bzr/leo_ diff
$ python setIcon.py
Traceback (most recent call last):
File "setIcon.py", line 2, in <module>
import leo.core.
File "/home/
@g.
File "/home/
g.error(
File "/home/
g.es_
File "/home/
if not g.app.log:
AttributeError: 'NoneType' object has no attribute 'log'
2013-03-24 17:51:29 /home/ldi/
$
----------
I use Xubuntu 12.04 (precise)
Kernel 3.2.0-39-generic
Leo Log Window bzr/LeoLatest/ leo/core bzr/LeoLatest/ leo/config
Leo 4.11 devel, build 5639, 2013-03-24 11:01:23
Python 2.7.3, qt version 4.8.1
linux2
setting leoID from os.getenv('USER'): 'bob05'
load dir: /home/ldi/
global config dir: /home/ldi/