[Sugar-devel] Opening a web page from another Activity/application

Tony Anderson tony_anderson at usa.net
Mon Nov 12 08:48:32 EST 2012


Hi,

I have been approaching this from the other direction - opening a Sugar 
activity from a web page using localhost (CGIHTTPServer). I started the 
local server at launch of the Learn.activity (Firefox wrapper). The 
localhost cgi scripts invoke python scripts which can launch Sugar 
activities (new or resume). Resuming requires a minor patch to sugar-launch.

I would like to start it as a daemon (systemd). However, I am getting 
errors referencing sugar.activity and sugar.datastore in the cgi scripts 
(dbus unable to open display(X11)). As a global service 
(localhost:8008), I can also use the localhost with Browse.

The Learn.activity starts Fireox with a subprocess call:

/usr/bin/firefox 'http://localhost:8008/content/index.html'.

The path is relative to the location where localhost is launched.

Tony


On 11/12/2012 07:46 AM, sugar-devel-request at lists.sugarlabs.org wrote:
> Message: 1
> Date: Sun, 11 Nov 2012 15:31:56 -0200
> From: "S. Daniel Francis"<francis at sugarlabs.org>
> To: Sugar-dev Devel<sugar-devel at lists.sugarlabs.org>
> Subject: [Sugar-devel] [PROPOSAL] Opening a web page from another
> 	Activity/Application
> Message-ID:
> 	<CAAN6txZA2-mWFYZU3M7B5V_ihbLJ-WGJ4Mfn1-FcaFdqfA8V=Q at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Hello,
> Today at the PyCon Uruguay, some developers were asking about "How can
> they open a webpage through the Write Activity". And I'm working in a
> solution for this because I think it's part of the standards a web
> browser must can do.
> I have a repository with a command which starts the Browse activity
> and sets the URI in an environment variable.
>
> I have a repository for the command [1]. Can be installed with the
> same way as another Sugar component with make install.
> It also needs a patch[2] for the Browse activity to read the
> environment variable.
>
> I could not set the configuration for set it as the default browser
> when calling the function gtk.show_uri, the configuration file would
> need to can be installable from my repository too.
>
> Best regards,
> Daniel.
>
> [1]http://git.sugarlabs.org/browse-standarization/mainline
> [2]http://people.sugarlabs.org/francis/0001-Show-an-URI-from-the-env.patch
>



More information about the Sugar-devel mailing list