Comment 2 for bug 555389

Revision history for this message
Ed S (edgar-b-dsouza) wrote :

Agreed with vimal. The snippet loading itself is from local files, and does not incur significant delay. The retrieval of page titles for documentation URLs in the snippet is what is causing Acire to apparently "freeze" for a significant time while information is retrieved from the Net.

I had made a small correction to my local copy to work around this annoyance, but I have not yet proposed this specific change for merging, since I'm waiting on the project lead for response to a query on a larger feature - adding snippet module dependency detection and resolution (if the snippet imports a module which is not installed on the system).

The project lead, Jono Bacon, being Ubuntu Community Manager, I expect he is busy with the upcoming final release of Lucid, so I am waiting for some sign that he is paying attention to Acire again :) and hope I will get some response about my pending feature addition.

ANYWAY... In the meanwhile, if you wish to work around this until Jono accepts a fix... check
https://code.launchpad.net/~edgar-b-dsouza/acire/delay_web_doc_title_fetch
OR, you can create a local Acire branch, if you have bazaar installed:
bzr branch lp:~edgar-b-dsouza/acire/delay_web_doc_title_fetch

(Patched against rev 56, may be "outdated" by LP automatic translation service updates pretty soon)

Basically, the idea is to just split off the documentation box updation (which uses the webbrowser module) to about 800 milliseconds after the other code in the snippet_selected() function - by then, (on my laptop at least) GTKSourceView has been updated.

Here is the logic:
1. import the gobject library
2. Split out inline code (to update the docs box) in the snippet_selected() function, into a separate function, update_docs_box()
3. Replace the earlier inline code to update the docs box with:
    gobject.timeout_add(800, self.update_docs_box)

The 800 millisecond timeout is pretty arbitrary, yes - it may cause problems with slower processors, I don't know... (I'm running a C2D T9400 with max step 2.53 GHz). Probably the optimal solution is to somewhere do a CPU calibration to determine a sensible interval for which to delay the callback. I didn't go to that level (I'm a newbie at FOSS collaborative dev too :) ) but in the short term, this fix should probably hold off the irritation till project lead accepts a proper fix from whoever offers one.

Cheers
Ed.