Development Team/Activities/Compatibility

From Sugar Labs
< Development Team
Revision as of 05:49, 26 November 2008 by Tomeu (talk | contribs) (New page: As an example, instead of: if sugar.version >= 0.82: keyHash = util.sha_data(key) else: keyHash = util._sha_data(key) you would code: if hasattr(util, 'sha_data'): key...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

As an example, instead of:

if sugar.version >= 0.82:
    keyHash = util.sha_data(key)
else:
    keyHash = util._sha_data(key)

you would code:

if hasattr(util, 'sha_data'):
    keyHash = util.sha_data(key)
else:
    keyHash = util._sha_data(key)