I was just going to tell you this, but first I've tried to run it myself to be sure and... woops!
File "c:\dev\Leo-5.4\leo\plugins\cursesGui2.py", line 106, in <module>
class LeoBodyTextfield (npyscreen.Textfield):
AttributeError: 'NoneType' object has no attribute 'Textfield'
I suppose that I have some python package missing (I'm sure it's in the docs!), but... would it be difficult to show a nicer error saying what is missing for novices like me?
Rev bd1de3d in master now should issue a warning if npyscreen fails.
Edward
c:\dev\Leo-5.5>pip install npyscreen
Collecting npyscreen
Downloading npyscreen-4.10.5.tar.gz (94kB)
100% |████████████████████████████████| 102kB 262kB/s
Building wheels for collected packages: npyscreen
Running setup.py bdist_wheel for npyscreen ... done
Stored in directory: C:\Users\sysadmin\AppData\Local\pip\Cache\wheels\f4\c7\06\144fa7319cd4ec5ddd62c6e677908a23f68af8dea305ab0f8d
Successfully built npyscreen
Installing collected packages: npyscreen
Successfully installed npyscreen-4.10.5
c:\dev\Leo-5.5>python launchLeo.py --gui=console
reading settings in C:\dev\Leo-5.5\leo\config\leoSettings.leo
reading settings in C:\Users\sysadmin\.leo\myLeoSettings.leo
loading npyscreen
ModuleNotFoundError("No module named '_curses'",)
ImportError("No module named 'npyscreen'",)
ModuleNotFoundError("No module named '_curses'",)
Can not import npyscreen
Warning: 'None' failed to import 'npyscreen'
Traceback (most recent call last):
File "launchLeo.py", line 8, in <module>
leo.core.runLeo.run()
File "c:\dev\Leo-5.4\leo\core\runLeo.py", line 63, in run
g.app.loadManager.load(fileName, pymacs)
File "c:\dev\Leo-5.4\leo\core\leoApp.py", line 2097, in load
lm.doPrePluginsInit(fileName, pymacs)
File "c:\dev\Leo-5.4\leo\core\leoApp.py", line 2161, in doPrePluginsInit
lm.createGui(pymacs)
File "c:\dev\Leo-5.4\leo\core\leoApp.py", line 2332, in createGui
lm.createSpecialGui(gui_option, pymacs, script, windowFlag)
File "c:\dev\Leo-5.4\leo\core\leoApp.py", line 2347, in createSpecialGui
g.app.createDefaultGui()
File "c:\dev\Leo-5.4\leo\core\leoApp.py", line 1050, in createDefaultGui
app.createCursesGui()
File "c:\dev\Leo-5.4\leo\core\leoApp.py", line 1027, in createCursesGui
import leo.plugins.cursesGui2 as cursesGui2
File "c:\dev\Leo-5.4\leo\plugins\cursesGui2.py", line 106, in <module>
class LeoBodyTextfield (npyscreen.Textfield):
AttributeError: 'NoneType' object has no attribute 'Textfield'
I have updated to the current master and checked that effectively a clearer Warning is shown now when npyscreen is missing. But installing npyscreen did not solve the problem for me:
ModuleNotFoundError("No module named '_curses'",)
ImportError("No module named 'npyscreen'",)
ModuleNotFoundError("No module named '_curses'",)
Can not import npyscreen
Thanks lewis, this worked! It would be great to have this
mini-guide added to the docs.
I can confirm that npyscreen installation is in fact not required.
I've seen two minor details, though:
The first error message of the backlink plugin shows this
(highlighted) line:

and then the Traceback, which I finally was able to print in
another console using the hack explained at Broadcast and
Listening:
pr: Traceback (most recent call last):
pr: File "c:\dev\Leo-5.4\leo\core\leoPlugins.py", line 341,
in callTagHandler
pr: result = handler(tag, keywords)
pr: File "c:\dev\Leo-5.4\leo\plugins\backlink.py", line 961,
in onCreate
pr: backlinkController(c)
pr: File "c:\dev\Leo-5.4\leo\plugins\backlink.py", line 105,
in __init__
pr: self.loadLinksInt()
pr: File "c:\dev\Leo-5.4\leo\plugins\backlink.py", line 454,
in loadLinksInt
pr: self.showMessage('Link info. loaded on %d nodes' %
len(idsSeen))
pr: File "c:\dev\Leo-5.4\leo\plugins\backlink.py", line 639,
in showMessage
pr: self.ui.showMessage(msg, color=color)
pr: AttributeError: 'backlinkController' object has no
attribute 'ui'
I suppose that this is the expected behaviour, but a backlink
exception is thrown everytime I move from one node to another.
Would it be possible to have the backlink plugin "simply"
completely refuse to install (load) when it detects that there's
no ui in the first place so no other errors are shown after that?
Or do you think that the plugin could be fixed to work with the
console gui?
Thanks,
Xavier
Here is proposed documentation for addition toLeo’s Console Gui http://leoeditor.com/console-gui.html
pr: Traceback (most recent call last):
pr: File "c:\dev\Leo-5.4\leo\core\leoPlugins.py", line 341, in callTagHandler
pr: result = handler(tag, keywords)
pr: File "c:\dev\Leo-5.4\leo\plugins\backlink.py", line 961, in onCreate
pr: backlinkController(c)
pr: File "c:\dev\Leo-5.4\leo\plugins\backlink.py", line 105, in __init__
pr: self.loadLinksInt()
pr: File "c:\dev\Leo-5.4\leo\plugins\backlink.py", line 454, in loadLinksInt
pr: self.showMessage('Link info. loaded on %d nodes' % len(idsSeen))
pr: File "c:\dev\Leo-5.4\leo\plugins\backlink.py", line 639, in showMessage
pr: self.ui.showMessage(msg, color=color)
pr: AttributeError: 'backlinkController' object has no attribute 'ui'
I suppose that this is the expected behaviour, but a backlink exception is thrown everytime I move from one node to another.