Activity Team/Compatibility Tips: Difference between revisions

New page: ==Compatibility Tips== === SUGAR_BUNDLE_VERSION === Some earlier OLPC builds (e.g., 703) do not have a bundle version environment variable, so you need to catch an exception if you want t...
 
Line 9: Line 9:
     version = "unknown"
     version = "unknown"


=== get_activity_root() ===
Some earlier OLPC builds (e.g., 656) do not have activity.get_activity_root(), so you need to catch an exception if you want to access the version.
try:
    path = os.path.join(activity.get_activity_root(), "instance")
except:
    # early versions of Sugar (656) didn't support get_activity_root()
    path = "/home/olpc/.sugar/default/org.sugarlabs.[your activity name]"


=== Screen size ===
=== Screen size ===