Re: [pygtk] GIO/GVFS and pygtk

2008-03-29 Thread Magnus Therning
Johan Dahlin wrote:
> Hi John,
> 
>> I was just wondering what the plan for GIO/GVFS is. Will it live in
>> pygtk, pygobject, pygnomevfs or somewhere else?
> 
> The obvious place for GIO bindings is in pygobject. It could also be made
> external, but it would depend on pygobject.
> 
>> Is there currently work underway, or anything I can do to help?
> 
> Nobody are working on bindings for GIO, at least not publicly.
> GVFS is just additional modules without extra API as far as I know, so
> there would be no need for specific bindings, the GIO ones would be enough.

Is this still the current state of affairs?

The reason I'm asking is that I've just realised I should have used
Gnome-VFS for a project, it really would have made the tool a lot more
useful.  Seeing that Gnome 2.22 is out and that it deprecates Gnome-VFS
in favour of GIO/GVFS makes me hesitant to use Gnome-VFS at this time.

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnus@therning.org Jabber: magnus.therning@gmail.com
http://therning.org/magnus

What if I don't want to obey the laws? Do they throw me in jail with
the other bad monads?
 -- Daveman



signature.asc
Description: OpenPGP digital signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] GNOME printing in Python?

2007-05-25 Thread Magnus Therning
On Fri, May 25, 2007 at 16:22:18 +0200, Gian Mario Tagliaretti wrote:
>2007/5/25, Magnus Therning <[EMAIL PROTECTED]>:
>>What I'd like to do is very simple, just send the contents of a string,
>>prepared in a Python script, to the printer.  If possible I'd like to
>>use the GNOME printing thingamajig rather than just throwing it in a
>>file and sending lpr on it.  I can't seem to find any documention on how
>>to work with printing in GNOME though.  Can anyone offer me some good
>>pointers?
>>
>
>in pygtk you can use the new gtk.Print* stuff, documented with the
>rest of pygtk in the reference manual:
>http://www.pygtk.org/docs/pygtk/index.html
>
>the old gnome print stuff is documented as well:
>http://www.pygtk.org/pygnomeprint/index.html

Thanks for the pointers.  However this turns out to be a little more
complicated than I had hoped :-(

This is what I have so far, but it prints one blank page:

def print_text(text):
p = gtk.PrintOperation()

p.connect("begin-print", begin_print)
p.connect("draw-page", draw_page)

r = p.run(gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG)

print r


def begin_print(op, ctx):
op.set_n_pages(1)


def draw_page(op, ctx, page_nr):
cairo_ctx = ctx.get_cairo_context()

layout = cairo_ctx.create_layout()
layout.set_text('Some text'.decode('utf8'))
desc = pango.FontDescription("sans 28")
layout.set_font_description(desc)
    
    cairo_ctx.move_to(30, 30)
cairo_ctx.layout_path(layout)


print_text()

Any more pointers?

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

The day after tomorrow is the third day of the rest of your life.


pgp1lJ056ojQy.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] GNOME printing in Python?

2007-05-25 Thread Magnus Therning
What I'd like to do is very simple, just send the contents of a string,
prepared in a Python script, to the printer.  If possible I'd like to
use the GNOME printing thingamajig rather than just throwing it in a
file and sending lpr on it.  I can't seem to find any documention on how
to work with printing in GNOME though.  Can anyone offer me some good
pointers?

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus


pgpLt69rJIvxv.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] l10n, bind_textdomain_codeset?

2007-04-02 Thread Magnus Therning
I've managed to add l10n for epilicious[1], a small extension for
epiphany[2] written in Python.  Basically what I've done is

 gtk.glade.bindtextdomain(mydomain)
 t = gettext.translation(mydomain)
 _ = t.ugettext

in the main file.  Then I load glade files passing the domain explicitly
to them.  This seems to work just fine, but recently I was asked whether
I need a call to gettext.bind_textdomain_codeset() in order to specify
UTF-8 to be used.  Do I?

/M

[1]: http://therning.org/magnus/computer/epilicious/
[2]: http://www.gnome.org/projects/epiphany/

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

You know, take Lisp. You know, it’s the most beautiful language in the
world. At least up until Haskell came along.
 -- Larry Wall


pgpAf8FNuhSrt.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] Re: Localisation of python plugin

2006-12-07 Thread Magnus Therning
Can I somehow "merge" two domains in glade so that plugins written
separately can manage their own localisation?

The code below will reset epiphany's localisation to English and only
the plugin's localisation follows the locale setting.

/M

On Wed, Dec 06, 2006 at 08:46:06 +0000, Magnus Therning wrote:
>It seems my localisation attempts on epilicious[1] fail miserably.  At
>the moment I have the following code in the plugin:
>
>  import gettext
>  import gtk.glade
>  try:
>  gtk.glade.bindtextdomain('epilicious', '/usr/share/locale')
>  gtk.glade.textdomain('epilicious')
>  t = gettext.translation('epilicious', '/usr/share/locale')
>  _ = t.ugettext
>  except Exception, e:
>  _ = lambda x : x
>
>The effect of this is that loading epilicious in a locale where
>epilicious has no translation results in all of epiphany reverting back
>to English.
>
>How should I do it?
>
>/M
>
>[1]: http://therning.org/magnus/computer/epilicious/
>
>-- 
>Magnus Therning (OpenPGP: 0xAB4DFBA4)
>[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
>http://therning.org/magnus
>
>Software is not manufactured, it is something you write and publish.
>Keep Europe free from software patents, we do not want censorship
>by patent law on written works.
>
>The definition of insanity is doing the same thing over and over again
>and expecting different results.
> -- Albert Einstein



>___
>epiphany-list mailing list
>epiphany-list@gnome.org
>http://mail.gnome.org/mailman/listinfo/epiphany-list


-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Don’t worry about other people stealing your ideas. If you’re ideas
are any good, you’ll have to ram them down people’s throats.
 -- Howard Aiken, IBM Engineer


pgpjdn2Pi1Cuf.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] easy question :)

2006-10-20 Thread Magnus Therning
On Thu, Oct 19, 2006 at 12:23:23 -0700, enache alex wrote:
>The OS I want to write the program for is Linux(Fedora). Thanks.

I don't think there's any "Python way" of doing this.  Instead you'll
have to use Python to modify network settings in /etc and running
command lind tools.  AFAIK this is bound to make your tool very tightly
bound to a specific distribution unless you do some clever abstraction.

On top of this you might also have to deal with desktop settings (GNOME
or KDE), especially regarding proxy settings.

/M

>Magnus Therning <[EMAIL PROTECTED]> wrote: On Wed, Oct 18, 2006 at 22:31:23 
>-0700, enache alex wrote:
>>Hello there. I want to know how can I set the internet settings(IP,net
>>mask, proxy, etc) from within python(I'll have a window created with
>>pygtk in which I will fill some textboxes, and when I press OK the
>>modifications will be made to the IP,..etc). Thanks
>
>I think you need to use different methods on different systems.  So,
>what OS is this for?
>
>/M
>
>-- 
>Magnus Therning (OpenPGP: 0xAB4DFBA4)
>[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
>http://therning.org/magnus
>
>Software is not manufactured, it is something you write and publish.
>Keep Europe free from  software patents, we do not want censorship
>by patent law on written works.
>
>The definition of insanity is doing the same thing over and over again
>and expecting different results.
> -- Albert Einstein
>___
>pygtk mailing list   pygtk@daa.com.au
>http://www.daa.com.au/mailman/listinfo/pygtk
>Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>
>  
>
>-
>Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small 
>Business. ___
>pygtk mailing list   pygtk@daa.com.au
>http://www.daa.com.au/mailman/listinfo/pygtk
>Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>
>
>   
>-
>Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small 
>Business.
>   
>-
>Get your email and more, right on the  new Yahoo.com 

Content-Description: pat244779576
>___
>pygtk mailing list   pygtk@daa.com.au
>http://www.daa.com.au/mailman/listinfo/pygtk
>Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

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


-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Some operating systems are called 'user friendly', Linux however is
'expert friendly'.


pgpM6r7bfIWhe.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] easy question :)

2006-10-19 Thread Magnus Therning
On Wed, Oct 18, 2006 at 22:31:23 -0700, enache alex wrote:
>Hello there. I want to know how can I set the internet settings(IP,net
>mask, proxy, etc) from within python(I'll have a window created with
>pygtk in which I will fill some textboxes, and when I press OK the
>modifications will be made to the IP,..etc). Thanks

I think you need to use different methods on different systems.  So,
what OS is this for?

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

The definition of insanity is doing the same thing over and over again
and expecting different results.
 -- Albert Einstein


pgpb4aJpKWgV0.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] ORBit and python

2006-09-26 Thread Magnus Therning
On Tue, Sep 26, 2006 at 10:03:10 +1000, Russell Strong wrote:
>Hi,
>
>I've been pulling my hair out the last couple of days trying to get a
>simple python/ORBit example working.
>
>The server code ( see below ) show the following error Traceback (most
>recent call last):
> File "server", line 14, in increment
>   self.count += 1
>AttributeError: 'Counter' object has no attribute 'count'
>
>Adding a line print dir(self) to increment shows there really is no
>count.  Huh???
>
>The client ( see below ) shows:
>Traceback (most recent call last):
> File "client", line 13, in ?
>   counter.increment()
>CORBA.UNKNOWN
>
>HELP !!!

I copy-pasted your code into three files here and noticed the same
behaviour.  I then went to the PyORBit doc I keep around [1] and tried
the Account example.  I got that to work by moving the "import CORBA" to
after the call to "ORBit.load_file".  So there shouldn't be something
inherently preventing you from using attributes.

I realise this isn't really a solution to your problem, but maybe it can
offer some hint on how to get it working...

/M

PS I keep on getting the following warning:

 cc1: note: obsolete option -I- used, please use -iquote instead

Is that well-known?  Should I raise a bug on it?

[1]: http://therning.org/magnus/computer/pyorbit/

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

"Oh no, not again."

-- A bowl of petunias on it's way to certain death.


pgpQ9NVP0XZbX.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] ORBit and python

2006-09-26 Thread Magnus Therning
On Tue, Sep 26, 2006 at 11:24:44 +0100, Gustavo J. A. M. Carneiro wrote:
>On Ter, 2006-09-26 at 11:01 +0100, Magnus Therning wrote:
>> I copy-pasted your code into three files here and noticed the same
>> behaviour.  I then went to the PyORBit doc I keep around [1] and tried
>> the Account example.  I got that to work by moving the "import CORBA" to
>> after the call to "ORBit.load_file".  So there shouldn't be something
>> inherently preventing you from using attributes.
>
>  You should always import ORBit before CORBA is imported for the first
>time.  The reason is that "import CORBA" first just imports whatever the
>default ORB in your system is.. could be omniorb or something like that.
>If you import ORBit first, pyorbit then provides its own replacement
>CORBA module.

Hmmm, interesting.  The code in the examples used to work, but not any
longer.  I suppose that's an improvement then :-)

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

"The fronting for the eighty-yard long marble-topped bar had been made
by stitching together nearly twenty thousand Antarean Mosaic Lizard
skins, despite the fact that the twenty thousand lizards concerned had
needed them to keep their insides in."

-- The Book decribing Milliways' politically incorrect decor.


pgp3zpGtHtwkg.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: Repl-to of Mailinglist Was: [pygtk] converting characters to uppercase as they are being type in gtk.Entry

2006-09-20 Thread Magnus Therning
On Tue, Sep 19, 2006 at 09:40:06 +0200, Thomas Güttler wrote:
>Am Montag, 18. September 2006 20:43 schrieb Arnau Sanchez:
>> ps: [offtopic] a question for the owners of the list: when I make a reply
>> to a message, it does not appear the mailing list address as destination
>> but only the person who wrote the message. This may be the reason why so
>> many people answer privately without noticing. Is this the desired
>> behaviour?
>
>Me too. I think it would be better to set the reply-to to the mailing
>list.
>
>I think many answers don't appear on the mailing list, because they are
>sent directly to the one who asked.

This is a religious issue:

 http://www.unicom.com/pw/reply-to-harmful.html
 http://www.metasystema.net/essays/reply-to.mhtml

My opinion is "I don't care".  My mailer supports mail-to-list, and
generally does the right thing :-)

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

If voting could really change things it would be illegal.


pgpH48XWY7WMI.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] PyGTK Shell: intermediate snapshot

2006-08-28 Thread Magnus Therning
On Mon, Aug 28, 2006 at 15:09:00 +0200, Felix Rabe (public) wrote:
>Hi all,
>
>To keep you up-to-date, I announce the current development snapshot of
>my PyGTK Shell project:
>
>http://felixrabe.textdriven.com/pygtk-shell/
>
>
>
>I encourage you to test it and send verbose feedback :o) (tutorial in
>the README; I use an enhanced version of the shell at my job)
>
>The PyGTK Shell is a framework making Python applications open to
>realtime programmatic intervention by its users.  This is just the
>right tool for Python-programming control freaks.
>
>It is similar to the (two) PyGTK console examples that are included in
>the PyGTK tutorial, but portable to Linux + win32 (don't know about
>other platforms) and using just Python and GTK, no terminal.

I haven't looked closer at it, but can I use it together with ipython[1]
somehow?

/M

[1]: http://ipython.scipy.org/

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Finagle's Fourth Law:
Once a job is fouled up, anything done to improve it only makes it
worse.


pgpW1j8YHuXzp.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] documentation for wnck

2006-07-04 Thread Magnus Therning
On Tue, Jul 04, 2006 at 16:10:33 +0700, akbar wrote:
>Hi, I want to play with wnck but I can't find any official
>documentation or reference about it. Where can I find it? All I can
>find are some code about it in mailing list archive or google.

http://www.mcs.vuw.ac.nz/technical/software/doc/libwnck/

That's for the C version, it's fairly straightforward to translate to
Python.

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

The right to search for truth implies also a duty; one must not
conceal any part of what one has recognized to be true.
 -- Albert Einstein


pgpmGm2XwAGt7.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] GNOME applets in Python and Debian?

2006-07-03 Thread Magnus Therning
On Mon, Jul 03, 2006 at 18:01:49 +0200, Arnau Sanchez wrote:
>Hi,
>
>> In [7]: import gnomeapplet
>> ImportError: No module named gnomeapplet
>
>This module is in the "python-gnome2-extras" package.
>
>Normally, you should be able to do that:
>
>(apt-get install apt-file)
>
>$ apt-file search gnomeapplet
>
>python2.3-gnome2-extras: usr/lib/python2.3/site-packages/gtk-2.0/gnomeapplet.la
>python2.3-gnome2-extras: usr/lib/python2.3/site-packages/gtk-2.0/gnomeapplet.so
>
>but this is not working today. I think debian people are updating their 
>repositories...

% dpkg -l python-gnome2-extras
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name VersionDescription
+++--==-=
ii  python-gnome2-extras 2.14.0-1   Python bindings for the GNOME desktop 
environment
% dpkg -L python-gnome2-extras|grep applet
% 

Thanks for telling where it should be, it helped me find this bug
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=376129

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

If our ideas of intellectual property are wrong, we must change them,
improve them and return them to their original purpose. When
intellectual property rules diminish the supply of new ideas, they
steal from all of us.
 -- Andrew Brown, November 19, 2005, The Guardian


pgpI9sDrWCM73.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] GNOME applets in Python and Debian?

2006-07-03 Thread Magnus Therning
I'm on a Debian Sid system and I'm having problems with the applet
tutorial:

 In [2]: import pygtk

 In [3]: pygtk.require('2.0')

 In [4]: import gtk

 In [5]: import gnome

 In [7]: import gnomeapplet
 ---
 exceptions.ImportError   Traceback (most
 recent call last)

 /usr/lib/python-support/

 ImportError: No module named gnomeapplet

 In [8]: import gnome.applet
 ---
 exceptions.ImportError   Traceback (most
 recent call last)

 /usr/lib/python-support/

 ImportError: No module named applet


(The reason for [7] is that the Newton applet tries to import it that
way.)

Am I just missing some package or have things changed radically since
the tutorial was written?

/M

[Tutorial]: http://www.pygtk.org/articles/applets_arturogf/
[Newton]: http://newton.sourceforge.net/

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Finagle's Sixth Law:
Don't believe in miracles -- rely on them.


pgpQyzFTMnZrZ.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] Re: Threading in a python extension?

2006-06-21 Thread Magnus Therning
On Sun, Jun 18, 2006 at 12:32:52 +0200, Frederic Peters wrote:
>Magnus Therning wrote:
>
>> Does anyone have any examples of multi-threade extensions written in
>> Python?
>
>Nope but multi-thread is perhaps not necessary, PyGTK FAQ has a good
>suggestion about using gobject.idle_add and python enumerators.  I
>have been using this trick in a few pygtk apps to keep them
>responsives while not using threads and have been very happy with it.
>
>  http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq23.020.htp

Isn't there an error in that recipe?

my_task() will return a new generator each time it's called so the
following code wouldn't do what's intended, right?

  def on_start_my_task_button_click(data):
  gobject.idle_add(my_task().next, data)

I think what's intended is:

  def on_start_my_task_button_click(data):
  task = my_task()
  gobject.idle_add(task.next, data)

Or did I miss something?

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

The day after tomorrow is the third day of the rest of your life.


pgpPbelpJzUfZ.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] how to install pyGTK

2006-05-31 Thread Magnus Therning
On Wed, May 31, 2006 at 11:28:32 +1000, John Pye wrote:
>Hi,
>
>You need to install GTK+ first, then install PyGTK. If you haven't yet
>installed GTK+, then I'd suggest using GTK+ 2.6.10-rc1 from this page:
>http://gladewin32.sourceforge.net/modules/wfdownloads/viewcat.php?cid=8
>
>This will also install the Glade interface builder, which you will find
>useful.
>
>Make sure that if you install GTK+ 2.6 that you install the
>corresponding PyGTK 2.6 and make sure you select the correct one for
>the version of Python you are using.
>http://www.pcpm.ucl.ac.be/~gustin/win32_ports/binaries/pygtk-2.6.3-1.win32-py2.4.exe
>
>After installing GTK+, check that the demo program in the start menu is
>working correctly, and check that you can run Glade. Then it's probably
>a good idea to try to run a 'hello world' example program with PyGTK,
>just to check that everything's working as expected. Let us know if you
>still have problems.

Another point to pay attention to is version numbering. Make sure you
install the matching versions of GTK+ and PyGTK!

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

The day after tomorrow is the third day of the rest of your life.


pgpya4nqS2unm.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] how to install pyGTK

2006-05-30 Thread Magnus Therning
On Tue, May 30, 2006 at 09:14:13 -0700, arya jain wrote:
>hi i am new to python. i am consulting a book under wrox publication
>(beginning python) and just reached to a chapter on python GUI. now i
>am not able to install the graphic tool kit pyGTK from the site
>mentioned in the book. it is not like the regular installation i do on
>windows.
>  can u please tell me the step by step procedure to do it right from
>the begining including the support software. i will be thankful. i am
>planning to make the game of chess on python which i will present in my
>collage. 
>  o/s used windows XP home
>  python 2.4 

Where do you get stuck?

From the official PyGTK page (http://www.pygtk.org/) I followed the link
named "downloads". Then I went to Cedric Gustin's page for th Win32 port
(http://www.pcpm.ucl.ac.be/~gustin/win32_ports/). Then I clicked on the
link "pygtk on win32". There I found executable files that'll install
PyGTK.

Do you run into problems after that?

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

$my_args = shift;
system("gcc $my_args");
print "I prefer C\n";
 -- Robert Dieterich's contribution to the 2004 Perl Haiku Contest,
Haikus in Perl - 'Dishonerable Mention' winner


pgpx88PhwDJbo.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] pygtk-codegen, enum/flags issue

2006-05-30 Thread Magnus Therning
On Tue, May 30, 2006 at 07:35:39PM +0100, Gustavo J. A. M. Carneiro wrote:
>On Ter, 2006-05-30 at 08:26 +0100, Magnus Therning wrote:
[..]
>> I have two questions:
>>  1. What's the difference between enum and flags for pygtk-codegen, and
>> when should I use which?
>
>  enums are mutually exclusive values; flags are values that can be
>combined in a single 'set' value, like bit masks.

Ah, that clears things up. Thanks.

>>  2. How do i derive the gtype-id? (I seem to have done it right for
>> WnckWindowGravity but not for WnckWindowMoveResizeMask.)
>
>  gtype-id is guessed by h2def.py, but most libraries out there are not
>bindings-friendly and don't bother to register GType's for enums and
>flags.  Metacity is one of those.  My advice is, simply remove the
>gtype-id, so pygtk-codegen will simply generate code to register the
>values as simple int constants.

Oh, OK. I got the impression that libwnck does the right thing since all
the enums/flags in wnck.defs does have gtype-ids... it might be my
inexperience with GTK+/GNOME that's shining through though :-)

On to the next problem then (which I sent in another email as well),
where do enums/flags live in the python bindings? I need to instantiate
and pass some flags into a libwnck function.

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Good powers of observation are frequently called "cynicism" by those
that don't have them.


pgpVd38Lh8A52.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] Where are enums/flags?

2006-05-30 Thread Magnus Therning
Now this may sound silly, but I can't find the enums/flags in wnck.

That isn't a big problem when a function returns an enum/flag, but it's
more problematic when a function takes an enum as an argument.

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

DRM discourages piracy like Thalidomide promotes healthy childbirth.
 -- Mark Hewitt, on the ORG discuss list


pgp9DttNQzkyp.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] pygtk-codegen, enum/flags issue

2006-05-30 Thread Magnus Therning
There's a patch for libwnck so that it implements a method for setting
the geometry for a window (wnck_window_set_geometry() in the patch for
GNOME bug 342899[1]). In my attempts to add a python binding for this
I've run into some problems with one of the enums:

 wnck.c: In function '_wrap_wnck_window_set_geometry':
 wnck.c:1562: error: 'WNCK_TYPE_WINDOW_MOVERESIZEMASK' undeclared (first use in 
this function)
 wnck.c:1562: error: (Each undeclared identifier is reported only once
 wnck.c:1562: error: for each function it appears in.)
 wnck.c: In function 'pywnck_add_constants':
 wnck.c:2009: error: 'WNCK_TYPE_WINDOW_MOVERESIZEMASK' undeclared (first use in 
this function)

The patch is at the end of the email.

I have two questions:
 1. What's the difference between enum and flags for pygtk-codegen, and
when should I use which?
 2. How do i derive the gtype-id? (I seem to have done it right for
WnckWindowGravity but not for WnckWindowMoveResizeMask.)

/M

1. http://bugzilla.gnome.org/show_bug.cgi?id=342899


Index: python-gnome2-extras/gnome-python-extras-2.12.1/wnck/wnck.defs
===
--- python-gnome2-extras.orig/gnome-python-extras-2.12.1/wnck/wnck.defs 
2006-05-30 07:55:33.0 +0100
+++ python-gnome2-extras/gnome-python-extras-2.12.1/wnck/wnck.defs  
2006-05-30 08:10:34.0 +0100
@@ -132,6 +132,36 @@
   )
 )
 
+(define-enum WindowGravity
+  (in-module "Wnck")
+  (c-name "WnckWindowGravity")
+  (gtype-id "WNCK_TYPE_WINDOW_GRAVITY")
+  (values
+'("current" "WNCK_WINDOW_GRAVITY_CURRENT")
+'("northwest" "WNCK_WINDOW_GRAVITY_NORTHWEST")
+'("north" "WNCK_WINDOW_GRAVITY_NORTH")
+'("northeast" "WNCK_WINDOW_GRAVITY_NORTHEAST")
+'("west" "WNCK_WINDOW_GRAVITY_WEST")
+'("center" "WNCK_WINDOW_GRAVITY_CENTER")
+'("east" "WNCK_WINDOW_GRAVITY_EAST")
+'("southwest" "WNCK_WINDOW_GRAVITY_SOUTHWEST")
+'("south" "WNCK_WINDOW_GRAVITY_SOUTH")
+'("southeast" "WNCK_WINDOW_GRAVITY_SOUTHEAST")
+  )
+)
+
+(define-enum WindowMoveResizeMask
+  (in-module "Wnck")
+  (c-name "WnckWindowMoveResizeMask")
+  (gtype-id "WNCK_TYPE_WINDOW_MOVERESIZEMASK")
+  (values
+'("change-x" "WNCK_WINDOW_CHANGE_X")
+'("change-y" "WNCK_WINDOW_CHANGE_Y")
+'("change-width" "WNCK_WINDOW_CHANGE_WIDTH")
+'("change-height" "WNCK_WINDOW_CHANGE_HEIGHT")
+  )
+)
+
 
 ;; From /usr/include/libwnck-1.0/libwnck/application.h
 
@@ -1033,6 +1063,20 @@
   )
 )
 
+(define-method set_geometry
+  (of-object "WnckWindow")
+  (c-name "wnck_window_set_geometry")
+  (return-type "none")
+  (parameters
+'("WnckWindowGravity" "gravity")
+'("WnckWindowMoveResizeMask" "geometry_mask")
+'("int" "x")
+'("int" "y")
+'("int" "width")
+'("int" "height")
+  )
+)
+
 (define-method is_visible_on_workspace
   (of-object "WnckWindow")
   (c-name "wnck_window_is_visible_on_workspace")

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Time is a great teacher, but unfortunately it kills all its pupils.
 -- Hector Louis Berlioz


pgpTwIAvWyuNc.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] wnck.Window.get_geometry missing?

2006-05-29 Thread Magnus Therning
On Sun, May 28, 2006 at 11:57:00PM +0100, Gustavo J. A. M. Carneiro wrote:
[..]
>  Here's how I'd solve it:
>
>   1. comment out the int* parameters in the defs;
>   2. compile; it's going to fail, of course;
>   3. go to the generated C file, look for the wrapper, copy it
>   4. go to the .override file, add something like
>%% override wnck_window_get_geometry noargs
>
>   5. Edit the wrapper
> a) declare a few int variables, pass the missing arguments by taking
>a reference to the variables, like &x, &y, &width, &height
> b) replace the Py_None return block with
>   return Py_BuildValue("", x, y, width, height);
>   6. Uncomment back the parameters in the .defs
>   7. Compile, test, submit the patch
>
>  Good luck :-)

Worked like a charm :-)

I've created bug 343332[1] with a patch that works fine on my system.

/M

1. http://bugzilla.gnome.org/show_bug.cgi?id=343332

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

"Sendmail" and "make" are two well known programs that are pretty widely
regarded as being debugged into existence. That's why their command
languages are so poorly thought out and difficult to learn.  It's not
just you -- everyone finds them troublesome.
 -- Peter van der Linden, Expert C Programming, p. 220


pgpcfANzc58iF.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] wnck.Window.get_geometry missing?

2006-05-28 Thread Magnus Therning
On Sun, May 28, 2006 at 12:31:14PM +0100, Gustavo J. A. M. Carneiro wrote:
>Sáb, 2006-05-27 às 21:56 +0100, Magnus Therning escreveu:
>> I can't figure out why wnck.Window.get_geometry isn't in the python
>> bindings.
>> 
>> wnck.defs contains the following
>> 
>>  (define-method get_geometry
>>(of-object "WnckWindow")
>>(c-name "wnck_window_get_geometry")
>>(return-type "none")
>>(parameters
>>  '("int*" "xp")
>>  '("int*" "yp")
>>  '("int*" "widthp")
>>  '("int*" "heightp")
>>)
>>  )
>> 
>> But that doesn't seem to result in the function turning up :-(
>> 
>> I've only tested this on Debian Sid but I can't see any reason for it to
>> be distro specific. The following would check if it's there:
>> 
>>  import wnck, gtk
>>  s = wnck.screen_get_default()
>>  while gtk.events_pending(): gtk.main_iteration()
>>  w = s.get_active_window()
>>  print [f for f in dir(w) if f == 'get_geometry']
>> 
>> On my system that results in the printing of an empty list.
>> 
>> Any pointers on how to fix this (I've not managed to find any docs on
>> pygtk-codegen-2.0 at all) would be much appreciated.
>
>  You can start by opening a bug report on gnome bugzilla, product
>gnome-python-desktop.  Thanks.

Not really the hands on answer I was hoping for ;-) I was hoping to get
some pointers so I can file the bug report with a patch... I'll just go
ahead and report it and then look into making a patch.

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Finagle's Fourth Law:
Once a job is fouled up, anything done to improve it only makes it
worse.


pgp5v9s0RRned.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] wnck.Window.get_geometry missing?

2006-05-27 Thread Magnus Therning
I can't figure out why wnck.Window.get_geometry isn't in the python
bindings.

wnck.defs contains the following

 (define-method get_geometry
   (of-object "WnckWindow")
   (c-name "wnck_window_get_geometry")
   (return-type "none")
   (parameters
 '("int*" "xp")
 '("int*" "yp")
 '("int*" "widthp")
 '("int*" "heightp")
   )
 )

But that doesn't seem to result in the function turning up :-(

I've only tested this on Debian Sid but I can't see any reason for it to
be distro specific. The following would check if it's there:

 import wnck, gtk
 s = wnck.screen_get_default()
 while gtk.events_pending(): gtk.main_iteration()
 w = s.get_active_window()
 print [f for f in dir(w) if f == 'get_geometry']

On my system that results in the printing of an empty list.

Any pointers on how to fix this (I've not managed to find any docs on
pygtk-codegen-2.0 at all) would be much appreciated.

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

If you can explain how you do something, then you're very very bad at
it.
 -- John Hopfield


pgpFHhL3Whqcn.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Detecting number of monitors/screens?

2006-05-24 Thread Magnus Therning
Hope you don't mind that I'm CCing the list as well.

On Wed, May 24, 2006 at 08:55:34AM +0100, Duncan Greenwood wrote:
>Magnus Therning wrote:
>
>>How do I find out how many heads X is using?
>>
>>I'm on a dual-head system at work and would like my program to be able
>>to detect that and change its behaviour appropriately (I'm moving around
>>windows and would like them to stay on a single monitor). I have been
>>looking at the API offered by wnck, it offers all information about the
>>screen/display/window I need, except for this little detail :-(
>>
>Magnus
>
>This is basically what the standard xdpyinfo(1) command does,
>converted to python:
>
>  >>> import gtk
>  >>> d = gtk.gdk.Display('mercury:0')
>  >>> d.get_n_screens()
>  1
>  >>> s = d.get_screen(0)
>  >>> s.get_n_monitors()
>  1
>  >>>
>
>Hope this helps.

Ah, it sure does. Thanks!

I also noticed that it's possible to get enough information to figure
out the entire configuration. Continuing on your snippet (but using
ipython of course):

 In [10]: m1 = s.get_monitor_geometry(0)
 In [11]: m1.x
 Out[11]: 1280
 In [12]: m1.y
 Out[12]: 0
 In [13]: m2 = s.get_monitor_geometry(1)
 In [14]: m2.x
 Out[14]: 0
 In [15]: m2.y
 Out[15]: 0
 In [16]: m2.width
 Out[16]: 1280
 In [17]: m2.height
 Out[17]: 1024

As you can see I have my first monitor to the right of my second :-)

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Most people, I think, don't even know what a Rootkit is, so why should
they care about it?
 -- Thomas Hesse, president of Sony-BMG's Global Digital Business,
commenting on XCP


pgpAf9B0BNBMW.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] Detecting number of monitors/screens?

2006-05-23 Thread Magnus Therning
How do I find out how many heads X is using?

I'm on a dual-head system at work and would like my program to be able
to detect that and change its behaviour appropriately (I'm moving around
windows and would like them to stay on a single monitor). I have been
looking at the API offered by wnck, it offers all information about the
screen/display/window I need, except for this little detail :-(

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

This is a company that looks the world's roughest, toughest anti-trust
regulators in the eye and laughs. Compared to anti-trust people,
copyright lawmakers are pantywaists. You can take them with your arm
behind your back.
 -- Cory Doctorow, Microsoft Research DRM talk


pgpRoyWjIKN1P.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] WNCK question

2006-05-23 Thread Magnus Therning
On Mon, May 22, 2006 at 08:17:55PM +0200, Matthias Bläsing wrote:
>Am Montag, den 22.05.2006, 18:04 +0100 schrieb Magnus Therning:
>> [Problem with wnck not updating without gtk.main]
>> 
>> Hmm, that's a bit irritating. I was hoping to be able to call
>> gtk.main_iteration(0) to trigger that update to be done, but it doesn't
>> seem to work:
>
>> I'm looking to writing a command line tool that does some window
>> manipulation, based on command line arguments, and then exits. Is there
>> a way around having to call gtk.main()?
>
>how about:
>
>import wnck
>import gtk
>scr = wnck.screen_get_default()
>while gtk.events_pending():
>   gtk.main_iteration()
>scr.get_windows()

Works like a charm.

wnck is a strange beast indeed! It seems that after "emptying the event
queue" that way 'scr' is properly updated and all 'get_*()' work fine.

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

n


pgppIxYMfMdRX.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] WNCK question

2006-05-22 Thread Magnus Therning
On Thu, Apr 20, 2006 at 11:01:55AM +0100, Gustavo J. A. M. Carneiro wrote:
>On Qua, 2006-04-19 at 20:56 +0200, Danny Milosavljevic wrote:
>> Hi,
>> 
>> Am Dienstag, den 18.04.2006, 23:13 +0100 schrieb Magnus Therning:
>> > After discovering wmctrl and EWMH I decided to play around a little with
>> > wnck. Of course I'd like to do it in Python. However I'm having some
>> > problems to get started. I entered the following in ipython running in
>> > a gnome-terminal:
>> > 
>> >  In [1]: import wnck
>> > 
>> >  In [2]: scr = wnck.screen_get_default()
>> > 
>> >  In [3]: scr
>> >  Out[3]: 
>> > 
>> >  In [4]: scr.get_windows()
>> >  Out[4]: []
>> > 
>> >  In [5]: scr.get_active_window()
>> > 
>> >  In [6]: scr.get_windows_stacked()
>> >  Out[6]: []
>> > 
>> >  In [7]: scr.get_workspace_count()
>> >  Out[7]: 0
>> > 
>> > The results are a little surprising to me. I was expecting to find some
>> > windows on the current screen, and I have 8 workspaces. Am I missing
>> > something here?
>> > 
>> > I have only managed to find the reference docs for libwnck. The only
>> > program I know uses it is devilspie, but it's not exactly ideal for
>> > jumpstarting my plying with wnck...
>> > 
>> > /M
>> 
>> We, the Xfce Project, have an old fork of wnck (called netk now), and
>> there it didn't update the window list until some idle callback of it
>> had been called by the main loop (i.e. the main loop was already
>> running!)
>> 
>> I patched that by now, but I guess the original wnck still has the
>> problem :)

Hmm, that's a bit irritating. I was hoping to be able to call
gtk.main_iteration(0) to trigger that update to be done, but it doesn't
seem to work:

 >>> import wnck
 >>> scr = wnck.screen_get_default()
 >>> scr.get_windows()
 []
 >>> import gtk
 >>> for x in range(100): gtk.main_iteration(0)
 ...
 >>> scr.get_windows()
 []
 >>> gtk.main()
 Traceback (most recent call last):
   File "", line 1, in ?
 KeyboardInterrupt
 >>> scr.get_windows()
 [,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ]

I'm looking to writing a command line tool that does some window
manipulation, based on command line arguments, and then exits. Is there
a way around having to call gtk.main()?

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Here's the social reason that DRM fails: keeping an honest user honest
is like keeping a tall user tall.
 -- Cory Doctorow, Microsoft Research DRM talk


pgpU7TKRSNaBe.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] WNCK question

2006-04-18 Thread Magnus Therning
After discovering wmctrl and EWMH I decided to play around a little with
wnck. Of course I'd like to do it in Python. However I'm having some
problems to get started. I entered the following in ipython running in
a gnome-terminal:

 In [1]: import wnck

 In [2]: scr = wnck.screen_get_default()

 In [3]: scr
 Out[3]: 

 In [4]: scr.get_windows()
 Out[4]: []

 In [5]: scr.get_active_window()

 In [6]: scr.get_windows_stacked()
 Out[6]: []

 In [7]: scr.get_workspace_count()
 Out[7]: 0

The results are a little surprising to me. I was expecting to find some
windows on the current screen, and I have 8 workspaces. Am I missing
something here?

I have only managed to find the reference docs for libwnck. The only
program I know uses it is devilspie, but it's not exactly ideal for
jumpstarting my plying with wnck...

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

As we enjoy great advantages from the inventions of others we should
be glad of an opportunity to serve others by any invention of
ours, and this we should do freely and generously.
 -- Benjamin Franklin


pgp6aELNzWkHS.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] running gtk from crontab

2005-12-07 Thread Magnus Therning
On Wed, Dec 07, 2005 at 02:26:00PM +0200, Nikos Kouremenos wrote:
>On 12/7/05, Loris Caren <[EMAIL PROTECTED]> wrote:
>> Does anybody know if it is possible to run (py)gtk scripts that don't
>> need a GUI from crontab or from a non X11 terminal? This might seem a
>> daft requirement, but I'm using the pygtk image processing
>> capabilities to do some batch processing for images that I don't need
>> to display.
>
>if you import gtk in a non X11 terminal it raises

Could xvfb be a solution. It's used quite a bit in the Java community.

 http://www.javasource.org/GifServlet/linux.html

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Finagle's Second Law:
Always keep a record of data -- it indicates you've been working.


pgp9ywFCXPksG.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] gconf reference

2005-09-20 Thread Magnus Therning
On Mon, Sep 19, 2005 at 10:32:38PM +0300, Daniel Brodie wrote:
>Is there a reference online somewhere for gnome-python, but more
>specifically gconf? I have been trying to use the C documentation, but
>I found some things which don't match up 100% (obvioussly) and I would
>prefer reading up on the api rather then trial and error.

Not very deep, but it got me as far as I needed this time around.

 http://therning.org/magnus/archives/57

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

In cyberspace everyone will be anonymous for 15 minutes.
  -- Graham Greenleaf


pgp7WS67v4HJU.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] gtk or gtk2?

2005-09-04 Thread Magnus Therning
On Sun, Sep 04, 2005 at 03:44:34PM -0500, nephish wrote:
>Gian Mario Tagliaretti wrote:
[..]
>thanks guys.
>my only hesitation was that it seemed more complicated.
>gtk2 it be.

Hmm, by choosing Python with GTK2 you are already avoiding quite a bit
of complexity (or rather distracting details that OO in C forces you
to). If you look into using a GUI builder, e.g. glade, then it becomes
easier still.

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

For the computer security community, the moral is obvious: if you are
designing a system whose functions include providing evidence, it had
better be able to withstand hostile review.
  -- Ross Anderson


pgp07Byn18ywU.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] gtk or gtk2?

2005-09-04 Thread Magnus Therning
On Sun, Sep 04, 2005 at 03:25:35PM -0500, nephish wrote:
>Hey there,
>
>i am looking to build an app for work that could get kinda big.  before
>i get too far along in this, what are some of the advantages of gtk2 or
>gtk to each other.
>i want to build this primarily for gnome, but needs to work in fluxbox
>also.  no need to port to win or mac.
>
>what are some of the differences between them?

AFAIK the main difference is that gtk2 is being actively developed,
enhanced and maintained while gtk isn't receiving much attention at all.

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Software engineering? That's like military intelligence, isn't it?


pgpnc8FZIs9AQ.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Docs Request: Showing inherited methods

2005-08-24 Thread Magnus Therning
On Wed, Aug 24, 2005 at 06:58:49PM +0200, Filip Van Raemdonck wrote:
>On Wed, Aug 24, 2005 at 05:27:55PM +0100, Jono Bacon wrote:
>> 
>> Something I find really frustrating with PyGTK is that when I look at
>> the docs for, as an example, the Button class, it does not show all
>> of the methods that have been inherited from the base classes.
>
>But it does include the inheritance tree, which means it should be easy
>enough to browse the parent classes to find out if required
>functionality is there...
>
>> Is there any chance of this feature making it into the documentation?
>> It would be *really* useful. :)
>
>IMHO it would clutter the documentation for inherited classes too much,
>nearly all of the time, especially as just about any widget ultimately
>inherits from gtk.Widget which has a rather large number of methods to
>begin with.
>
>I guess it /could/ show a simple list of inherited methods and not the
>full documentation for all of these (perhaps you meant this to begin
>with?), but then again, even such list would usually be fairly long seeing
>the gtk.Widget inheritance.

Yes, full documentation of all inherited methods in each class would
clutter, but a simple list of all methods is all that's needed (since
most methods have good names). I think Qt has done a good job in this
respect. E.g. http://doc.trolltech.com/4.0/qcheckbox.html

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

I have not had the time to search the patent literature
systematically; indeed, I decry the current tendency to seek patents
on algorithms. If somebody sends me a copy of a relevant patent not
presently cited in this book, I will dutifully refer to it in future
editions. However, I want to encourage people to continue the
centuries-old mathematical tradition of putting newly discovered
algorithms into the public domain. There are better ways to earn a
living than to prevent other people from making use of one's
contributions to computer science.
 -- Donald E. Knuth. The Art of Computer Programming.  Volume III. 2nd
 Edition. Preface. p vi.


pgpKwUohgcrIL.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] pyorbit in python 2.4

2005-08-23 Thread Magnus Therning
On Tue, Aug 23, 2005 at 01:54:44PM -0700, George Finklang wrote:
>
>I'm doing CORBA work with python 2.4, and would like to use pyOrbit.  
>Unfortunately, pyorbit seems to support only older python versions.  Is this 
>true?  Is there anybody else interested in making a pyOrbit compatible with 
>python 2.4?
>
>The specific error I'm getting now seems to be related to incompatibility in 
>the keyword module, but there are likely others.

Unrelated... I don't know what level you are at regarding PyOrbit but
maybe you'd like to contribute to my attempt at rewriting the Orbit
Beginners Docmentation[1] for PyOrbit. Take a look at
http://therning.org/magnus/computer/pyorbit/ for more info.

I'd be interested in adding Python examples that reach beyond what's in
the C version as well...

/M

1. http://www.gnome.org/projects/ORBit2/orbit-docs/orbit/index.html

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Anyone who creates his or her own cryptographic primitive is either a
genius or a fool. Given the genius/fool ratio for our species, the
odds aren't very good.
 -- Bruce Schneier, Secrets and Lies


pgpGFYDBZzvdW.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] KeySafe

2005-07-15 Thread Magnus Therning
I've written a small tool using Gnome-Python for keeping passwords for
web pages close by, but (hopefully) still secure.

http://gnomefiles.org/app.php?soft_id=986

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Documentation is like sex: when it is good, it is very, very good; and when
it's bad, it is better than nothing.
 -- Dick Brandon


pgp2SpKegA6rm.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Signal emitted when a row in TreeView is selected?

2005-05-15 Thread Magnus Therning
On Sun, May 15, 2005 at 06:58:46PM -0300, Christian Robottom Reis wrote:
>On Sun, May 15, 2005 at 12:01:39PM -0700, David M. Cook wrote:
>> On Sun, May 15, 2005 at 04:23:37PM +0100, Magnus Therning wrote:
>> > I can't seem to find what signal will be emitted when a row in a
>> > TreeView (with ListStore) is selected. I've tried the following signals:
>> 
>> You connect to the TreeView's selected object's "changed" signal, then in
>> your call back you check for what actually is selected.  Assuming multiple
>> selection mode:
>> 
>> treeview.get_selection().connect("changed", self.on_selection_changed, ...)
>> ...
>> def on_selection_changed(selection, ...):
>> model, paths = selection.get_selected_rows()
>> if paths:
>>   ...
>>   
>> I'm sure this is in the FAQ somewhere.
>
>Yeah, at 
>
>http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq13.011.htp
>
>I've improved the stub example there.

I would have expected to find it in the tutorial as well though. Section
14.8 on TreeSelections.

Oh, BTW I've added the FAQ to my bookmarks now :)

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://magnus.therning.org/

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

  The point of academic attacks is not exhibiting practical breaks;
the point is that only a trained cryptographer can tell whether a
given algorithm is secure or not. The author of an algorithm says: "My
cipher is secure, and trust me, I am an expert at this. And to prove
that I am a real good expert, I challenge other experts to find even
the most impractical, academic flaw in my cipher".
  Just like glue. Commercial ads state that the foobar glue can stick
an elephant to the ceiling. Who needs to stick an elephant to the
ceiling? But if it can do that, people will trust its sticking
strength.
  -- Thomas Pornin, sci.crypt


pgpf0CsUqC8VY.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Signal emitted when a row in TreeView is selected?

2005-05-15 Thread Magnus Therning
On Sun, May 15, 2005 at 07:44:55PM -0300, Christian Robottom Reis wrote:
>On Sun, May 15, 2005 at 11:38:36PM +0100, Magnus Therning wrote:
>> >treeview.get_selection().connect("changed", self.on_selection_changed, ...)
>>
>[...]
>> 
>>I was looking for a "selection_changed" or "changed" signal for
>>TreeView, but didn't find any!
>
>Note the get_selection(). The signal is on the selection instance itself.

Ah. cool. I really should start reading mails a bit more carefully, huh?
;-)

That did the trick!

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://magnus.therning.org/

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Feistel and Coppersmith rule. Sixteen rounds and one hell of an
avalanche.
  -- Stephan Eisvogel in de.comp.security


pgp64loFI1qxI.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Signal emitted when a row in TreeView is selected?

2005-05-15 Thread Magnus Therning
On Sun, May 15, 2005 at 12:01:39PM -0700, David M. Cook wrote:
>On Sun, May 15, 2005 at 04:23:37PM +0100, Magnus Therning wrote:
>> I can't seem to find what signal will be emitted when a row in a
>> TreeView (with ListStore) is selected. I've tried the following
>> signals:
>
>You connect to the TreeView's selected object's "changed" signal, then
>in your call back you check for what actually is selected.  Assuming
>multiple selection mode:
>
>treeview.get_selection().connect("changed", self.on_selection_changed, ...)
>...
>def on_selection_changed(selection, ...):
>model, paths = selection.get_selected_rows()
>if paths:
>  ...

I was looking for a "selection_changed" or "changed" signal for
TreeView, but didn't find any!

What version are you using?

This is what I have here:

ii  python-gtk22.6.1-0ubuntu2 Python bindings for the GTK+ widget set
ii  python2.4-gtk2 2.6.1-0ubuntu2 Python bindings for the GTK+ widget set

>I'm sure this is in the FAQ somewhere.

I've been spending quite some time looking for it, it's well hidden if
it's in there :(

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://magnus.therning.org/

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Am I being overly harsh or do others think that the multi-thousand bit
key is about sowing fear, uncertainty, and doubt for commercial gain?
DES? Not big enough! Triple DES? Not big enough! IDEA? Not big enough!
What you need is Dr.  Phineas P. Snakeoil's mystery elixir! Filled
with matrices and Galois fields to improve the digestion of dyspeptic
managers everywhere! Step right up and get a whole case full! Don't
ask what's inside ladies and gentlemen! It's a patent medicine that is
only available here.
  -- Stephen M. Gardner


pgpbGYAXmZxgL.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Signal emitted when a row in TreeView is selected?

2005-05-15 Thread Magnus Therning
On Sun, May 15, 2005 at 06:50:19PM +0300, Nikos Kouremenos wrote:
>On 5/15/05, Magnus Therning <[EMAIL PROTECTED]> wrote:
>> I can't seem to find what signal will be emitted when a row in a
>> TreeView (with ListStore) is selected. I've tried the following
>> signals:
>> 
>>  move-cursor
>not sure what it does

Emitted when the cursor moves. Note that the cursor isn't the same as
the selected item at all times. By holding Ctrl down and using the arrow
keys you ca move the cursor without moving the selection.

>>  select-cursor-row
>not sure what it does
>>  toggle-cursor-row
>not sure what it does
>>  row-activated
>this is when you double click the row
>
>> None of these is the one I need, and the tutorial doesn't offer much
>> help either.
>> 
>This is how we do it:
>   def on_services_treeview_cursor_changed(self, widget):
>   '''When we select a row :
>   activate buttons if needed'''
>   model, iter = 
> self.services_treeview.get_selection().get_selected()
>   if not iter: return
>   jid = model.get_value(iter, 1)
>       node = model.get_value(iter, 2)

The signal "cursor-changed" seems to behave similar to "move-cursor".
So, that one doesn't do it either :(

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://magnus.therning.org/

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

"Sendmail" and "make" are two well known programs that are pretty widely
regarded as being debugged into existence. That's why their command
languages are so poorly thought out and difficult to learn.  It's not
just you -- everyone finds them troublesome.
 -- Peter van der Linden, Expert C Programming, p. 220


pgpqJZ3wGQPU1.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] Signal emitted when a row in TreeView is selected?

2005-05-15 Thread Magnus Therning
I can't seem to find what signal will be emitted when a row in a
TreeView (with ListStore) is selected. I've tried the following signals:

 move-cursor
 select-cursor-row
 toggle-cursor-row
 row-activated

None of these is the one I need, and the tutorial doesn't offer much
help either.

All help is appreciated...

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://magnus.therning.org/

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

The wire protocol guys don't worry about security because that's
really a network protocol problem. The network protocol guys don't
worry about it because, really, it's an application problem. The
application guys don't worry about it because, after all, they can
just use the IP address and trust the network.
  -- Marcus J. Ranum


pgpgexsTyFEMq.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] Reading the mouse position

2005-05-09 Thread Magnus Therning
Is there a way of reading the position of the pointer using PyGTK?

I just want to read the mouse position at the start of the program and
use the result to guide the initial placement of the main window. So
motion-notify-event is a bit overkill.

Any pointers?

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://magnus.therning.org/

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Simple, clear purpose and principles give rise to complex and intelligent
behavior. Complex rules and regulations give rise to simple and stupid
behavior.
 -- Dee Hock


signature.asc
Description: Digital signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] [Possibly off-topic] Python bindings for Evolution?

2005-01-08 Thread Magnus Therning
Evolution seems to be separated into a client and a server by now, and
there are two client libraries available (libecal and libebook so far).
I haven't been able to find any Python bindings for these libraries.
Have I been searching in the wrong places or aren't there any?

Maybe someone is working on it?

Or am I just being stupid? Maybe there's some other way of talking to
evolution-data-server (CORBA/GNORBA or something)?

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://magnus.therning.org/

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

My hovercraft is full of eels.
 -- Monty Python


signature.asc
Description: Digital signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] PyORBit examples page

2004-08-03 Thread Magnus Therning
I've almost finished my "translation" to Python of the examples in the
ORBit Beginners Documentation (v1.6)[1]. The last one is the
multi-threaded calculator and I am not too sure how useful it'll be to
do (except for my learning :-) so I've left it for now.

I would very much like to have some feedback on it all, suggestions for
improvement are especially welcome.

Also someone sent me a private email offering some help. Unfortunately I
lost the email (I have been known to do some aggressive cleaning of my
inbox at times), I'd love it if you contacted me again.

You can find the page here:
 http://magnus.therning.org/pyorbit_beg_exs.html

These are some of the things I've been pondering, any answers/comments
are welcome:

 1. I had a practical problem with putting Python code on a web page (<>
got lost) and I went looking for a py2html pretty printer that
didn't create outrageous stuff (basically I want something rather
low-key, and preferably not full html pages with body-tags and all
but rather output that can be included. I found nothing and swapped
to texinfo for the moment. Anyone with a solution to the problem?

 2. (This relates to the NameResolve example) I couldn't get
CORBA.ORB_init() to accept sys.argv (and hence I couldn't register a
name-service with -ORBInitRef NameService=IOR:... on the command
line. I probably made some trivial mistake. Any pointers?

 3. (This relates to the Factory example) With interfaces like this:

 module M {
  interface IA { .. };
  interface IB { IA createA(); };
 };

and Python classes like this:

 class myIA(M__POA):
  ...

 class myIB(M__POA):
  ...

then myIB.createA() can't be naively implemented like this:

 def createA(self):
  return myIA()

 but has to
  1. create, and keep an instance of myIA alive
  2. return that instance's _this()

 Why is it like this? (I guess it has its positive sides to not have
 the CORBA server-side representation of an object keep the instance
 alive, but I can't quite see them.)

 Anyone with an idea of how to kill the server-side Python instance
 immediately? (I currently simply remove it from the list (the list
 is the way I keep the objects alive in the first place) and garbage
 collection will get around to them, can I make sure it happens
 sooner?)

Well, that's it for now. Looking forward to being flooded with responses
;)

/M

1. http://www.gnome.org/projects/ORBit2/orbit-docs/orbit/index.html

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://magnus.therning.org/

Time is an illusion. Lunchtime doubly so.
 -- Douglas Adams


signature.asc
Description: Digital signature
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] PyORBit documentation

2004-07-19 Thread Magnus Therning
On Mon, Jul 19, 2004 at 12:21:37PM -0300, Christian Robottom Reis wrote:
>On Sun, Jul 18, 2004 at 11:51:29PM +0200, Magnus Therning wrote:
>> I hope I'm not misinformed but this is the list where PyORBit is
>> discussed, isn't it?
>
>Yes, but it's not discussed a lot. It seems that not many people are
>using PyORBit -- I could be wrong, but it doesn't seem to get a lot of
>attention. Maybe it works so well nobody's complaining .

Yes, either might be the answer. I just found it really strange that
ORBit2 has some basic documentation for C but not for Python. The Python
binding really lets you get straight to the interesting part and a lot
of the details are nicely hidden away. It's a shame if people who look
at ORBit2 only they see is (documentation of) the C binding, I bet
that'll scare some people off.

>> I made an attempt[1] to "translate" the examples in ORBit Beginners
>> Documentation[2] from C to Python. It's still not very far along. I'd
>> love to get some comments on it (especially on the exception
>> handling, they spend a whole lot of code on it in the C code but I
>> have skipped it altogether).
>
>That's great! If you want, wrap that up a bit and we can have it put up
>on a website -- pygtk.org is fine but perhaps there is somewhere else
>more suitable.

I'll post on here when I get it more complete. Then we can see where it
might be nice to put it.

As I mentioned I'd be more than happy to accept contributions ;-)

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://magnus.therning.org/

$my_args = shift;
system("gcc $my_args");
print "I prefer C\n";
 -- Robert Dieterich's contribution to the 2004 Perl Haiku Contest,
Haikus in Perl - 'Dishonerable Mention' winner


signature.asc
Description: Digital signature
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] PyORBit documentation

2004-07-18 Thread Magnus Therning
I hope I'm not misinformed but this is the list where PyORBit is
discussed, isn't it?

I have spent a bit of time trying to understand how to use ORBit2 from
Python using PyORBit. However, I haven't been able to find much in the
form of documentation by searching on Google. Most of what I've found is
on Bonobo+Python, and it looks like that particular combination hides
quite a few of the CORBA details from the programmer. That's a good
thing if one want to make Bonobo objects but not if one is more
interested in "bare-bone" CORBA. To add to the problems it isn't always
possible to copy examples that use the OMG Python binding since PyORBit
deviates slightly from it :-(

Does anyone know any good documentation (besides the source)?

I made an attempt[1] to "translate" the examples in ORBit Beginners
Documentation[2] from C to Python. It's still not very far along. I'd
love to get some comments on it (especially on the exception handling,
they spend a whole lot of code on it in the C code but I have skipped it
altogether).

/M

1. http://magnus.therning.org/pyorbit_beg_exs.html
2. http://www.gnome.org/projects/ORBit2/orbit-docs/orbit/index.html

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED]
http://magnus.therning.org/

As it is used, with the average user not bothering to verify the
certificates exchanged and no revocation mechanism, SSL is just simply a
(very slow) Diffie-Hellman key-exchange method. Digital certificates
provide no actual security for electronic commerce; it's a complete sham.
 -- Bruce Schneier, Secrets and Lies


signature.asc
Description: Digital signature
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/