[Python-apps-commits] r3531 - in packages/pyaimt/trunk/debian (4 files)

nijel at users.alioth.debian.org nijel at users.alioth.debian.org
Mon Aug 24 20:21:40 UTC 2009


    Date: Monday, August 24, 2009 @ 20:21:39
  Author: nijel
Revision: 3531

Drop patches which seem not to be needed (pyicq20070823.patch and
fixups.patch).

Modified:
  packages/pyaimt/trunk/debian/changelog
  packages/pyaimt/trunk/debian/patches/series
Deleted:
  packages/pyaimt/trunk/debian/patches/pyicq20070823.patch
  packages/pyaimt/trunk/debian/patches/remove_pid.patch

Modified: packages/pyaimt/trunk/debian/changelog
===================================================================
--- packages/pyaimt/trunk/debian/changelog	2009-08-24 20:14:39 UTC (rev 3530)
+++ packages/pyaimt/trunk/debian/changelog	2009-08-24 20:21:39 UTC (rev 3531)
@@ -2,8 +2,10 @@
 
   * New upstream version.
   * Bump policy to 3.8.3.
+  * Drop patches which seem not to be needed (pyicq20070823.patch and
+    fixups.patch).
 
- -- Michal ÄŒihaÅ™ <nijel at debian.org>  Mon, 24 Aug 2009 22:14:24 +0200
+ -- Michal ÄŒihaÅ™ <nijel at debian.org>  Mon, 24 Aug 2009 22:21:10 +0200
 
 pyaimt (0.8a-9) unstable; urgency=low
 

Deleted: packages/pyaimt/trunk/debian/patches/pyicq20070823.patch
===================================================================
--- packages/pyaimt/trunk/debian/patches/pyicq20070823.patch	2009-08-24 20:14:39 UTC (rev 3530)
+++ packages/pyaimt/trunk/debian/patches/pyicq20070823.patch	2009-08-24 20:21:39 UTC (rev 3531)
@@ -1,305 +0,0 @@
-Patch stolen from pyicqt, not sure if it is really needed.
-
-diff -urNad pyaim-t-0.8a~/src/config.py pyaim-t-0.8a/src/config.py
---- pyaim-t-0.8a~/src/config.py	2007-03-26 11:23:32.000000000 +0900
-+++ pyaim-t-0.8a/src/config.py	2007-11-26 11:19:25.000000000 +0900
-@@ -62,3 +62,4 @@
- disableVCardAvatars = bool(False)
- #disablePEPAvatars = bool(False)
- disableAwayMessage = bool(False)
-+encoding = 'iso-8859-1'
-diff -urNad pyaim-t-0.8a~/src/globals.py pyaim-t-0.8a/src/globals.py
---- pyaim-t-0.8a~/src/globals.py	2007-11-26 11:18:57.000000000 +0900
-+++ pyaim-t-0.8a/src/globals.py	2007-11-26 11:18:59.000000000 +0900
-@@ -38,6 +38,7 @@
- XAVATAR		= "jabber:x:avatar"
- XCONFERENCE	= "jabber:x:conference"
- XDATA		= "jabber:x:data"
-+XDELAY		= "jabber:x:delay"
- XEVENT		= "jabber:x:event"
- XHTML		= "http://jabber.org/protocol/xhtml-im"
- SAPO_NOERROR	= "sapo:noerror"
-diff -urNad pyaim-t-0.8a~/src/jabw.py pyaim-t-0.8a/src/jabw.py
---- pyaim-t-0.8a~/src/jabw.py	2007-11-26 11:18:57.000000000 +0900
-+++ pyaim-t-0.8a/src/jabw.py	2007-11-26 11:18:59.000000000 +0900
-@@ -22,7 +22,7 @@
- 
- 	if delay:
- 		x = el.addElement("x")
--		x.attributes["xmlns"] = globals.IQDELAY
-+		x.attributes["xmlns"] = globals.XDELAY
- 		x.attributes["from"] = fro
- 		x.attributes["stamp"] = delay
- 
-@@ -105,7 +105,12 @@
- 
- 	pytrans.send(el)
- 
--def sendErrorMessage(pytrans, to, fro, etype, condition, explanation, body=None, el=Element((None, "message"))):
-+#http://hancke.name/jabber/doubleerror.patch
-+#http://www.blathersource.org/bugs_view.php?projid=pyicq-t&bugid=281
-+#def sendErrorMessage(pytrans, to, fro, etype, condition, explanation, body=None, el=Element((None, "message"))):
-+def sendErrorMessage(pytrans, to, fro, etype, condition, explanation, body=None, el=None):
-+	if el is None:
-+		el = Element((None, "message"))
- 	el.attributes["to"] = to
- 	el.attributes["from"] = fro
- 	el.attributes["type"] = "error"
-diff -urNad pyaim-t-0.8a~/src/legacy/aimt.py pyaim-t-0.8a/src/legacy/aimt.py
---- pyaim-t-0.8a~/src/legacy/aimt.py	2007-11-26 11:18:57.000000000 +0900
-+++ pyaim-t-0.8a/src/legacy/aimt.py	2007-11-26 11:18:59.000000000 +0900
-@@ -138,6 +138,10 @@
- 				status = status.decode("iso-8859-1", "replace")
- 		if status == "Away" or status=="I am currently away from the computer." or status=="I am away from my computer right now.":
- 			status = ""
-+		try:
-+			status = status.decode("utf16be", "replace")
-+		except:
-+			pass
- 		if user.idleTime:
- 			if user.idleTime>60*24:
- 				idle_time = "Idle %d days"%(user.idleTime/(60*24))
-@@ -159,8 +163,6 @@
- 
- 		if user.caps:
- 			self.oscarcon.legacyList.setCapabilities(user.name, user.caps)
--
--		status = status.encode("utf-8", "replace")
- 		if user.flags.count("away"):
- 			self.getAway(user.name).addCallback(self.sendAwayPresence, user)
- 		else:
-@@ -174,7 +176,7 @@
- 			self.oscarcon.legacyList.updateAvatar(contact, icondata, md5Hash=iconhash)
- 
- 	def offlineBuddy(self, user):
--		from glue import aim2jid 
-+		from glue import aim2jid
- 		LogEvent(INFO, self.session.jabberID, user.name)
- 		buddyjid = aim2jid(user.name)
-                 c = self.session.contactList.findContact(buddyjid)
-@@ -185,7 +187,7 @@
- 		c.updatePresence(show=show, status=status, ptype=ptype)
- 		self.oscarcon.legacyList.updateSSIContact(user.name, presence=ptype, show=show, status=status)
- 
--	def receiveMessage(self, user, multiparts, flags):
-+	def receiveMessage(self, user, multiparts, flags, delay=None):
- 		from glue import aim2jid
- 
- 		LogEvent(INFO, self.session.jabberID, "%s %s %s" % (user.name, multiparts, flags))
-@@ -208,7 +210,7 @@
- 		if "auto" in flags:
- 			mtype = "headline"
- 
--		self.session.sendMessage(to=self.session.jabberID, fro=sourcejid, body=text, mtype=mtype, xhtml=xhtml)
-+		self.session.sendMessage(to=self.session.jabberID, fro=sourcejid, body=text, mtype=mtype, delay=delay, xhtml=xhtml)
- 		self.session.pytrans.serviceplugins['Statistics'].stats['IncomingMessages'] += 1
- 		self.session.pytrans.serviceplugins['Statistics'].sessionUpdate(self.session.jabberID, 'IncomingMessages', 1)
- 		if not config.disableAwayMessage and self.awayMessage and not "auto" in flags:
-@@ -313,10 +315,11 @@
- 
- 		ptype = None
- 		show = "away"
--		status = oscar.dehtml(msg[1]) # Removes any HTML tags
-+		#status = oscar.dehtml(msg[1]) # Removes any HTML tags
-+		status = msg[1]
- 		url = user.url
- 		if status != None:
--			charset = "iso-8859-1"
-+ 			charset = config.encoding
- 			m = None
- 			if msg[0]:
- 				m = re.search('charset="(.+)"', msg[0])
-@@ -331,9 +334,18 @@
- 					LogEvent(INFO, self.session.jabberID, "Unknown charset (%s) of buddy's away message" % msg[0]);
- 					charset = "iso-8859-1"
- 					status = msg[0] + ": " + status
--
--			status = status.decode(charset, 'replace')
--			LogEvent(INFO, self.session.jabberID, "Away (%s, %s) message %s" % (charset, msg[0], status))
-+			if charset == config.encoding:
-+				status = ""
-+			else:
-+				status = status.decode(charset, 'replace')
-+				if charset == 'utf-16be':
-+					status = status.encode(config.encoding, 'replace')
-+				status = oscar.dehtml(status) # Removes any HTML tags
-+			try:
-+				LogEvent(INFO, self.session.jabberID, "Away (%s, %s) message %s" % (charset, msg[0], status))
-+			except:
-+				LogEvent(INFO, self.session.jabberID, "Away broken (%s, s) message s" % (charset))
-+				pass
- 
- 		if status == "Away" or status=="I am currently away from the computer." or status=="I am away from my computer right now.":
- 			status = ""
-diff -urNad pyaim-t-0.8a~/src/main.py pyaim-t-0.8a/src/main.py
---- pyaim-t-0.8a~/src/main.py	2007-11-26 11:18:57.000000000 +0900
-+++ pyaim-t-0.8a/src/main.py	2007-11-26 11:18:59.000000000 +0900
-@@ -89,7 +89,10 @@
- 	import signal
- 	signal.signal(signal.SIGHUP, reloadConfig)
- 	# Load scripts for PID and daemonizing
--	from twisted.scripts import twistd
-+	try:
-+		from twisted.scripts import _twistd_unix as twistd
-+	except:
-+		from twisted.scripts import twistd
- 
- selectWarning = "Unable to install any good reactors (kqueue, cf, epoll, poll).\nWe fell back to using select. You may have scalability problems.\nThis reactor will not support more than 1024 connections +at a time.  You may silence this message by choosing 'select' or 'default' as your reactor in the transport config."
- if config.reactor and len(config.reactor) > 0:
-@@ -138,7 +141,7 @@
- import groupchat
- import globals
- 
--
-+startTime = int(time.time())
- 
- class PyTransport(component.Service):
- 	routewrap = 0
-@@ -182,7 +185,7 @@
- 		self.loadPlugins("src/legacy/services")
- 
- 		# Misc tracking variables
--		self.startTime = int(time.time())
-+#		self.startTime = int(time.time())
- 		self.xmlstream = None
- 		self.sessions = {}
- 		# Message IDs
-@@ -223,7 +226,7 @@
- 	def loopFunc(self):
- 		numsessions = len(self.sessions)
- 
--		self.serviceplugins['Statistics'].stats["Uptime"] = int(time.time()) - self.startTime
-+		self.serviceplugins['Statistics'].stats["Uptime"] = int(time.time()) - startTime
- 		if numsessions > 0:
- 			oldDict = self.sessions.copy()
- 			self.sessions = {}
-diff -urNad pyaim-t-0.8a~/src/services/LastActivity.py pyaim-t-0.8a/src/services/LastActivity.py
---- pyaim-t-0.8a~/src/services/LastActivity.py	2007-11-26 11:18:57.000000000 +0900
-+++ pyaim-t-0.8a/src/services/LastActivity.py	2007-11-26 11:18:59.000000000 +0900
-@@ -1,7 +1,7 @@
- # Copyright 2004-2006 Daniel Henninger <jadestorm at nc.rr.com>
- # Licensed for distribution under the GPL version 2, check COPYING for details
- 
--import utils
-+import utils, time, main
- from twisted.words.xish.domish import Element
- import config
- from debug import LogEvent, INFO, WARN, ERROR
-@@ -29,6 +29,6 @@
- 			iq.attributes["id"] = el.getAttribute("id")
- 		query = iq.addElement("query")
- 		query.attributes["xmlns"] = globals.IQLAST
--		query.attributes["seconds"] = "0"
-+		query.attributes["seconds"] = str(int(time.time()) - main.startTime)
- 
- 		self.pytrans.send(iq)
-diff -urNad pyaim-t-0.8a~/src/services/VersionTeller.py pyaim-t-0.8a/src/services/VersionTeller.py
---- pyaim-t-0.8a~/src/services/VersionTeller.py	2007-11-26 11:18:57.000000000 +0900
-+++ pyaim-t-0.8a/src/services/VersionTeller.py	2007-11-26 11:18:59.000000000 +0900
-@@ -17,7 +17,7 @@
- 		self.pytrans.disco.addFeature(globals.IQVERSION, self.incomingIq, config.jid)
- 		self.pytrans.disco.addFeature(globals.IQVERSION, self.incomingIq, "USER")
- 		try:
--			self.version = "%s - SVN r%s" % (legacy.version, svninfo.getSVNVersion())
-+			self.version = "%s - SVN r%s + patchcyr-20070823" % (legacy.version, svninfo.getSVNVersion())
- 		except:
- 			self.version = legacy.version
- 		self.os = "Python " + sys.version.split(' ')[0] + "/" + sys.platform + ", Twisted " + twisted.copyright.version
-diff -urNad pyaim-t-0.8a~/src/tlib/oscar.py pyaim-t-0.8a/src/tlib/oscar.py
---- pyaim-t-0.8a~/src/tlib/oscar.py	2007-11-26 11:18:57.000000000 +0900
-+++ pyaim-t-0.8a/src/tlib/oscar.py	2007-11-26 11:18:59.000000000 +0900
-@@ -19,6 +19,7 @@
- 
- from scheduler import Scheduler
- 
-+import config
- import struct
- import md5
- import string
-@@ -199,7 +200,7 @@
- # in the docutils extension module
- # see http://docutils.sourceforge.net
- # modified for better use here
--def guess_encoding(data, defaultencoding='iso-8859-1'):
-+def guess_encoding(data, defaultencoding=config.encoding):
-     """
-     Given a byte string, attempt to decode it.
-     Tries 'utf-16be, 'utf-8' and 'iso-8859-1' (or something else) encodings.
-@@ -494,7 +495,7 @@
-                 self.firstMessage = v # unix timestamp
-  
-     def oscarRep(self):
--        data = struct.pack(">H", len(self.name)) + self.name
-+        data = struct.pack(">H", len(self.name)) + self.name.encode("utf-8")
-         tlvs = ""
-         if not self.authorized:
-             tlvs += TLV(0x0066) # awaiting authorization
-@@ -870,7 +871,7 @@
-         self.connectPort = 5190
-         # Note that this is "no unicode" default encoding
-         # We use unicode if it's there
--        self.defaultEncoding = 'iso-8859-1'
-+        self.defaultEncoding = config.encoding
- 
-         if not self.capabilities:
-             self.capabilities = [CAP_CHAT]
-@@ -1312,7 +1313,7 @@
-                             if messageLength > 0: multiparts.append(tuple(message))
-                         else:
-                             # Uh... what is this???
--                            log.msg("unknown message fragment %d %d: %v" % (fragtype, fragver, str(v)))
-+                            log.msg("unknown message fragment %d %d: %s" % (fragtype, fragver, str(v)))
-                         v = v[4+fraglen:]
-                 elif k == 0x03: # server ack requested
-                     flags.append('acknowledge')
-@@ -1641,12 +1642,12 @@
-                     # Offline message
-                     senderuin = struct.unpack('<I',v[10:14])[0]
-                     #print "senderuin: "+str(senderuin)+"\n"
--                    msg_date = str( "%4d-%02d-%02d %02d:%02d"
--                                    % struct.unpack('<HBBBB', v[14:20]) )
-+                    msg_date = str( "%4d-%02d-%02dT%02d:%02d:00Z" #XEP-091 date format
-+                                 % struct.unpack('<HBBBB', v[14:20]) )
-                     messagetype, messageflags,messagelen = struct.unpack('<BBH',v[20:24])
-                     umessage, encoding = guess_encoding(v[24:24+messagelen-1],self.defaultEncoding)
-                     log.msg("Converted message, encoding %r: %r" % (encoding, umessage))
--                    umessage = umessage + "\n\n/sent " + msg_date
-+                    #umessage = umessage + "\n\n/sent " + msg_date
-                     message = [ umessage.encode("utf-16be"), "unicode" ]
-                     #message = [ str( v[24:24+messagelen-1] )
-                     #            + "\n\n/sent " + msg_date ]
-@@ -1657,7 +1658,7 @@
-                         tlvs = dict()
-                         multiparts.append(tuple(message))
-                         user = OSCARUser(str(senderuin), None, tlvs)
--                        self.receiveMessage(user, multiparts, flags)
-+                        self.receiveMessage(user, multiparts, flags, msg_date)
-                 elif (type == 0x42):
-                     # End of offline messages
-                     reqdata = '\x08\x00'+struct.pack("<I",int(self.username))+'\x3e\x00\x02\x00'
-@@ -2022,14 +2023,14 @@
-                     charSet = 0x0000
-                 except:
-                     try:
--                        part[0] = part[0].encode('iso-8859-1')
-+                        part[0] = part[0].encode(config.encoding)
-                         charSet = 0x0003
-                     except:
-                         try:
-                             part[0] = part[0].encode('utf-16be', 'replace')
-                             charSet = 0x0002
-                         except:
--                            part[0] = part[0].encode('iso-8859-1', 'replace')
-+                            part[0] = part[0].encode(config.encoding, 'replace')
-                             charSet = 0x0003
-             if 'macintosh' in part[1:]:
-                 charSubSet = 0x000b
-@@ -2042,7 +2043,7 @@
-         # We'll investigate this in more detail later.
-         features = '\x01\x01\x02'
-         # Why do i need to encode this?  I shouldn't .. it's data.
--        data = data.encode('iso-8859-1', 'replace') + TLV(2, TLV(0x0501, features)+messageData)
-+        data = data.encode(config.encoding, 'replace') + TLV(2, TLV(0x0501, features)+messageData)
-         if wantAck:
-             log.msg("sendMessage: Sending wanting ACK")
-             data = data + TLV(3)

Deleted: packages/pyaimt/trunk/debian/patches/remove_pid.patch
===================================================================
--- packages/pyaimt/trunk/debian/patches/remove_pid.patch	2009-08-24 20:14:39 UTC (rev 3530)
+++ packages/pyaimt/trunk/debian/patches/remove_pid.patch	2009-08-24 20:21:39 UTC (rev 3531)
@@ -1,30 +0,0 @@
-Reimplement removePID, it seems to be missing in current twisted.
-
-diff -urNad pyicqt-0.8b~/src/main.py pyicqt-0.8b/src/main.py
---- pyicqt-0.8b~/src/main.py	2008-01-06 13:14:51.000000000 +0100
-+++ pyicqt-0.8b/src/main.py	2008-07-06 23:18:24.000000000 +0200
-@@ -430,11 +430,23 @@
- 		pf.write("%s\n" % pid)
- 		pf.close()
- 
-+	def removePID(self):
-+		try:
-+			os.unlink(config.pid)
-+		except OSError, e:
-+			if e.errno == errno.EACCES or e.errno == errno.EPERM:
-+				print "Warning: No permission to delete pid file"
-+			else:
-+				print "Failed to unlink PID file:"
-+				print e
-+		except:
-+			print "Failed to unlink PID file"
-+
- 	def shuttingDown(self):
- 		self.transportSvc.removeMe()
- 		def cb(ignored=None):
- 			if config.pid:
--				twistd.removePID(config.pid)
-+				self.removePID()
- 		d = Deferred()
- 		d.addCallback(cb)
- 		reactor.callLater(3.0, d.callback, None)

Modified: packages/pyaimt/trunk/debian/patches/series
===================================================================
--- packages/pyaimt/trunk/debian/patches/series	2009-08-24 20:14:39 UTC (rev 3530)
+++ packages/pyaimt/trunk/debian/patches/series	2009-08-24 20:21:39 UTC (rev 3531)
@@ -1,7 +1,5 @@
 header-dont-use-env.patch
 adapt-default-config-options.patch
-pyicq20070823.patch
-fixups.patch
 failure-report.patch
 remove_pid.patch
 crash_on_connection_lost.patch




More information about the Python-apps-commits mailing list