--- xtalk-1.3.orig/talkd.py +++ xtalk-1.3/talkd.py @@ -20,7 +20,7 @@ # Implements the C structures for talking to a talk daemon -import struct, regex, regsub, socket, string +import struct, re, socket, string # This modules defines classes necessary to communicate with a talk # daemon. The talk daemon requires communication via binary data @@ -86,27 +86,27 @@ BADCTLADDR = 8 def htons(n): - return struct.pack('bb', n >> 8, n & 0xff) - + return struct.pack('BB', n >> 8, n & 0xff) + def htonl(n): - return struct.pack('4b', n >> 24, n >> 16, n >> 8, n & 0xff) + return struct.pack('!l', n) def htonb(n): - return struct.pack('b', n) + return struct.pack('B', n) def ntohs(n): - hi, low = struct.unpack('bb', n) + hi, low = struct.unpack('BB', n) return ((hi & 0xff) << 8) + (low & 0xff) def ntohl(n): - tmp = struct.unpack('4b', n) + tmp = struct.unpack('4B', n) return (((tmp[0] & 0xff) << 24) + ((tmp[1] & 0xff) << 16) + ((tmp[2] & 0xff) << 8) + (tmp[3] & 0xff)) def ntohb(n): - tmp = struct.unpack('b', n) + tmp = struct.unpack('B', n) return (tmp[0] & 0xff) @@ -123,18 +123,19 @@ # make sure address is in numbers-dots notation addr = socket.gethostbyname(self.address) # break it up into components - addr = regsub.split(addr, '\.') + #addr = regsub.split(addr, '\.') + addr = string.split(addr, '.') # and convert them to numbers addr = map(string.atoi, addr) return (htons(self.family) + htons(self.port) + - struct.pack('4b8x', addr[0], addr[1], addr[2], addr[3])) + struct.pack('4B8x', addr[0], addr[1], addr[2], addr[3])) def fromCStruct(self, str): self.family = ntohs(str[0:2]) self.port = ntohs(str[2:4]) - addr = struct.unpack('bbbb', str[4:8]) + addr = struct.unpack('BBBB', str[4:8]) addr = map(lambda x: x & 0xff, addr) self.address = '%d.%d.%d.%d' % (addr[0], addr[1], addr[2], addr[3]) @@ -165,9 +166,9 @@ self.addr.fromCStruct(str[8:24]) self.ctlAddr.fromCStruct(str[24:40]) self.pid = ntohl(str[40:44]) - self.localName = regsub.sub('\0*$', '', str[44:56]) - self.remoteName = regsub.sub('\0*$', '', str[56:68]) - self.remoteTTY = regsub.sub('\0*$', '', str[68:84]) + self.localName = re.sub('\0*$', '', str[44:56]) + self.remoteName = re.sub('\0*$', '', str[56:68]) + self.remoteTTY = re.sub('\0*$', '', str[68:84]) class CTL_RESPONSE: --- xtalk-1.3.orig/README +++ xtalk-1.3/README @@ -1,11 +1,11 @@ -What: X-Windows BSD compatible talk client, written in Python. +What: X Window System BSD compatible talk client, written in Python. Author: Adam P. Jenkins Requirements: Python 1.4, Tkinter package, - X-Windows. + X Window System. I suppose you could use it in Windows if Tkinter is ported to it, but xtalk also uses Unix socket calls, and I don't know if those are portable. --- xtalk-1.3.orig/Talk.py +++ xtalk-1.3/Talk.py @@ -29,7 +29,7 @@ from Tkinter import * from ScrolledText import ScrolledText -import TalkdInter, string, regex, errno +import TalkdInter, string, re, errno versionMajor = 1 versionMinor = 3 @@ -41,7 +41,7 @@ # used to raise exceptions error = 'TalkError' - def __init__(self, parent=None, addr): + def __init__(self, parent=None, addr=None): self.sock = None self.afterId = None self.servSock = None @@ -51,12 +51,12 @@ self.pack(fill=BOTH, expand=TRUE) self.makeControls() - self.makeEntry() self.makeEdits() - self.entry.var.set(addr) + self.buttons.var.set(addr) self.status = Label(self, relief=SUNKEN) self.status.pack(side=TOP, fill=X, expand=FALSE) - self.entry.address.focus() + self.buttons.address.focus() + ##### callback functions def quit(self): @@ -65,13 +65,13 @@ def connect(self, event=None): try: - address = self.parseAddress(self.entry.var.get()) + address = self.parseAddress(self.buttons.var.get()) except Talk.error, msg: self.status['text'] = msg return # Disable "connect" event handler, enable disconnect - self.entry.address.unbind('') + self.buttons.address.unbind('') self.buttons.connect.config(state=DISABLED) self.buttons.disconnect.config(state=NORMAL) @@ -103,17 +103,15 @@ command=self.disconnect, state=DISABLED) self.buttons.disconnect.pack(side=LEFT, padx=2, pady=2) - - def makeEntry(self): - self.entry = Frame(self, relief=RAISED) - self.entry.pack(side=TOP, fill=X) - self.entry.lab = Label(self.entry, text='Address') - self.entry.lab.pack(side=LEFT) - self.entry.var = StringVar() - - self.entry.address = Entry(self.entry, textvariable=self.entry.var) - self.entry.address.pack(side=LEFT, fill=X, expand=TRUE) - self.entry.address.bind('', self.connect) + + self.buttons.lab = Label(self.buttons, text='Address') + self.buttons.lab.pack(side=LEFT) + self.buttons.var = StringVar() + + self.buttons.address = Entry(self.buttons, textvariable=self.buttons.var) + self.buttons.address.pack(side=LEFT, fill=X, expand=TRUE) + self.buttons.address.bind('', self.connect) + def makeEdits(self): self.edit = Frame(self, relief=RAISED) @@ -138,14 +136,28 @@ # parses a an address as entered by a user, and returns a # tuple (remote-host, remote-user, remote-tty) or raises a # Talk.error exception if there's an error in address. - rx = regex.compile("\(^[^ \t@]+\)\(@\([^ \t@]+\)\)?\([ \t]+\(\w+\)\)?$") - if rx.match(string.strip(addr)) > 0: - ruser, rhost, rtty = rx.group(1, 3, 5) - if not rhost: - rhost = 'localhost' - if not rtty: - rtty = '' - return (rhost, ruser, rtty) + #rx = re.compile("\(^[^ \t@]+\)\(@\([^ \t@]+\)\)?\([ \t]+\(\w+\)\)?$") + ruatty = string.split(addr) + rua = ruatty[0] + if len(ruatty)>1: + rtty = ruatty[1] + else: + rtty = '' + #if rx.match(string.strip(addr)) > 0: + # ruser, rhost, rtty = rx.group(1, 3, 5) + # if not rhost: + # rhost = 'localhost' + # if not rtty: + # rtty = '' + # return (rhost, ruser, rtty) + ruh = string.split(rua, '@') + ruser = ruh[0] + if len(ruh)>1: + rhost = ruh[1] + else: + rhost = 'localhost' + if ruser: + return (rhost, ruser, rtty) else: raise Talk.error, "Bad address format given." @@ -161,11 +173,11 @@ pass self.talkd = None if self.servSock: - tkinter.deletefilehandler(self.servSock) + self.tk.deletefilehandler(self.servSock) self.servSock.close() self.servSock = None if self.sock: - tkinter.deletefilehandler(self.sock) + self.tk.deletefilehandler(self.sock) self.edit.local.config(state=DISABLED) self.edit.local.unbind('') @@ -177,7 +189,7 @@ self.sock = None # enable "connect" event handler, disable disconnect - self.entry.address.bind('', self.connect) + self.buttons.address.bind('', self.connect) self.buttons.connect.config(state=NORMAL) self.buttons.disconnect.config(state=DISABLED) @@ -218,7 +230,7 @@ self.status['text'] = "Ringing remote party..." self.numTries = 1 - tkinter.createfilehandler(self.servSock, tkinter.READABLE, + self.tk.createfilehandler(self.servSock, tkinter.READABLE, self.acceptConnection) # announce again after 30 seconds @@ -239,7 +251,7 @@ def acceptConnection(self, file, mask): acc = self.servSock.accept() self.status['text'] = "Accepted connection from " + `acc[1]` - tkinter.deletefilehandler(self.servSock) + self.tk.deletefilehandler(self.servSock) self.sock = acc[0] self.servSock.close() self.servSock = None @@ -270,7 +282,7 @@ self.editChars = self.sock.recv(3) - tkinter.createfilehandler(self.sock, tkinter.READABLE, + self.tk.createfilehandler(self.sock, tkinter.READABLE, self.handleRemoteInput) self.sock.setblocking(0) --- xtalk-1.3.orig/xtalk.1 +++ xtalk-1.3/xtalk.1 @@ -0,0 +1,27 @@ +.TH XTALK 1 +.SH NAME +xtalk \- X Window System BSD compatible talk client, written in Python. +.SH SYNOPSIS +.B xtalk +.BI [user[@address[\ tty]] +.SH DESCRIPTION + +When started, xtalk won't actually try to connect until you click on the +"Connect" button in the program. xtalk accepts addresses in the same +format as the regular BSD talk program. From in the program you can +enter the address in the "Address" entry. At any point during a talk +session, clicking on "Disconnect" disconnects the session. + +The format of a talk address is as follows. To talk to a user on the +same host, just use "username" as the address. To talk to a user on another +host, use "username@hostname" as the address. If the user is logged in several +times, you can specify which tty to "page" them on by saying "username tty" or +"username@hostname tty". + +.SH AUTHOR +Adam P. Jenkins (adampjenkins@yahoo.com) +.SH "SEE ALSO" +.BR talk "(1) +.SH BUGS +From user point of view, it seems that his own text in the window is editable, +whereas in fact it is not. --- xtalk-1.3.orig/finger.py +++ xtalk-1.3/finger.py @@ -1,6 +1,6 @@ #!/usr/bin/python -import regex, socket, sys +import re, socket, sys from Tkinter import * error = "fingerError" @@ -15,7 +15,7 @@ return fp.read() def parseQuery(query): - rx = regex.compile("^\([^ \t@]+\)?\(@\([^ \t]+\)\)?$") + rx = re.compile("^\([^ \t@]+\)?\(@\([^ \t]+\)\)?$") if rx.match(query) > 0: user, host = rx.group(1, 3) if not user: user = "" --- xtalk-1.3.orig/debian/compat +++ xtalk-1.3/debian/compat @@ -0,0 +1 @@ +5 --- xtalk-1.3.orig/debian/rules +++ xtalk-1.3/debian/rules @@ -0,0 +1,58 @@ +#!/usr/bin/make -f +#-*- makefile -*- +# Made with the aid of dh_make, by Craig Small +# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. +# Some lines taken from debmake, by Christoph Lameter. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +MAKE += LIBDIR=\$${DESTDIR}/usr/share/xtalk BINDIR=\$${DESTDIR}/usr/bin + +build: build-stamp +build-stamp: + dh_testdir + + $(MAKE) DESTDIR= + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + $(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) DESTDIR=$(CURDIR)/debian/xtalk install + dos2unix debian/xtalk/usr/share/xtalk/*.py \ + debian/xtalk/usr/bin/xtalk + +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs README + dh_installmenu + dh_installman xtalk.1 + dh_link + dh_compress + dh_fixperms + dh_pysupport + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary-arch: build install + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- xtalk-1.3.orig/debian/control +++ xtalk-1.3/debian/control @@ -0,0 +1,15 @@ +Source: xtalk +Section: net +Priority: optional +Maintainer: Luis Uribe +Build-Depends: debhelper (>= 5.0.37.2) +Build-Depends-Indep: dos2unix | tofrodos (<< 1.7.8.debian.1-2), python, python-support (>= 0.3) +Standards-Version: 3.7.2 + +Package: xtalk +Architecture: all +Depends: ${python:Depends}, python-tk +Description: BSD talk compatible X Window System client + XTalk is a visual communication program which copies lines from your + terminal to that of another user. This is an X Window System version, + written in Python. --- xtalk-1.3.orig/debian/changelog +++ xtalk-1.3/debian/changelog @@ -0,0 +1,157 @@ +xtalk (1.3-15.2) unstable; urgency=low + + * Non-maintainer upload. + * Drop useless dh_python call (Closes: #715305). + + -- Luca Falavigna Sun, 14 Jul 2013 10:19:38 +0200 + +xtalk (1.3-15.1) unstable; urgency=low + + [Jari Aalto] + * debian/control + - (Build-Depends-Indep): adjust tofrodos version and add dos2unix. The + tofrodos after certain version does not carry the 'dos2unix' utility + (RC bug FTBFS serious; Closes: #569368). + + -- Jari Aalto Fri, 26 Mar 2010 21:02:44 +0200 + +xtalk (1.3-15) unstable; urgency=low + + * New maintainter. Closes: #347571 + + -- Luis Uribe Fri, 08 Sep 2006 22:27:41 -0500 + +xtalk (1.3-14) unstable; urgency=low + + * QA upload. + * Actually conform to new Python policy. + - Build depend on debhelper (>= 5.0.37.2). + - Build depend on python-support (>= 0.3). + - Build depend on python rather than python-dev since we don't + compile extensions. + - debian/pycompat: Set to 2. + - debian/postinst, debian/prerm: Remove old compilation code. + * Build depend on tofrodos rather than sysutils. + * Move Python modules from /usr/lib/xtalk to /usr/share/xtalk. + * Switch to debhelper 5. + * debian/control, debian/menu: Capitalize names. + * debian/copyright: + - Refer to author's homepage. + - Add full copyright statement. + * debian/dirs: Let the Makefile create them. + * debian/rules: Override variables instead of patching the Makefile. + * debian/watch: Add. + * debian/postinst.debhelper, debian/postrm.debhelper, debian/postrm: + Remove cruft. + + -- Matej Vela Wed, 9 Aug 2006 12:41:32 +0200 + +xtalk (1.3-13) unstable; urgency=low + + * QA Upload. + * Update package to the last python policy (Closes: #380991). + * Bump standards-version to 3.7.2. + + -- Pierre Habouzit Tue, 1 Aug 2006 22:29:55 +0200 + +xtalk (1.3-12) unstable; urgency=low + + * convert obsolete regexp usage to re + * replace _tkinter.{delete,create}filehandler with + self.tk.{delete,create}filenahdler (closes: #342362) + * orphaning the package, setting Maintainer to Debian QA Group. + With all these modern firewalls and private networks and NATs, + it is _years_ since I used talk the last time... + + -- Radovan Garabík Sun, 25 Dec 2005 20:20:24 +0100 + +xtalk (1.3-11.1) unstable; urgency=low + + * NMU + * Build for python2.3 as the default python version (closes: #207328). + + -- Matthias Klose Tue, 26 Aug 2003 07:51:05 +0200 + +xtalk (1.3-11) unstable; urgency=low + + * upgraded debian package to work with python2.2 (closes: #161557) + + -- Radovan Garabik Fri, 11 Oct 2002 10:32:25 +0200 + +xtalk (1.3-10) unstable; urgency=low + + * modified to work with python2.1 + * put back module compilation in postinst + * replace regsub and regexp usage with re and string + * fix incorrect use of struct + + -- Radovan Garabik Mon, 10 Dec 2001 23:37:39 +0100 + +xtalk (1.3-9) unstable; urgency=low + + * can be installed with python2-tk as well + * removed compilation of modules in postinst - although this is + a bit improper, this way there can be just one package for both pythons + + -- Radovan Garabik Fri, 23 Feb 2001 22:00:22 +0100 + +xtalk (1.3-8) unstable; urgency=low + + * corrected references to X Window System (closes #76077) + + -- Radovan Garabik Sun, 5 Nov 2000 09:19:46 +0100 + +xtalk (1.3-7) unstable; urgency=low + + * applied patch from Matt Mueller moving + the address bar next to the buttons. (closes: #75090) + * prerm now removes compiled python modules + + -- Radovan Garabik Tue, 31 Oct 2000 16:11:14 +0300 + +xtalk (1.3-6) unstable; urgency=low + + * rebuilt with a new GPG key + + -- Radovan Garabik Fri, 1 Sep 2000 08:47:10 +0200 + +xtalk (1.3-5) unstable; urgency=low + + * added debhelper to Build-Depends + + -- Radovan Garabik Wed, 16 Feb 2000 16:05:52 +0100 + +xtalk (1.3-4) unstable; urgency=low + + * upgraded Standards-Version + + -- Radovan Garabik Thu, 6 Jan 2000 16:22:54 +0100 + +xtalk (1.3-3.1) unstable; urgency=low + + * Sponsored NMU. + * Properly list Radovan as the maintainer of the package for potato. + + -- Chris Lawrence Tue, 4 Jan 2000 02:18:00 -0600 + +xtalk (1.3-3) unstable; urgency=low + + * upgraded Standards-Version + * Radovan Garabik is the person + responsible for this package; I am his sponsor and uploading it on his + behalf. + + -- Chris Lawrence Wed, 13 Oct 1999 22:10:48 +0200 + +xtalk (1.3-2) unstable; urgency=low + + * FHS compliant + + -- Radovan Garabik Fri, 24 Sep 1999 17:37:09 +0200 + +xtalk (1.3-1) unstable; urgency=low + + * Initial Release. + + -- Radovan Garabik Thu, 9 Sep 1999 21:37:28 +0200 + --- xtalk-1.3.orig/debian/copyright +++ xtalk-1.3/debian/copyright @@ -0,0 +1,31 @@ +This package was debianized by Radovan Garabík on +Thu, 9 Sep 1999 21:37:28 +0200. + +It was obtained directly from the author. A slightly older version can be found at: + + + +Upstream Author: Adam P. Jenkins + +Copyright: + + XTalk - A BSD talk client written in Python. + (C) Adam P. Jenkins + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301 USA. + +On Debian systems, the complete text of the GNU General Public License +can be found in `/usr/share/common-licenses/GPL'. --- xtalk-1.3.orig/debian/watch +++ xtalk-1.3/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://users.erols.com/apjenkins/xtalk-(.*)\.tar\.gz --- xtalk-1.3.orig/debian/menu +++ xtalk-1.3/debian/menu @@ -0,0 +1,2 @@ +?package(xtalk):needs="x11" section="Apps/Net"\ + title="XTalk" command="/usr/bin/xtalk"