44 Commits (master)

Author SHA1 Message Date
Bas Hulsken 39b12bbf7f Fix sugar-install-bundle - Python 2
On Python 2 is seen
ConfigParser instance has no attribute 'read_string'

Regression introduced by 2018c930ad

Fixes https://github.com/sugarlabs/sugar-toolkit-gtk3/issues/438

Signed-off-by: James Cameron <quozl@laptop.org>
4 years ago
James Cameron aca045bde2 Reduce width of exception handler for linfo file
ParsingError is only expected during read.
4 years ago
James Cameron 2018c930ad Fix sugar-install-bundle
Traceback (most recent call last):
  File "/usr/bin/sugar-install-bundle", line 21, in <module>
    bundle = ActivityBundle(name)
  File "/usr/lib/python3.7/dist-packages/sugar3/bundle/activitybundle.py", line 118, in __init__
    info_file = self.get_file('activity/activity.info')
  File "/usr/lib/python3.7/dist-packages/sugar3/bundle/bundle.py", line 126, in get_file
    f = six.StringIO(data)
TypeError: initial_value must be str or None, not bytes

Fix by always reading bundle and metadata as Bytes, and converting to
String before passing to ConfigParser.

Did not fix ContentBundle, as it has been unused for some time, and was
only kept for use with OLPC XO and Python 2.
4 years ago
Aniket21mathur 3b28597486 flake8 fixes 5 years ago
Pro-Panda aa8a5e70c4 Port from Python 2 to six
Signed-off-by: James Cameron <quozl@laptop.org>
5 years ago
Vipul Gupta (@vipulgupta2048) c7a7dcea7d Add to tags
Add new parameters category, categories, website
Update example of browse activity
Add more description of already defined parameters from https://wiki.sugarlabs.org/go/Development_Team/Almanac/Activity_Bundles#.info_file_format

Signed-off-by: Vipul Gupta (@vipulgupta2048) <vipulgupta2048@gmail.com>
6 years ago
James Cameron e32aea6a4f sugar3/bundle - activity metadata standard rewording
Move definition of bundle identifier from Wiki.
6 years ago
Vipul Gupta (@vipulgupta2048) 47563e678f sugar3/bundle - activity metadata standard
* encourage "url" for either home page or user documentation,

* give examples for categorisation tags, define format,

* make "website" an alias for "url",

* make "category" and "categories" aliases for "tags".

* add the aliases to deprecated list; valid for use, but not encouraged.

Deprecates https://wiki.sugarlabs.org/go/Development_Team/Almanac/Activity_Bundles#.info_file_format

Signed-off-by: Vipul Gupta (@vipulgupta2048) <vipulgupta2048@gmail.com>
Signed-off-by: James Cameron <quozl@laptop.org>
Reviewed-by: Rahul Bothra <f2016015@pilani.bits-pilani.ac.in>
Reviewed-by: Yash Agrawal <yagrawal900@gmail.com>
6 years ago
James Cameron cc2357c787 Add warnings for missing activity metadata
- report a warning if either activity_version, icon, or license are
  missing,

- fix typo in missing bundle_id exception message.

Fixes #378

Co-authored-by: Rahul Bothra <f2016015@pilani.bits-pilani.ac.in>
6 years ago
James Cameron 7e216a04d5 Adjust metadata reference 6 years ago
James Cameron ab7e9a8247 Fix service_name deprecated whitespace 6 years ago
James Cameron 5750773dda Documentation - rewrite activity section
- rewrite of activity section, bundle section, graphics.alert, and
  graphics.window.
7 years ago
James Cameron 002349f290 NormalizedVersion - accept ~ as version separator
Bundle versions are often described as being decimal floats e.g. 1.2,
but they also accept more than one dot, and a suffix after a dash,
e.g. 1.2.3-peru

Debian project and Ubuntu often use ~ for modified sources to comply
with distribution policy (~dfsg), or developer builds.

The dist_source target for setup.py does not work with
a version suffix like ~dfsg, requiring a manual step to rename the
file.

Adjust the regular expression to accept the ~ form.
7 years ago
Sam Parkinson 61bc42f2c2
Merge branch 'bundlebuilder' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
James Cameron 1f93659c95 Avoid private member access to Bundle
ActivityBundle was making reference to _path private in Bundle, change
to use get_path public method.
8 years ago
Sam Parkinson 9b5ed7e80c
Bundlebuilder: Translate AppData files 8 years ago
Sam Parkinson 7779c74f44
Bundlebuilder: Use installed icon path in .desktop file
Previously, the bundle builder referenced the icon path in the
source directory - which was obviously not installed in the package.
8 years ago
Gonzalo Odiard a43b972d1b Don't break activity startup if .info have 'class' instead of 'exec'
When we ported sugar to Gtk3 we removed the support of the fields
exec and service_name due they were deprecated for a long time [1].
But this is still a problem in deployments, and we already added
compatibility for the service_name field.
Here [3] there is a long thred were we discussed this issue.

[1] ae85dd62d4
[2] 32f97b48c3
[3] http://lists.sugarlabs.org/archive/sugar-devel/2013-October/045404.html
9 years ago
Gonzalo Odiard 3c4ac98baf Fix import of exception from ConfigParser
In the commit f0927c364c
the ParsingError is not properly imported.
10 years ago
Gonzalo Odiard f0927c364c Don't break if translation can't be parsed
If the .linfo file can't be parsed, use the untranslated name/summary,
but don't  break activity load.
10 years ago
Gonzalo Odiard 2456465d79 Enable collaboration by default on activities
When we implemented read max_participants from activity.info [1]
we changed the default value of max_participants, from 0 to 1.
Before, was responsability of the activities set max_participants == 1,
when the activity not implemented collaboration.
This change make the default backwards compatible.

[1] d0cca91fe8
10 years ago
Walter Bender d0cca91fe8 Assign max_participants in activity.info
As part of an effort to "honor" max_participants, this patch supports setting
max_participants in activity.info, thus making it available in the bundle.

By default, if it is not set in the bundle, the previous behavior persists.

In support of this change, a cache of Activity bundles is
maintained. The goal is to eliminate unnecessary calls to the file
system.
10 years ago
Daniel Narvaez 01ed63ee4b Fixes for pep8 1.5 10 years ago
James Michael DuPont a082cf1cca better debugging 10 years ago
Gonzalo Odiard 93437ddedf Add get_show_launcher() in bundles other than activitybundle
This is needed now by Sugar, after (sugar commit)
f4638b5f481478e96195d55aa38c90fd33db9aee

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
11 years ago
akskumarnot 81b388c554 Use proper formatting syntax, fixes #2170 11 years ago
Sam f43d5f8d24 Fixes #4634, issue where spaces in bundle ids crashed sugar 11 years ago
Walter Bender cd5292881e Add single_instance field to activity bundle
This field can be used by activities that need to be restricted to a
single open instance. Usage is:

single_instance = yes

jarabe/model/shell.py has been modified look for this field in a
separate patch to Sugar.

Together these two patches constitute the implementation of Sugar
feature Launch Limits [1]

[1] http://wiki.sugarlabs.org/go/Features/Launch_Limits
11 years ago
Gonzalo Odiard 32f97b48c3 Workaround to enable start of activities still using service_name
While we deprecated service_name a long time ago, still there are activities
using it, and is a source of frequent problems.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
11 years ago
Daniel Drake f46ac7ba6a ContentBundle cleanups
Share get_installation_time() between all bundle types so that it works
with content bundles.

Add get_tags() stub, this is called by Sugar.

Remove unused fields: l10n, category, subcategory, etc.

We remove support for running OLPC's content bundle indexer.
This is assumed to go away now that Sugar will support content bundles
as first-class objects.

Some minor behavioural fixes and cleanups.

This now implements http://wiki.sugarlabs.org/go/Content_bundles
and when care is taken to include all the fields required by old
Sugar versions, there is no change in compatibility of existing or
new content bundles.

Required for http://wiki.sugarlabs.org/go/Features/Content_support
11 years ago
Daniel Narvaez 6d2b97daec Fix pep8 errors
pep8 1.6.4 detects more issues
11 years ago
Daniel Drake be91f84a4b Avoid auto-import of bundle helpers (#4527)
The new bundle helpers were being auto-loaded with sugar3.bundle due
to their placement in __init__.py. This was causing Gi to be imported,
breaking GTK2 activity launches.

Move the helpers to a dedicated module.
11 years ago
Daniel Drake 12476caa12 Improve bundle API for bundleregistry changes
The bundle API is a bit confusing and inconsistent. Fix up the
ActivityBundle and ContentBundle classes to be more consistent and to
work with the ongoing improvements being made in bundleregistry.
11 years ago
Daniel Drake f4c1bd152a Add bundle instantiation helpers
Add some helper functions for use by upcoming changes in the Sugar shell.
11 years ago
William Orr 9e4454a2ed pep8'd sugar3.bundle 11 years ago
Gonzalo Odiard 58bab9cf6a Do not use the translated summary to get the value from gettext in the bundle builder
This patch is a rebased push from pull request #31

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
11 years ago
Walter Bender b4c0b2258f Use gettext algorithm to determine locale for activity.linfo
When activity bundles are loaded, the activity name and summary are
pulled from an activity.linfo file that is associated with
locale. However, sometimes locale, which uses $LANG has been
superceded by $LANGUAGE as set in
extensions/cpsection/languages/model.py. This patch uses the same
algorithm as gettext.py to find activity.linfo

This problem is seen on the .AU systems which use en_AU for locale and
en_GB for LANGUAGE.
11 years ago
Daniel Narvaez db448c4eea Remove a lot of unused imports
Signed-off-by: Daniel Narvaez <dwnarvaez@gmail.com>
11 years ago
Manuel Quiñones b6152b023a ActivityBundle: don't wrap the temporal icon path in a TempFilePath - SL #4276
In the Journal, CellRendererActivityIcon is calling its do_render
method after the temporal file is removed.  This is because we wrap
the icon path in a TempFilePath to control its deletion, but as we
don't maintain any reference to it, its __del__ method deletes the
temporal file.

Note that returning the path directly has one disadventage: the
temporal file is left in /tmp .

As a comment in the get_icon method of ActivityBundle say, ideally we
should return the icon data.  But that implies a major change in the
Journal model and views, and in the CellRendererIcon class.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Gonzalo Odiard 3a30d3f84e Add management of summary property to the activity.info file
This summary is translatable as the Activity name and will be displayed
in the Activity list in the Home View.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Simon Schampijer ae85dd62d4 ActivityBundle: clean from deprecated code
- removed deprecated mime type 'application/vnd.olpc-x-sugar'
- activity.info file: removed deprecated field 'service_name' use 'bundle_id' instead
- activity.info file: removed deprecated field 'class' use 'exec' instead

Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Daniel Drake <dsd@laptop.org>
12 years ago
Simon Schampijer 89ef6304a1 Fix broken imports
8f1a821d68 only changed imports starting with
"import", but not those using "from ... import ...".

[replaced description]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Simon Schampijer 8f1a821d68 Rename imports from sugar to sugar3
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Simon Schampijer 000ed75cbe Rename the module to sugar3
The old gtk-2 based module will be present in
the 0.94 branch in the sugar-toolkit.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago