Thread: Editor widget
View Single Post
Old 05-20-2014, 07:14 PM   #4
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Since my last post I've been happily using the TextEdit widget from gui2/tweak_book/editor/text.py as part of a personal plugin which, amongst many other things, allows basic manual editing of either a single html file or a single css file. However, since upgrading from calibre 1.36 to 1.37 I'm seeing a problem and I'm hoping you can give me some clues.

The problem occurs when calling the TextEdit load_text method when syntax='html'. When syntax='css' everything still seems to work OK. This is the error traceback I see:
Spoiler:
Code:
Traceback (most recent call last):
  File "site-packages\calibre\gui2\tweak_book\editor\syntax\base.py", line 145, in reformat_blocks
  File "site-packages\calibre\gui2\tweak_book\editor\syntax\base.py", line 29, in run_loop
  File "site-packages\calibre\gui2\tweak_book\editor\syntax\html.py", line 322, in normal
  File "site-packages\calibre\gui2\tweak_book\editor\syntax\html.py", line 260, in process_text
  File "site-packages\calibre\spell\dictionary.py", line 340, in recognized 
AttributeError: 'Dictionaries' object has no attribute 'active_user_dictionaries'

I've attached some stripped-down sample python code which reproduces the error (at least for me on Win7 x64 but using calibre 32 bit) when running via calibre-debug -e

Additional info:
- the editing my plugin is trying to do doesn't need any kind of spell-checking,
- something also looks wrong with the html syntax highlighting,
- I don't see any of these problems when using the full calibre Editor in the normal way.
Attached Files
File Type: zip testeditor.py.zip (954 Bytes, 285 views)
jackie_w is offline   Reply With Quote