Anonymous avatar Anonymous committed ba4088d

Version 0.2.2.

Comments (0)

Files changed (4)

+2000-09-26  Joel Rosdahl  <joel@rosdahl.net>
+
+	* Released version 0.2.2.
+
+	* irclib.py (ServerConnection.user): Fixed erroneous format
+	string.
+
 2000-09-24  Joel Rosdahl  <joel@rosdahl.net>
 
 	* Released version 0.2.1.
 
 irc = irclib.IRC()
 try:
-    c = irc.server().connect(server, port, nickname, nickname, nickname)
+    c = irc.server().connect(server, port, nickname)
 except irclib.ServerConnectionError, x:
     print x
     sys.exit(1)
 
 This library is intended to encapsulate the IRC protocol at a quite
 low level.  Clients are written by registering callbacks (i.e. not by
-inheriting a class), to make it able to use different programming
-paradigms easily.  (It should be quite easy to write an
-object-oriented wrapper for one server connection, for example.)
+inheriting a class), to make it easy to use different programming
+paradigms.  (It should be quite easy to write an object-oriented
+wrapper for one server connection, for example.)
 
 The class hierarchy is inspired by the Perl IRC module (Net::IRC).
 
 import time
 import types
 
-VERSION = 0, 2, 1
+VERSION = 0, 2, 2
 DEBUG = 0
 
 # TODO
         Connection.__init__(self, irclibobj)
         self.connected = 0  # Not connected yet.
 
-    def connect(self, server, port, nickname, username, ircname, password=None):
+    def connect(self, server, port, nickname, password=None, username=None, ircname=None):
         """(Re)connect to a server.
 
         This function can be called to reconnect a closed connection.
         self.server = server
         self.port = port
         self.nickname = nickname
-        self.username = username
-        self.ircname = ircname
+        self.username = username or nickname
+        self.ircname = ircname or nickname
         self.password = password
         self.localhost = socket.gethostname()
         self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         self.send_raw("TRACE" + (target and (" " + target)))
 
     def user(self, username, localhost, server, ircname):
-        self.send_raw("USER %s * * :%s" % (username, localhost, server, ircname))
+        self.send_raw("USER %s %s %s :%s" % (username, localhost, server, ircname))
 
     def userhost(self, nicks):
         self.send_raw("USERHOST " + string.join(nicks, ","))
 sys.stdout.write("Connecting to server...")
 sys.stdout.flush()
 try:
-    c = irc.server().connect(server, port, nickname, nickname, nickname)
+    c = irc.server().connect(server, port, nickname)
 except irclib.ServerConnectionError, x:
     print x
     sys.exit(1)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.