#5538 HIGH Update.: Every python activity emits errors when starting.
Zarro Boogs per Child
bugtracker at laptop.org
Tue Dec 18 22:45:27 EST 2007
#5538: Every python activity emits errors when starting.
---------------------+------------------------------------------------------
Reporter: cscott | Owner: marco
Type: defect | Status: new
Priority: high | Milestone: Update.1
Component: sugar | Version:
Resolution: | Keywords: review?
Verified: 0 |
---------------------+------------------------------------------------------
Changes (by cscott):
* keywords: => review?
Comment:
Attached above is a patch which deleted unused imports and moves
infrequently-used imports down to their use sites in order to dramatically
speed up 'import sugar.activity.activity', 'import sugar.graphics.icon',
and some other modules. Journal startup, in particular, seems to be much
improved by this, although 'import sugar.datastore.datastore' could use
some similar loving.
The gnomevfs warning messages turned out to spring from 'import rsvg'
which is performed by sugar.graphics.icon. rsvg is a C extension library;
we should figure out why it wants to call gnomevfs_init() and dissuade it
if possible, since 'import rsvg' is currently Very Slow. I've moved this
import inside the __init__() method of the _SVGLoader class, which is the
only place it is used; pieces of code which do not load new Icons (such as
bundlebuilder, etc) should no longer trigger the warning message.
The profile errors were addressed by making pubkey and privkey_hash into
properties of Profile, which load their contents on demand the first time
they are accessed. Thus, codepaths which do not use pubkey don't trigger
a spurious error and don't pay the parsing/loading cost.
While making these changes, I grew suspicious of Profile.is_valid(): it
seems unrelated to the 'valid' field which is set in various places in
Profile. Use of this method should be reviewed and the method removed if
it is in fact bogus.
All files changed were run through pylint; I tested that Profile's
contents are valid after the change; and of course I ran a whole-system
test to verify that nothing broke.
--
Ticket URL: <http://dev.laptop.org/ticket/5538#comment:3>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system
More information about the Bugs
mailing list