[old] Python Autocompletion

Tips and tricks to get the most out of using Editra

Results from latest SVN

Postby shmakes » Thu Jan 03, 2008 1:33 am

I got the latest code from SVN as you instructed. The results were the same as before.

Code: Select all
ss@ss04:~/Editra$ python Editra
[19:17:34] [main_info] Initializing Application...
[19:17:34] [app][info] Editra is Initializing
[19:17:34] [app][info] Registering Editra's ArtProvider
[19:17:35] [docpositionmgr] successfully loaded book
[19:17:35] [styles][init] Loaded custom style sheet /home/ss/Editra/styles/default.ess
[19:17:35] [stc_evt] Code Folding Turned On
[19:17:35] [stc_evt] Bracket Highlighting Turned On
[19:17:35] [stc_evt] Showing Line Numbers
[19:17:35] [nb_evt] Page Creation ID: -210
[19:17:35] [nb_evt] Page Changed to 0
[19:17:35] [nb_evt] Control Changing from Page: -1 to Page: 0
[19:17:35] [nb_info] It has file named:
[19:17:35] [main][info] Loading MainWindow Plugins
[19:17:35] [filebrowser] Installing filebrowser plugin

(python:10732): Gtk-CRITICAL **: gtk_widget_add_accelerator: assertion `GTK_IS_WIDGET (widget)' failed
[19:17:36] [main][info] Loading Generator plugins
[19:17:36] [main_info] Starting MainLoop...
[19:17:50] [generator][info] Generation time 0.000173
[19:17:50] [stc_evt] Manually Setting Lexer to py
[19:18:02] [pycomp] Generated source: """"""
[19:18:02] class _PyCmplNoType:
[19:18:02]     def __getattr__(self,name):
[19:18:02]         return None
[19:18:02] [pycomp] get_completions('sys.','')
[19:18:02] [pycomp][err] get_completions: name 'sys' is not defined [stmt='sys']


While I was at work today, I tried Editra out on WindowXP with Python 2.4. My results were different from yours.

About Screen:
Image

Editor Screen:
Image

Code: Select all
[14:28:08] [app][info] Editra is Initializing
[14:28:09] [app][info] Registering Editra's ArtProvider
[14:28:10] [docpositionmgr] successfully loaded book
[14:28:10] [styles][init] Loaded custom style sheet C:\Python24\lib\site-packages\wx-2.8-msw-unicode\wx\tools\Editra\styles\default.ess
[14:28:10] [stc_evt] Syntax Highlighting Turned On
[14:28:10] [stc_evt] Code Folding Turned On
[14:28:10] [stc_evt] Bracket Highlighting Turned On
[14:28:10] [stc_evt] Showing Line Numbers
[14:28:10] [nb_evt] Page Creation ID: -212
[14:28:10] [nb_evt] Page Changed to 0
[14:28:10] [nb_evt] Control Changing from Page: -1 to Page: 0
[14:28:10] [nb_info] It has file named:
[14:28:10] [main][info] Loading MainWindow Plugins
[14:28:10] [filebrowser] Installing filebrowser plugin
[14:28:11] [file_reader] Failed to open file C:\Documents and Settings\sjschmec\.Editra\cache\pathmarks
[14:28:11] [main][info] Loading Generator plugins
[14:28:11] [main_info] Starting MainLoop...
[14:28:23] [generator][info] Generation time 0.000000
[14:28:23] [stc_evt] Manually Setting Lexer to py
[14:28:36] [pycomp] Generated source: """"""
[14:28:36] class _PyCmplNoType:
[14:28:36]     def __getattr__(self,name):
[14:28:36]         return None
[14:28:36] [pycomp] get_completions('sys.','')
[14:28:36] [pycomp][err] get_completions: name 'sys' is not defined [stmt='sys']
[14:29:13] [generator][info] Generation time 0.000000


Let me know if you want me to try anything else or provide some more screen shots or logs.

Thanks,
Steve
shmakes
User
 
Posts: 6
Joined: Sun Dec 30, 2007 3:27 am

Postby cody » Fri Jan 04, 2008 1:55 pm

Good News (I hope),

I found the problem and have checked in a fix in the latest svn. The fix got the auto-completion working on my install of python2.4 anyway where it didn't work before.

It seems that the cStringIO module was the culprit as I found it was returning single characters per each call to next() with the tokenizer module under 2.4 which was causing the parse to fail. Changing to the StringIO module instead solved this in my testing. It is probably related to how the two modules handle unicode differently.

So please test again with the latest svn and see if it works for you now.

Thanks,

cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Good News!!!

Postby shmakes » Sat Jan 05, 2008 4:52 am

Works on Ubuntu - Python 2.5
Works on Gentoo - Python 2.4

WAY TO GO!!!

I will check it out more completely tomorrow.

Cheers to you!
Steve
shmakes
User
 
Posts: 6
Joined: Sun Dec 30, 2007 3:27 am

Doesn't work for me to

Postby gacha » Sat Jan 05, 2008 6:56 pm

I just installed a fresh copy of Editra 0.2.29 on Ubuntu 7.10 with python 2.5 and auto completion doesn't work. I get the same erros as the topic starter.
gacha
Limited User
 
Posts: 1
Joined: Sat Jan 05, 2008 6:39 pm

Postby cody » Sat Jan 05, 2008 10:29 pm

Yes, please use the latest svn for a working copy. Instructions on retrieving the svn version can be found on the downloads page

cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Previous

Return to Usage Tips

Who is online

Users browsing this forum: No registered users and 1 guest

cron