[pygtk] PyGTK equivalent to g_filename_from_uri()

2009-02-12 Thread Luis Gonzalez

Hi,

I see that glib library has g_filename_from_uri() method to get the filename 
from uri :
http://library.gnome.org/devel/glib/stable/glib-Character-Set-Conversion.html#g-filename-from-uri

I don't find it into PyGTK, where is PyGTK equivalent to g_filename_from_uri()?

Thanks.

_
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] PyGTK equivalent to g_filename_from_uri()

2009-02-12 Thread Laszlo Pandy
No reason to duplicate the functionality of Python, which already has
URL handling in the standard library.
 import urlparse
 print urlparse.urlparse(file:///path/to/file).path
/path/to/file


2009/2/12 Luis Gonzalez ghempr...@hotmail.com:

 Hi,

 I see that glib library has g_filename_from_uri() method to get the filename 
 from uri :
 http://library.gnome.org/devel/glib/stable/glib-Character-Set-Conversion.html#g-filename-from-uri

 I don't find it into PyGTK, where is PyGTK equivalent to 
 g_filename_from_uri()?

 Thanks.

 _
 News, entertainment and everything you care about at Live.com. Get it now!
 http://www.live.com/getstarted.aspx
 ___
 pygtk mailing list   pygtk@daa.com.au
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://faq.pygtk.org/

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] PyGTK equivalent to g_filename_from_uri()

2009-02-12 Thread Pádraig Brady
Luis Gonzalez wrote:
 Hi,
 
 I see that glib library has g_filename_from_uri() method to get the filename 
 from uri :
 http://library.gnome.org/devel/glib/stable/glib-Character-Set-Conversion.html#g-filename-from-uri
 
 I don't find it into PyGTK, where is PyGTK equivalent to 
 g_filename_from_uri()?

I implemented something like this myself.
See: http://code.google.com/p/fslint/source/browse/tags/2.28/fslint-gui#157

cheers,
Pádraig.
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] hungry TreeStore...

2009-02-12 Thread Laszlo Pandy
I have no idea what it is but I was having the a similar problem on my
Ubuntu 8.10. Funny thing is that it wasn't consistent, so whenever i
got terrible performance I restarted the app and this fixed it
temporarily. Not sure if this is related because I didn't do any
performance testing or profiling. I will test again later.

Laszlo

2009/2/12 Alessandro Dentella san...@e-den.it:
 Hi, since yesterday, on my linux Ubuntu 8.0.4 I'm experimenting very strange
 things that I don't see on other machines. TreeStore  'append' method is
 taking a huge amount of time as shown by this 'prun' inside ipython:

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  3324.6440.0144.6480.014 {method 'append' of 
 'gtk.TreeStore' objects}
  4950.4900.0010.4900.001 {method 'set' of 'gtk.TreeStore' 
 objects}


 the same program on a different machine:

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  4950.0110.0000.0110.000 {method 'set' of 'gtk.TreeStore' 
 objects}
  3320.0040.0000.0070.000 {method 'append' of 
 'gtk.TreeStore' objects}



 I'm not at all aware of any changes. I didn't upgrade any tools and I don't
 remember to have installed anything in the last 2 days.

 One more strangeness is that I'm having these messages:
  Warning: /build/buildd/glib2.0-2.16.4/gobject/gsignal.c:2271: signal name
  `selection_changed' is invalid for instance `0x88e2998'

 that I don't receive on other machines and I didn't receive until yesterday.

 doesn that give you any idea wher I could investigate to understand what
 happened?


 sandro


 --
 Sandro Dentella  *:-)
 http://sqlkit.argolinux.orgSQLkit home page - PyGTK/python/sqlalchemy
 ___
 pygtk mailing list   pygtk@daa.com.au
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://faq.pygtk.org/

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] hungry TreeStore...

2009-02-12 Thread A.T.Hofkamp
Laszlo Pandy wrote:
 I have no idea what it is but I was having the a similar problem on my
 Ubuntu 8.10. Funny thing is that it wasn't consistent, so whenever i
 got terrible performance I restarted the app and this fixed it
 temporarily. Not sure if this is related because I didn't do any
 performance testing or profiling. I will test again later.

Sounds like a system that is running out of memory.
Did you check memory usage?


Sincerely,
Albert
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


[pygtk] Combobox Inside Treeview for SINGLE cell -- Not Entire Column?

2009-02-12 Thread darethehair
Hello All!

I am struggling with adding a 'cell-based' (not 'column-based') combobox 
to particular cells (not entire columns) of a treeview.  The normal 
techniques do not apply in this case, since they apply a combobox to 
*every* row in a column.  This example works fine for me in this context:

http://www.mail-archive.com/pygtk@daa.com.au/msg13782.html

After struggling for a long time, I opted to try using a 'cell data 
function' as mentioned in the FAQ:

http://www.pygtk.org/pygtk2tutorial/sec-CellRenderers.html#filelistingfig 
(section 14.4.5)

However, when I stumble to try this technique, it seems to apply the 
'custom' technique (combobox or otherwise) to *every* row in the treestore.

Is it actually possible to do what I want?  Can someone supply an 
extremely *simple* example showing a *cell-based* behavior override to 
what is displayed in a treeview cell -- even better one that inserts a 
'combobox' inside a *single* cell of a column of treeview data?

Thanks!


___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] Trouble while cross compiling PyGTK to ARM Processors

2009-02-12 Thread Nalli Dinesh
Harish,

Weclome to pygtk group of geeks.

If configure is trying to run python and pkgconfig, why can't you provide
ARM version of these libraries?

Just checking!!! Secondly you are running configure script to generate
appropriate Makefile to run Make to cross compile pygtk package for arm. I
think may be you might already have Makefile generating for other cross
compiling libraries, try to use that Makefile and make changes to it to
cross compile pygtk?

Let me know if you need  generic Makefile.





On Wed, Feb 11, 2009 at 10:00 PM, Harish Vishwanath 
harish.shas...@gmail.com wrote:

 Hello All,

 I am trying to cross-compile PyGTK 2.4.1 to ARM 9 processor. I have all the
 required dependencies already compiled for ARM 9 (Python, GTK, Cairo, Pango,
 PangoCairo pkgconfig etc.,). I have the following setup :

 Host : Suse Enterprise Linux 10, Intel X86
 Target : ARM 9

 I have LxNETES-3.2 installed on the Host, and using the arm-linux-gcc that
 comes along with it to do the compilation. I have pointed the CFLAGS,
 ATK_CFLAGS, ATK_LIBS etc., to appropriate locations on my host, and passing
 the following flags to configure :

 ./configure --host=arm-linux --target=arm-linux
 --prefix=/exports/nfsroot-9750acc/opt/arm/python252/lib/python2.5/site-packages/

 But, configure tries to run Python, and PkgConfig. Hence, I cant provide
 the ARM version of these libraries to 'configure' , and instead have
 provided the Host compatible Python/PkgConfig. But however, configure failed
 in trying to detect 'codegen' and I had to comment it to proceed further.
 Configure was successful, but make is failing now.

 Though I am trying to cross-compile :
 configure:3097: checking whether we are cross compiling
 configure:3099: result: yes

 it is still trying to execute PKG Config and Python. Is there a way to
 prevent this from happening?

 What is best way to compile PyGTK for ARM processor? I greatly appreciate
 any help.

 Regards,
 Harish

 ___
 pygtk mailing list   pygtk@daa.com.au
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://faq.pygtk.org/

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] Trouble while cross compiling PyGTK to ARM Processors

2009-02-12 Thread Harish Vishwanath
Hello Dinesh,

Thanks for the reply. If I provide Python and PkgConfig for ARM, it tries to
execute them , and fails with Cannot run executable, coz its trying to run
an ARM version of binary on Intel Host.

I dont have a Makefile which would get PyGTK compiled for ARM (or generic
Makefile)., I appreciate if you can pass that on to me if it is available to
you.

Regards,
Harish


On Thu, Feb 12, 2009 at 11:14 PM, Nalli Dinesh nalli.din...@gmail.comwrote:

 Harish,

 Weclome to pygtk group of geeks.

 If configure is trying to run python and pkgconfig, why can't you provide
 ARM version of these libraries?

 Just checking!!! Secondly you are running configure script to generate
 appropriate Makefile to run Make to cross compile pygtk package for arm. I
 think may be you might already have Makefile generating for other cross
 compiling libraries, try to use that Makefile and make changes to it to
 cross compile pygtk?

 Let me know if you need  generic Makefile.





 On Wed, Feb 11, 2009 at 10:00 PM, Harish Vishwanath 
 harish.shas...@gmail.com wrote:

 Hello All,

 I am trying to cross-compile PyGTK 2.4.1 to ARM 9 processor. I have all
 the required dependencies already compiled for ARM 9 (Python, GTK, Cairo,
 Pango, PangoCairo pkgconfig etc.,). I have the following setup :

 Host : Suse Enterprise Linux 10, Intel X86
 Target : ARM 9

 I have LxNETES-3.2 installed on the Host, and using the arm-linux-gcc that
 comes along with it to do the compilation. I have pointed the CFLAGS,
 ATK_CFLAGS, ATK_LIBS etc., to appropriate locations on my host, and passing
 the following flags to configure :

 ./configure --host=arm-linux --target=arm-linux
 --prefix=/exports/nfsroot-9750acc/opt/arm/python252/lib/python2.5/site-packages/

 But, configure tries to run Python, and PkgConfig. Hence, I cant provide
 the ARM version of these libraries to 'configure' , and instead have
 provided the Host compatible Python/PkgConfig. But however, configure failed
 in trying to detect 'codegen' and I had to comment it to proceed further.
 Configure was successful, but make is failing now.

 Though I am trying to cross-compile :
 configure:3097: checking whether we are cross compiling
 configure:3099: result: yes

 it is still trying to execute PKG Config and Python. Is there a way to
 prevent this from happening?

 What is best way to compile PyGTK for ARM processor? I greatly appreciate
 any help.

 Regards,
 Harish

 ___
 pygtk mailing list   pygtk@daa.com.au
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://faq.pygtk.org/



___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] hungry TreeStore... SOLVED (was GTK_MODULES=gail:atk-bridge)

2009-02-12 Thread Alessandro Dentella
Hi, 





On Thu, Feb 12, 2009 at 04:40:31PM +0100, Alessandro Dentella wrote:
 Hi, since yesterday, on my linux Ubuntu 8.0.4 I'm experimenting very strange
 things that I don't see on other machines. TreeStore  'append' method is
 taking a huge amount of time as shown by this 'prun' inside ipython:
 
ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   3324.6440.0144.6480.014 {method 'append' of 
 'gtk.TreeStore' objects}
   4950.4900.0010.4900.001 {method 'set' of 
 'gtk.TreeStore' objects}
 
 
 the same program on a different machine:
 
ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   4950.0110.0000.0110.000 {method 'set' of 
 'gtk.TreeStore' objects}
   3320.0040.0000.0070.000 {method 'append' of 
 'gtk.TreeStore' objects}
 
 
 
 I'm not at all aware of any changes. I didn't upgrade any tools and I don't
 remember to have installed anything in the last 2 days.
 
 One more strangeness is that I'm having these messages:
  Warning: /build/buildd/glib2.0-2.16.4/gobject/gsignal.c:2271: signal name
  `selection_changed' is invalid for instance `0x88e2998'
 
 that I don't receive on other machines and I didn't receive until yesterday.
 
 doesn that give you any idea wher I could investigate to understand what
 happened?


I solved the problem when answering to Laszlo and Albert (thnaks to both of
you). I realied that the error message (from the second problem) was related
to a directory that is not an Ubuntu nor one of mine  (  Warning: 
/build/buildd/glib2.0-2.16.4/gobject/gsignal.c:2271: signal name
 `selection_changed' is invalid for instance `0x88e2998')

So I remembered that a week ago I wanted to test gtkparasite. I had to
enable assistive tecnologies. At the end I got an enviromental variable
GTK_MODULES=gail:atk-bridge 

It was sufficient to unset it and everithing is working correctly.

I hope this can help others that may  get into troubles like this...


sandro
*:-)



-- 
Sandro Dentella  *:-)
http://sqlkit.argolinux.orgSQLkit home page - PyGTK/python/sqlalchemy
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] hungry TreeStore... SOLVED (was GTK_MODULES=gail:atk-bridge)

2009-02-12 Thread Willie Walker
Sandro - yikes!  This might be a good test case for helping improve the 
efficiency of GAIL/ATK, or at least for identifying a gotcha one might 
avoid in the UI code.  Can you log this as a performance-related bug 
against the GTK+/gail component at http://bugzilla.gnome.org?

Will

Alessandro Dentella wrote:
 Hi, 
 
 
 
 
 
 On Thu, Feb 12, 2009 at 04:40:31PM +0100, Alessandro Dentella wrote:
 Hi, since yesterday, on my linux Ubuntu 8.0.4 I'm experimenting very strange
 things that I don't see on other machines. TreeStore  'append' method is
 taking a huge amount of time as shown by this 'prun' inside ipython:

ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   3324.6440.0144.6480.014 {method 'append' of 
 'gtk.TreeStore' objects}
   4950.4900.0010.4900.001 {method 'set' of 
 'gtk.TreeStore' objects}


 the same program on a different machine:

ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   4950.0110.0000.0110.000 {method 'set' of 
 'gtk.TreeStore' objects}
   3320.0040.0000.0070.000 {method 'append' of 
 'gtk.TreeStore' objects}



 I'm not at all aware of any changes. I didn't upgrade any tools and I don't
 remember to have installed anything in the last 2 days.

 One more strangeness is that I'm having these messages:
  Warning: /build/buildd/glib2.0-2.16.4/gobject/gsignal.c:2271: signal name
  `selection_changed' is invalid for instance `0x88e2998'

 that I don't receive on other machines and I didn't receive until yesterday.

 doesn that give you any idea wher I could investigate to understand what
 happened?
 
 
 I solved the problem when answering to Laszlo and Albert (thnaks to both of
 you). I realied that the error message (from the second problem) was related
 to a directory that is not an Ubuntu nor one of mine  (  Warning: 
 /build/buildd/glib2.0-2.16.4/gobject/gsignal.c:2271: signal name
  `selection_changed' is invalid for instance `0x88e2998')
 
 So I remembered that a week ago I wanted to test gtkparasite. I had to
 enable assistive tecnologies. At the end I got an enviromental variable
 GTK_MODULES=gail:atk-bridge 
 
 It was sufficient to unset it and everithing is working correctly.
 
 I hope this can help others that may  get into troubles like this...
 
 
 sandro
 *:-)
 
 
 

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/