Re: [Gajim-devel] Embedding Gajim

2008-10-07 Thread Yann Leboulanger
Phil Wilson wrote:
> Hi,
> 
>>> Don't hesitate to ask more info
> 
> OK then ;)
> 
> As soon as I do something like:
> 
> import gajim.idlequeue
> gajim.idlequeue = idlequeue.IdleQueue()
> 
> then the atexit code gets registered like this:
> 
> import atexit
> atexit.register(on_exit)
> 
> but I don't want this to happen. Is there another way of importing the
> idlequeue or initialising it that doesn't trigger this event? Like I
> said before, Python is reasonably new to me and I'm not totally sure I
> understand the way packages and objects are referenced.

Indeed this code is automatically done when we import gajim. if you
remove those lines, everything works fine? If so we could move that in
our code.

> I was looking to build my code on top of gajim with no modifications -
> if that turns out to be impossible due to it being too closely tied to
> the interface I'll just write my own.

We're open to change our code so it's possible for you to use our code.

-- 
Yann
___
Gajim-devel mailing list
Gajim-devel@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/gajim-devel


Re: [Gajim-devel] Embedding Gajim

2008-10-06 Thread Phil Wilson
Hi,

>> Don't hesitate to ask more info

OK then ;)

As soon as I do something like:

import gajim.idlequeue
gajim.idlequeue = idlequeue.IdleQueue()

then the atexit code gets registered like this:

import atexit
atexit.register(on_exit)

but I don't want this to happen. Is there another way of importing the
idlequeue or initialising it that doesn't trigger this event? Like I
said before, Python is reasonably new to me and I'm not totally sure I
understand the way packages and objects are referenced.

I was looking to build my code on top of gajim with no modifications -
if that turns out to be impossible due to it being too closely tied to
the interface I'll just write my own.

Cheers,

Phil Wilson
___
Gajim-devel mailing list
Gajim-devel@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/gajim-devel


Re: [Gajim-devel] Embedding Gajim

2008-09-30 Thread Phil Wilson
Thanks Yann (and sorry for the slow reply).

> To help you, you chould read src/gajim.py. It's the UI that you need to
> copy (and remove every graphical things)
>
> for idlequeue, there is a comment in this file:
> # in a nongui implementation, just call:
> # gajim.idlequeue = IdleQueue() , and
> # gajim.idlequeue.process() each foo miliseconds

I'd already started out along those lines but was finding it hard to
see what was essential (two files called gajim.py caused me some
confusion early on, but I see from the wiki that you plan to fix
this).

> You also need to parse config file (see parser variable in gajim.py)

I've so far avoided this by passing my parameters directly through to
the Connection constructor.

> You plan to create
> a client in curses or something like that?

The plan is to use the gajim library as the pubsub client backend for
a desktop tool (probably wxPython right now).

> Don't hesitate to ask more info

I've been a bit busy for the last few days, but I'll take another look
as soon as I can.

Thanks for the info,

Phil Wilson
___
Gajim-devel mailing list
Gajim-devel@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/gajim-devel


Re: [Gajim-devel] Embedding Gajim

2008-09-22 Thread Yann Leboulanger
Phil Wilson wrote:
> Hi,
> 
> I'm a somewhat novice Python hacker (though not a programming newbie).
> 
> I'm trying to embed the backend of Gajim into a console-based
> application and I'm having some trouble sorting out the module
> dependencies.
> 
> I was wondering if there was a Gajim-based version of instructions
> like these 
> http://randomthoughts.vandorp.ca/archives/2005/01/12/jabber-quickie/
> - a few lines to get me connected to my server and sending a message.
> I'm pretty sure I can do everything else from there (I actually plan
> on using the PEP and PubSub XEPs).
> 
> For example, I can get as far as
> 
> import common.i18n
> import common.configpaths
> common.configpaths.gajimpaths.init()
> common.configpaths.gajimpaths.init_profile()
> 
> import common.gajim
> from common import connection
> 
> if __name__ == "__main__":
> con = connection.Connection("accountname")
> # followed by auth etc.
> 
> but I appear to be going down a rabbit hole of imports (IdleQueue is next).
> 
> Are there any docs I've missed or otherwise help I can get?

Hi phil,

There is indeed no doc about how to do a minimalistic client using gajim
backend. But I would be happy to help you with that. You plan to create
a client in curses or something like that?

To help you, you chould read src/gajim.py. It's the UI that you need to
copy (and remove every graphical things)

for idlequeue, there is a comment in this file:
# in a nongui implementation, just call:
# gajim.idlequeue = IdleQueue() , and
# gajim.idlequeue.process() each foo miliseconds

You also need to parse config file (see parser variable in gajim.py)

Don't hesitate to ask more info
-- 
Yann
___
Gajim-devel mailing list
Gajim-devel@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/gajim-devel