This commit is contained in:
Stephen Dranger 2011-02-14 11:39:26 -06:00
parent 7faa2c5b04
commit f6a2ba4c1d
8 changed files with 14 additions and 3 deletions

Binary file not shown.

2
irc.py
View file

@ -19,7 +19,7 @@ class PesterIRC(QtCore.QObject):
def IRCConnect(self):
server = self.config.server()
port = self.config.port()
self.cli = IRCClient(PesterHandler, host=server, port=int(port), nick=self.mainwindow.profile().handle, blocking=True)
self.cli = IRCClient(PesterHandler, host=server, port=int(port), nick=self.mainwindow.profile().handle, real_name='pcc30', blocking=True)
self.cli.command_handler.parent = self
self.cli.command_handler.mainwindow = self.mainwindow
self.conn = self.cli.connect()

BIN
irc.pyc

Binary file not shown.

View file

@ -88,6 +88,7 @@ class IRCClient:
self.port = None
self.connect_cb = None
self.blocking = False
self.timeout = None
self.__dict__.update(kwargs)
self.command_handler = cmd_handler(self)
@ -136,12 +137,16 @@ class IRCClient:
... g.next()
"""
from datetime import *
#logfile = open('irctest.log', 'a')
try:
logging.info('connecting to %s:%s' % (self.host, self.port))
self.socket.connect(("%s" % self.host, self.port))
if not self.blocking:
self.socket.setblocking(0)
#if self.timeout:
# self.socket.settimeout(self.timeout)
helpers.nick(self, self.nick)
helpers.user(self, self.nick, self.real_name)
@ -151,7 +156,10 @@ class IRCClient:
buffer = bytes()
while not self._end:
try:
#logfile.write("recv at %s\n" % datetime.now().strftime("%Y-%m-%d.%H.%M %S"))
buffer += self.socket.recv(1024)
#logfile.write("recvd %s at %s\n" % (buffer, datetime.now().strftime("%Y-%m-%d.%H.%M %S")))
#logfile.flush()
except socket.error, e:
try: # a little dance of compatibility to get the errno
errno = e.errno

Binary file not shown.

View file

@ -76,7 +76,7 @@ def quit(cli, msg='gone'):
cli._end = 1
def user(cli, username, realname=None):
cli.send("USER", username, cli.host, cli.host,
cli.send("USER", realname or username, cli.host, cli.host,
realname or username)
_simple = (

Binary file not shown.

View file

@ -1841,6 +1841,9 @@ class MainProgram(QtCore.QObject):
self.connect(self.ircapp, QtCore.SIGNAL('finished()'),
self, QtCore.SLOT('restartIRC()'))
self.ircapp.start()
self.widget.loadingscreen = LoadingScreen(self.widget)
self.connect(self.widget.loadingscreen, QtCore.SIGNAL('rejected()'),
self.widget, QtCore.SLOT('close()'))
status = self.widget.loadingscreen.exec_()
if status == QtGui.QDialog.Rejected:
sys.exit(0)