PyIRC

2 views
Skip to first unread message

Vishal

unread,
Apr 30, 2008, 12:17:31 PM4/30/08
to py-transports
Hello All

Has anybody got PyIRC working on windows environment? Am tring to
integate irc-transport-0.4 and am not able to get it working and would
request help on this.

Running jabber on win environment. pymsnt and pyaimt are working
fine.

xmpppy and irclib have dumped in the PYirc root folder. Is this
correct or i need to put this in the python directory? or do i need to
put them in Lib\site-packages folder of python?

I initiate irc.py but nothing happens. the pid file is not created.

following is my config.xml file


<?xml version="1.0" ?>
<pyirct>
<!-- This file contains options to be configured by the server
administrator. -->
<!-- Please read through all the options in this file -->

<!-- The JabberID of the transport -->
<jid>irc.domain.com</jid>

<!-- The component JID of the transport. Unless you're doing
clustering, leave this alone -->
<!-- <compjid>irc1</compjid> -->

<!-- The public IP or DNS name of the machine the transport is
running on -->
<!-- This is used to select the outgoing IP address used to
connect to IRC networks -->
<!-- otherwise known as the vanity address, it's safe to leave it
commented -->
<host>domain.com</host>

<!-- The name of the transport in the service discovery list. -->
<!-- <discoName>IRC Transport</discoName> -->

<!-- The location of the spool file.. if relative, relative to the
PyIRCt dir. -->
<!-- Include the jid of the transport, if running multiple copies
of the same transport -->
<spoolFile>ircuser.dbm</spoolFile>

<!-- The location of the PID file, relative to the PyIRCt
directory -->
<!-- Comment out if you do not want a PID file -->
<pid>PyIRCt.pid</pid>

<!-- The IP address or DNS name of the main Jabber server -->
<mainServer>domain.com</mainServer>

<!-- The JID of the main Jabber server -->
<mainServerJID>domain.com</mainServerJID>

<!-- The TCP port to connect to the Jabber server on (this is the
default for Jabberd2) -->
<port>5347</port>

<!-- The authentication token to use when connecting to the Jabber
server -->
<secret>XXXX</secret>

<!-- SASL username used to bind to Jabber server. -->
<!-- secret, above, is used for sasl password -->
<saslUsername>XXXX</saslUsername>

<!-- Allow users to register with this transport -->
<allowRegister/>

<!-- Require users to be registered before allowing them to join a
room -->
<!-- <requireRegister/> -->

<!-- Send activity messages to users (for clients that don't
support MUC) -->
<activityMessages/>

<!-- Use external component binding. -->
<!-- This dodges the need to manually configure all jids that talk
to this transport. -->
<!-- Jabberd2 requires saslUsername and useRouteWrap for this to
work. -->
<!-- Wildfire as of 2.6.0 requires just this. -->
<useComponentBinding/>

<!-- Wrap stanzas in <route> stanza. -->
<!-- Jabberd2 requires this for useComponentBinding. -->
<useRouteWrap/>

<!-- You can choose which users you wish to have as
administrators. These users can perform some tasks with Ad-Hoc
commands that others cannot -->
<!--<admins>
<jid>ad...@domain.com</jid>
</admins>-->

<!-- The file to log to. Leave this disabled for stdout only -->
<debugFile>ircerror.log</debugFile>

<!-- Show the raw data being sent and received from the xmpp and
irc servers -->
<!--<dumpProtocol/>-->

<!-- The default charset to use for the transport, if not supplied
by the user when registering -->
<!--<charset>utf-8</charset>-->

</pyirct>

Regards
Vishal

Norman Rasmussen

unread,
Apr 30, 2008, 1:59:52 PM4/30/08
to py-tra...@googlegroups.com
On Wed, Apr 30, 2008 at 6:17 PM, Vishal <sms...@gmail.com> wrote:
Has anybody got PyIRC working on windows environment? Am tring to
integate irc-transport-0.4 and am not able to get it working and would
request help on this.

Running jabber on win environment. pymsnt and pyaimt are working
fine.

xmpppy and irclib have dumped in the PYirc root folder. Is this
correct or i need to put this in the python directory? or do i need to
put them in Lib\site-packages folder of python?

I initiate irc.py but nothing happens. the pid file is not created.

following is my config.xml file

The transport is developed on windows, so it should work without any problems.  What server are you using, the setting you have are set for jabberd2, and will not work for Openfire (if you're using Openfire, then disable useRouteWrap)

Otherwise please enable dumpProtocol and share the output.

--
- Norman Rasmussen
- Email: nor...@rasmussen.co.za
- Home page: http://norman.rasmussen.co.za/

Vishal

unread,
May 1, 2008, 7:14:02 AM5/1/08
to py-transports
Hi Norman

Thanks for your reply. Am using jabberd2. I enable dumpProtocol but no
error log files are created and neither is PID file created.

IRC doesnt connect at all. am intiating Pyirc-0.4\irc.py

In the Pyirc-0.4 folder have loaded 2 more folders...irclib and
xmpppy. Is this correct or i need to put this in the python directory
viz Lib\site-packages folder of python?

Kindly let me know.

Regards
Vishal

Norman Rasmussen

unread,
May 1, 2008, 7:43:34 AM5/1/08
to py-tra...@googlegroups.com
On Thu, May 1, 2008 at 1:14 PM, Vishal <sms...@gmail.com> wrote:
Thanks for your reply. Am using jabberd2. I enable dumpProtocol but no
error log files are created and neither is PID file created.
IRC doesnt connect at all. am intiating Pyirc-0.4\irc.py

you may have to `cd pyirc-0.4;irc.py`.  irc.py will look for a config.xml in the current working directory.

Also try and run at a command prompt: `python irc.py`.  I'm guessing that windows might be running pythonw which would not show and debug information.
 
In the Pyirc-0.4 folder have loaded 2 more folders...irclib and
xmpppy. Is this correct or i need to put this in the python directory
viz Lib\site-packages folder of python?

yes that's fine.  You can have these modules either as a subfolder of pyirc-0.4 or installed into site-packages. (they're named irclib and xmpp right?  so pyirc-0.4\irclib.py and pyirc-0.4\xmpp\client.py should be the file names).

Vishal

unread,
May 1, 2008, 10:09:35 AM5/1/08
to py-transports
Hi Norman

Thanks for your help on this.

you may have to `cd pyirc-0.4;irc.py`. irc.py will look for a
config.xml in the current working directory.

doing that excatly as you have mentioned

Also try and run at a command prompt: `python irc.py`. I'm guessing
that
windows might be running pythonw which would not show and debug
information.

Previously i was doing

Directory=c:\Pyirc-0.4
CommandLine=c:\Pyirc-0.4\irc.py

now i changed to

Directory=c:\Pyirc-0.4
CommandLine=c:\Pyirc-0.4\python irc.py

is this the way you want it? or you want the following:

Directory=c:\Pyirc-0.4
CommandLine=c:\python23\python main.py
CommandLine=c:\Pyirc-0.4\irc.py

yes that's fine. You can have these modules either as a subfolder of
pyirc-0.4 or installed into site-packages. (they're named irclib and
xmpp
right? so pyirc-0.4\irclib.py and pyirc-0.4\xmpp\client.py should be
the
file names).

my files were pyirc-0.4\irclib\irclib.py and pyirc-0.4\xmpppy\xmpp
\client.py have put the irclib in the root folder of pyirc-0.4 now.

do you want me to do this to initiate pyirc?:


Directory=c:\Pyirc-0.4
CommandLine=c:\Pyirc-0.4\python irc.py
CommandLine=c:\Pyirc-0.4\xmpppy\xmpp\client.py
CommandLine=c:\Pyirc-0.4\irclib.py

have done the above still it refuses to initiate.

Kindly help.

Regards
vishal

Norman Rasmussen

unread,
May 1, 2008, 1:38:16 PM5/1/08
to py-tra...@googlegroups.com
On Thu, May 1, 2008 at 4:09 PM, Vishal <sms...@gmail.com> wrote:
do you want me to do this to initiate pyirc?:
have done the above still it refuses to initiate.

what are you using to launch the transport?

I think you want something similar to:

Directory=c:\Pyirc-0.4
CommandLine=c:\python23\python.exe c:\Pyirc-0.4\irc.py

Have you tried just running the transport manually from the command prompt line?

Vishal

unread,
May 4, 2008, 6:02:58 AM5/4/08
to py-transports
Hi Norman

Thanks for your reply.

what are you using to launch the transport?

am using a text file/settings file to launch the transports

Have you tried just running the transport manually from the command
prompt
line?

yes..sounds stupid but am not able to launch the transport at all

Kindly let me know

Vishal

Norman Rasmussen

unread,
May 4, 2008, 3:54:22 PM5/4/08
to py-tra...@googlegroups.com
On Sun, May 4, 2008 at 12:02 PM, Vishal <sms...@gmail.com> wrote:
> what are you using to launch the transport?
am using a text file/settings file to launch the transports
 
what are you using to parse the text file and launch the process?

> Have you tried just running the transport manually from the command
> prompt line?
yes..sounds stupid but am not able to launch the transport at all

what is the output of at a command prompt:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\windows\system32> cd \Pyirc-0.4
c:\Pyirc-0.4> c:\python23\python.exe irc.py

Vishal

unread,
May 5, 2008, 7:57:24 AM5/5/08
to py-transports
Hi Norman

Thanks for your reply. I call the text/settings file from jabberd2 to
initiate. Following is the command prompt output:

==========================================================
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Documents and Settings\Administrator>cd \Pyirc-0.4

C:\Pyirc-0.4>c:\python23\python.exe irc.py
File "irc.py", line 1114
value=charset,typ='list-single',options=((x,x) for x in
charsets)),
^
SyntaxError: invalid syntax

C:\Pyirc-0.4>c:\Pyirc-0.4\irc.py
File "c:\Pyirc-0.4\irc.py", line 1114
value=charset,typ='list-single',options=((x,x) for x in
charsets)),
^
SyntaxError: invalid syntax

C:\Pyirc-0.4>
==========================================================

Regards
Vishal

Norman Rasmussen

unread,
May 5, 2008, 8:10:39 AM5/5/08
to py-tra...@googlegroups.com
On Mon, May 5, 2008 at 1:57 PM, Vishal <sms...@gmail.com> wrote:
> File "irc.py", line 1114
> value=charset,typ='list-single',options=((x,x) for x in
> charsets)),

ahh! it wants python 2.4, otherwise edit line 1114 to read:

value=charset,typ='list-single',options=[(x,x) for x in charsets]),

Vishal

unread,
May 5, 2008, 9:05:46 AM5/5/08
to py-transports
Hi Norman

Brilliant!!!!...It initiates....but following errors now

C:\Pyirc-0.4>irc.py
Could not load one of the supported DNS libraries (dnspython or
pydns). SRV reco
rds will not be queried and you may need to set custom hostname/port
for some se
rvers to be accessible.
Invalid debugflag given: always
Invalid debugflag given: nodebuilder
DEBUG:
DEBUG: Debug created for C:\Pyirc-0.4\xmpp\client.py
DEBUG: flags defined: always,nodebuilder
DEBUG: socket start Plugging <xmpp.transports.TCPsocket instance
at 0x009B
F4B8> into <xmpp.client.Component instance at 0x009BF0D0>
DEBUG: socket start Successfully connected to remote host
('domain.com',
'5347')
DEBUG: dispatcher start Plugging <xmpp.dispatcher.Dispatcher
instance at 0x009
BF8A0> into <xmpp.client.Component instance at 0x009BF0D0>
DEBUG: dispatcher info Registering namespace "unknown"
DEBUG: dispatcher info Registering protocol "unknown" as
xmpp.protocol.Protoc
ol(unknown)
DEBUG: dispatcher info Registering protocol "default" as
xmpp.protocol.Protoc
ol(unknown)
DEBUG: dispatcher info Registering namespace "http://
etherx.jabber.org/stream
s"
DEBUG: dispatcher info Registering protocol "unknown" as
xmpp.protocol.Protoc
ol(http://etherx.jabber.org/streams)
DEBUG: dispatcher info Registering protocol "default" as
xmpp.protocol.Protoc
ol(http://etherx.jabber.org/streams)
DEBUG: dispatcher info Registering namespace
"jabber:component:accept"
DEBUG: dispatcher info Registering protocol "unknown" as
xmpp.protocol.Protoc
ol(jabber:component:accept)
DEBUG: dispatcher info Registering protocol "default" as
xmpp.protocol.Protoc
ol(jabber:component:accept)
DEBUG: dispatcher info Registering protocol "iq" as
xmpp.protocol.Iq(jabber:c
omponent:accept)
DEBUG: dispatcher info Registering protocol "presence" as
xmpp.protocol.Prese
nce(jabber:component:accept)
DEBUG: dispatcher info Registering protocol "message" as
xmpp.protocol.Messag
e(jabber:component:accept)
DEBUG: dispatcher info Registering handler <bound method
Dispatcher.streamErr
orHandler of <xmpp.dispatcher.Dispatcher instance at 0x009BF8A0>> for
"error" ty
pe-> ns->(http://etherx.jabber.org/streams)
DEBUG: dispatcher warn Registering protocol "error" as
xmpp.protocol.Protocol
(http://etherx.jabber.org/streams)
DEBUG: socket sent <?xml version='1.0'?>
<stream:stream xmlns="http://jabberd.jabberstudio.org/ns/component/
1.0" to="mo
bjab.mobi" version="1.0" xmlns:stream="http://etherx.jabber.org/
streams" >
DEBUG: socket got <host-unknown/>
Traceback (most recent call last):
File "C:\Pyirc-0.4\irc.py", line 2498, in ?
if not transport.xmpp_connect():
File "C:\Pyirc-0.4\irc.py", line 2410, in xmpp_connect
connected = self.jabber.connect((config.mainServer,config.port))
File "C:\Pyirc-0.4\xmpp\client.py", line 280, in connect
CommonClient.connect(self,server=server,proxy=proxy)
File "C:\Pyirc-0.4\xmpp\client.py", line 184, in connect
if not self.Process(1): return
File "C:\Pyirc-0.4\xmpp\dispatcher.py", line 122, in Process
self.Stream.Parse(data)
File "C:\Pyirc-0.4\xmpp\simplexml.py", line 343, in starttag
self.stream_header_received(ns, name, attrs)
File "C:\Pyirc-0.4\xmpp\dispatcher.py", line 104, in
_check_stream_start
raise ValueError('Incorrect stream start: (%s,%s). Terminating.'%
(tag,ns))
ValueError: Incorrect stream start: (host-unknown,). Terminating.

C:\Pyirc-0.4>

Regards
Vishal

Vishal

unread,
May 5, 2008, 11:33:18 AM5/5/08
to py-transports
Hi Norman

I installed pydns and its bound pefectly. Thanks a lot for your time
on this. appreciate that.

Thanks once again

Vishal

Vishal

unread,
May 6, 2008, 12:47:41 PM5/6/08
to py-transports
Hi Norman

Am still stuck here. I put the pydns folder first in the c:\Pyirc-0.4.
IRC transport showed connected but was getting the error code 406

Then i installed dnspython system wide. (C:\Python23\Lib\site-packages
the dnspython is instaslled). still the same error as follows:

error code="406"

The recipient or server understands the request but is refusing to
process it because it does not meet criteria defined by the recipient
or server.

Kinldy help.

Regards
Vishal

Norman Rasmussen

unread,
May 7, 2008, 5:25:12 AM5/7/08
to py-tra...@googlegroups.com
On Tue, May 6, 2008 at 6:47 PM, Vishal <sms...@gmail.com> wrote:
> Am still stuck here. I put the pydns folder first in the c:\Pyirc-0.4.
> IRC transport showed connected but was getting the error code 406

I'm not sure about the order of your last few messages, so just
checking: it's starting up, and binding, but if you send any stanzas
to it, it gives error 406?

Can you send some of the debug log...

Vishal

unread,
May 7, 2008, 7:13:19 AM5/7/08
to py-transports
Hi Norman

Thanks for your reply. yes its starting up and binding and shows a
connected status. when i try to register as a user on IRC transport
gives the following error on my debug log

error code="406"


The recipient or server understands the request but is refusing to
process it because it does not meet criteria defined by the recipient
or server.

Is there any other debug log which needs to be checked? Kindly let me
know

Thanks
Vishal

Norman Rasmussen

unread,
May 7, 2008, 10:43:36 AM5/7/08
to py-tra...@googlegroups.com
On Wed, May 7, 2008 at 1:13 PM, Vishal <sms...@gmail.com> wrote:
The recipient or server understands the request but is refusing to
process it because it does not meet criteria defined by the recipient
or server.
Is there any other debug log which needs to be checked? Kindly let me
know

This is because you haven't entered enough details for the transport to register successfully.  Please paste a log of the iq-set stanza that you are sending to the transport.

Vishal

unread,
May 16, 2008, 10:40:58 AM5/16/08
to py-transports
Hi Norman

That was a mistake on my side in the config xml file. I was going
through your other post on Pyirc:

"I'm using Psi. To use the irc transport you can just join a
conference room on the transport. For the room name use:#channel
%irc.server

So basically pyirc is kind of conference room right?

Thanks

Vishal

Norman Rasmussen

unread,
May 16, 2008, 11:15:19 AM5/16/08
to py-tra...@googlegroups.com
On Fri, May 16, 2008 at 4:40 PM, Vishal <sms...@gmail.com> wrote:
So basically pyirc is kind of conference room right?

Correct, it makes irc rooms, look like xmpp conference rooms.  IRC also has the concept of presence on a server though, so you can register with the transport to create a server alias, and if you add contacts, the transport will monitor their presence via the irc notify protocol (or watch if the server support it).

so basically you end up with jid's that look like:

#channel%irc.s...@irc.transport and nick%irc.s...@irc.transport (with no presence capabilities) if you haven't set up an alias via register or, #channel%al...@irc.transport and nick%al...@irc.transport (with presence capabilities) if you have set up an alias with register.

Vishal

unread,
May 16, 2008, 12:00:08 PM5/16/08
to py-transports
Hi Norman

Got it clearly now. Thanks a lot

Vishal
Reply all
Reply to author
Forward
0 new messages