sugar4.bundle package
Submodules
sugar4.bundle.activitybundle module
Sugar activity bundles
UNSTABLE.
- class sugar4.bundle.activitybundle.ActivityBundle(path, translated=True)[source]
Bases:
BundleA Sugar activity bundle
See http://wiki.sugarlabs.org/go/Development_Team/Almanac/Activity_Bundles for details
- get_description()[source]
Get the description for the activity. The description is a pace of multi paragraph text about the activity. It is written in a HTML subset using only the p, ul, li and ol tags.
sugar4.bundle.bundle module
Sugar bundle file handler
UNSTABLE.
- class sugar4.bundle.bundle.Bundle(path)[source]
Bases:
objectA Sugar activity, content module, etc.
The bundle itself may be either a zip file or a directory hierarchy, with metadata about the bundle stored various files inside it.
This is an abstract base class. See ActivityBundle and ContentBundle for more details on those bundle types.
sugar4.bundle.bundleversion module
Validation and normalization of bundle versions.
Instances of NormalizedVersion can be directly compared;
>>> from sugar4.bundle.bundleversion import NormalizedVersion
>>> a = NormalizedVersion('157.3')
>>> b = NormalizedVersion('201.2')
>>> a > b
False
>>> b > a
True
Invalid versions will raise InvalidVersionError.
Valid versions are 1, 1.2, 1.2.3, 1.2.3-peru, and 1.2.3~dfsg.
- Invalid versions are:
1.2peru (because the suffix must be preceded with a dash or tilde),
1.2. (because a version can’t end with a period), or
1.02.5 (because a version can’t have a leading zero).
Based on the implementation of PEP 386, but adapted to our numeration schema.
- sugar4.bundle.bundleversion.VERSION_RE[source]
regular expression for versions, deprecated, as it is insufficient by itself.
- Type:
RegexObject
- exception sugar4.bundle.bundleversion.InvalidVersionError[source]
Bases:
Exception- A version cannot be normalized, because:
the object is not a string,
the string does not match the regular expression, or
the string has a leading zero in a version part.
sugar4.bundle.contentbundle module
Sugar content bundles
UNSTABLE.
- class sugar4.bundle.contentbundle.ContentBundle(path)[source]
Bases:
BundleA Sugar content bundle
See http://wiki.laptop.org/go/Content_bundles for details