[Sugar-devel] [FEATURE] Create an adapter that calls the third parties/libraries for better maintainability.

Tony Anderson tony_anderson at usa.net
Fri Feb 15 21:31:08 EST 2019

Alejandro García

Generally, I believe you first need to know how to do something several 
times before deciding to automate. In that case, the question is whether 
the automation will be used enough to justify the implementation time 
and effort and whether the automation will make the process enough 
faster and easier to be worthwhile. Being inherently lazy, I love the 
idea of software which makes my life easier. However, most often I have 
spent more time implementing the solution than it would have cost to do 
the job directly.

Would you be willing to spend some time working on some of these 
critical problems directly? You are pointing to serious issues which at 
the moment are not being handled by Sugar_Devel. The following is a list 
off the top of my head of open issues. Some of these can be handled 
directly and simply. Others such as the activity.info issue may take 
some development effort.

Collaboration is considered an important capability for an activity. How 
many activities now support collaboration. How many use Collabwrapper? 
How many of these are suitable for porting to Colllabwrapper?

How many activities in ASLO are based on pygames. As I understand it, 
upgrade to gtk3 depends on using pygames with olpcgames. This is 
currently done with only one activity (Simulate Activity). How many 
activities depend on pygames? What is required to use olpcgames with 
pygames? Is a special gtk3 compatible version of pygames required?

How many activities in ASLO are not yet ported to GTK3? In general any 
activity in ASLO which does not have a github repository. However, there 
are activities in github which have not been converted (and some 
attempted conversions).

The sound in Block Party is not working because of an incorrect use of 
C-Sound. Are there any other activities affected? What is required to 
fix the problem?

The Bridge activity fails because of its use of Box2D. How many 
activities depend on Box2D? What is the required version of Box2D and 
what is required to interface to it?

There are some activities which depend on Java runtime. The Java-1 
activity is intended as a 'shim' but is not capable. How should Java be 
installed as a possibly optional sugar tool so that it can be used by 
any activity that needs it?

There are activities that still use deprecated parameter names in 
activity.info. The solution is to put a warning in the log outpu of that 
activity. How hare would it be to prepare a script that fixed the 
property names in all activities in ASLO? This one involves small 
changes to many activities so some means acceptable to James Cameron 
will be needed to make these changes to the activities in ASLO (and in 
gitHub). Putting the changes in the form of a Pull Request by script may 
be prohibitive.

There are activities that still use hulahop although that has been gone 
since 0.98. Which activiteis have this problem and is there a common way 
to upgrade to WebKit? (Note: this means these activities have not been 
available to our users for years!).

There are activities which fail because of a dependency on vte. How many 
and what is the issue that causes them to fail?

As always, the first step in solving a problem is to identify it. 
Solution space should be avoided until this is done. I don't have enough 
information to believe that development of a general software tool is 
the most effective way forward.

One exception may be to develop an automated means to test the suite of 
activities in a specific execution environment. From what I have seen, 
what might be practical is a Bash or Python script which downloads via 
Browse each activity in turn, executes it, and determines whether the 
activity started or failed to start, and then erases it. In many cases, 
regression with new releases results from changes in the dependencies. 
Often they cause the activity to fail to start.
Detecting this outcome may be facilitated by a change to Sugar which 
causes a specific signal when an activity fails to start that the script 
can use. A more complicated step may be to mine the logs to report the 
problem encountered. This is of lower priority since the number of 
failed activities should be small and consulting the logs is not difficult.

There is a lot of work to be done and much of it of immediate, direct 
and significant value to our user community.


On 2/16/19 2:27 AM, Alejandro García wrote:
> I want to reduce the impact of an update of a third party in all the 
> activities, avoiding the need of change each activity when it happens.
> Examples of what I want to avoid are the activities that were updated 
> from gtk2 to gtk3 and those that still need to be updated.
> On Mon, Feb 11, 2019, 11:28 PM James Cameron <quozl at laptop.org 
> <mailto:quozl at laptop.org> wrote:
>     On Mon, Feb 11, 2019 at 10:04:02PM -0600, Alejandro García wrote:
>     > Let's discard the adapter/shim (main goal is to reduce the
>     dependency).
>     >
>     > Isn't there anything that we can do to reduce the dependency.
>     Especially with
>     > Gtk.
>     What problem are you trying to solve by reducing the dependencies?
>     > Why aren't CollabWrapper and SugarGame very common between
>     activities?
>     > Especially CollabWrapper.
>     Too few maintainers, and no requirement.
>     CollabWrapper is not required where an activity does not support
>     collaboration.
>     SugarGame is not required where an activity does not use Pygame.
>     > If CollabWrapper is simple, why not expanding it?
>     I don't understand your question, sorry.
>     > On Sun, Feb 10, 2019, 10:42 PM James Cameron
>     <[1]quozl at laptop.org <mailto:quozl at laptop.org> wrote:
>     >
>     >     On Sun, Feb 10, 2019 at 08:19:03PM -0600, Alejandro García
>     wrote:
>     >     > I was thinking something like calling a
>     GtkAdapter.Label(...) instead of
>     >     > Gtk.Label (...), or a WebKitAdapter.emit_signal (...)
>     instead of
>     >     > WebKit2.emit_signal (...).
>     >     >
>     >     > Are these examples more clear of what I'm trying to say?
>     >
>     >     Another word for this is a shim.  An abstraction that only
>     exists to
>     >     hide version dependencies.
>     >
>     >     We have an example of a WebKit API verson independence shim
>     in Sugar, see
>     >
>     >   
>      [2]https://github.com/sugarlabs/sugar/tree/master/src/jarabe/view
>     >
>     >     viewhelp_webkit1.py is the shim for WebKit.
>     >
>     >     viewhelp_webkit2.py is the shim for WebKit2.
>     >
>     >     viewhelp.py choses which of the shims to use.
>     >
>     >     A disadvantage of shims is huge increase in the number of
>     lines of
>     >     code to be maintained.
>     >
>     >     We cannot use a shim for GTK 2 and GTK 3 independence,
>     because at the
>     >     same time the binding moved from static to introspection;
>     PyGObject.
>     >
>     >     > The CollabWrapper and SugarGame projects are closer to
>     what I'm
>     >     > trying to say.  But not the SugarToolkit, as it creates some
>     >     > widgets, but if the developer needs more, he will use the Gtk
>     >     > library directly.
>     >
>     >     Okay.  But to proceed with this idea, you must identify a clear
>     >     benefit to cover the maintenance cost of adding the shim.
>     >
>     >     Long term, CollabWrapper could be added to the Toolkit, as
>     it has no
>     >     additional dependencies.
>     >
>     >     Sugargame cannot be added without creating a dependency for
>     Pygame,
>     >     which is something that has been resisted for some time; Pygame
>     >     activities often do not adapt well to screen rotation and
>     different
>     >     display sizes.
>     >
>     >     --
>     >     James Cameron
>     >     [3]http://quozl.netrek.org/
>     >     _______________________________________________
>     >     Sugar-devel mailing list
>     >     [4]Sugar-devel at lists.sugarlabs.org
>     <mailto:Sugar-devel at lists.sugarlabs.org>
>     >     [5]http://lists.sugarlabs.org/listinfo/sugar-devel
>     >
>     > References:
>     >
>     > [1] mailto:quozl at laptop.org <mailto:quozl at laptop.org>
>     > [2] https://github.com/sugarlabs/sugar/tree/master/src/jarabe/view
>     > [3] http://quozl.netrek.org/
>     > [4] mailto:Sugar-devel at lists.sugarlabs.org
>     <mailto:Sugar-devel at lists.sugarlabs.org>
>     > [5] http://lists.sugarlabs.org/listinfo/sugar-devel
>     > _______________________________________________
>     > Sugar-devel mailing list
>     > Sugar-devel at lists.sugarlabs.org
>     <mailto:Sugar-devel at lists.sugarlabs.org>
>     > http://lists.sugarlabs.org/listinfo/sugar-devel
>     -- 
>     James Cameron
>     http://quozl.netrek.org/
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20190216/41f8779d/attachment-0001.html>

More information about the Sugar-devel mailing list