denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] Getting gio working for Denemo


From: Richard Shann
Subject: Re: [Denemo-devel] Getting gio working for Denemo
Date: Tue, 19 May 2009 14:14:57 +0100

I've been pushing on with looking at updating menus from a future
repository of commands kept on denemo.org. I think it may be that the
infrastructure in gio/gvfs is not sufficiently developed: as far as I
can see the new gtk_file_chooser_dialog routines, although they allow
browsing network files, do not link up with the gvfs demon and that
demon does not provide navigation through directories on websites. I
guess I was hoping that support for basic navigation and downloading of
files would have been incorporated into the gtk system by now. To give a
flavor of the work involved here is  a page from the internet obtained
by Denemo using the code I posted before (the page being
http://rshann.plus.com/menus/ObjectMenu/MeasureMenu)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd";>
<HTML>
 <HEAD>
  <TITLE>Index of /menus/ObjectMenu/MeasureMenu</TITLE>
 <META NAME="generator", CONTENT="mod_autoindex"> </HEAD>
 <BODY bgcolor="#ffffff" text="#000000">

<TABLE><TR><TD bgcolor="#ffffff" class="title">
<FONT size="+3" face="Helvetica,Arial,sans-serif">
<B>Index of /menus/ObjectMenu/MeasureMenu</B></FONT>

</TD></TR></TABLE><PRE><IMG border="0" src="/icons/blank.gif" ALT="
"> <A HREF="?N=D">Name</A>                    <A HREF="?M=A">Last
modified</A>       <A HREF="?S=A">Size</A>  <A
HREF="?D=A">Description</A>
<HR noshade align="left" width="80%">
<IMG border="0" src="/icons/back.gif" ALT="[DIR]"> <A
HREF="/menus/ObjectMenu/">Parent Directory</A>        19-May-2009 12:24
-  
<IMG border="0" src="/icons/unknown.gif" ALT="[   ]"> <A
HREF="SplitMeasure">SplitMeasure</A>            19-May-2009 12:27
1k  
</PRE><HR noshade align="left" width="80%">
</BODY></HTML>

We would end up incorprating a web-browser into Denemo if we started
parsing this to navigate to a command to download. Instead, it would
obviously be better to create an index to the available commands which
would be in a fixed place. This would then be downloaded on starting
Denemo and the commands could be downloaded after reading that. The
downside is we would need a program running periodically to update the
index, but I guess this is well within the scope of the stuff Nils has
available for denemo.org. (I am thinking of the git ticker).

Richard


On Mon, 2009-05-18 at 19:18 +0100, Richard Shann wrote:
> On Fri, 2009-05-15 at 19:07 +0100, Richard Shann wrote:
> > On Fri, 2009-05-15 at 18:07 +0100, Richard Shann wrote:
> > > I have had a very quick response from someone on the gtk-devel list
> > > saying we need a package called gvfs, which I will now install & test
> > > again,
> > I've done this. I installed the packages - there is a server and
> > backends, and ran the program again - I did not start any demon, but I
> > guess one is started by the installer, as now the g_file_read() call
> > hangs.
> I've just tried this again - same code (I think) - and it works. So I
> have read a page from off the internet into Denemo.
> Richard
> 
> 
> 
> >  (There is an asynchronous version of this function, but the page
> > is fetchable, so I think that this should return at least after a
> > while).
> > I'll ask some more on gtk-app-devel list.
> > Richard
> > 
> > 
> > 
> > > Richard
> > > 
> > > On Fri, 2009-05-15 at 07:46 -0500, Jeremiah Benham wrote:
> > > > On Fri, May 15, 2009 at 12:53:07PM +0100, Richard Shann wrote:
> > > > > I've been trying to get installation of Denemo commands directly from
> > > > > denemo.org.
> > > > > As a first step I included the following code in Denemo:
> > > > > 
> > > > >   GError *err = NULL;
> > > > >   GFile * file=g_file_new_for_uri
> > > > > ("http://www.rshann.plus.com/denemo.html";);
> > > > >   GFileInputStream *stream =  g_file_read(file, NULL, &err);
> > > > >   if (err != NULL)
> > > > >     {
> > > > >       g_warning ("The opening of uri gave %s", err->message);
> > > > >       if(err) g_error_free (err);
> > > > >       err = NULL;
> > > > >     } else {
> > > > > #define COUNT (10000)
> > > > >       gchar *buffer = g_malloc0(COUNT);
> > > > >       gsize numbytes;
> > > > >       gboolean success = g_input_stream_read_all(stream, buffer,
> > > > >                                                COUNT,
> > > > >                                                &numbytes,NULL,NULL);
> > > > >       g_print("Read ***********\n%s\n*********** end of read", 
> > > > > buffer);
> > > > >       
> > > > >     }
> > > > > 
> > > > > This works for files on the local disk (i.e. "file:///home...." ) but
> > > > > gives
> > > > > 
> > > > > Operation not supported
> > > > > 
> > > > > for the page on the internet. Under the documentation is just the
> > > > > statement that it means it is not supported by the backend. But 
> > > > > whether
> > > > > this is the case for Debian Lenny I don't know. Can someone try the 
> > > > > code
> > > > > on their distro (you need to include gio/gio.h and link with 
> > > > > -lgio-2.0),
> > > > > in case it is just Lenny being behind the times.
> > > > 
> > > > I can test this out tonight after work. So you probably won't get the 
> > > > answer until tommorow due to time zones. 
> > > > 
> > > > Jeremiah 
> > > > > 
> > > > > Richard
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > _______________________________________________
> > > > > Denemo-devel mailing list
> > > > > address@hidden
> > > > > http://lists.gnu.org/mailman/listinfo/denemo-devel
> > > 
> > > 
> > > 
> > > _______________________________________________
> > > Denemo-devel mailing list
> > > address@hidden
> > > http://lists.gnu.org/mailman/listinfo/denemo-devel
> > 
> > 
> > 
> > _______________________________________________
> > Denemo-devel mailing list
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/denemo-devel
> 
> 
> 
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/denemo-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]