Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 55577 Details for
Bug 88283
pyicq-t-0.7.ebuild (new package)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
files/pyicq-t-0.6-encoding.patch
pyicq-t-0.6-encoding.patch (text/plain), 4.80 KB, created by
Karl-Johan Karlsson
on 2005-04-07 11:47:11 UTC
(
hide
)
Description:
files/pyicq-t-0.6-encoding.patch
Filename:
MIME Type:
Creator:
Karl-Johan Karlsson
Created:
2005-04-07 11:47:11 UTC
Size:
4.80 KB
patch
obsolete
>Index: legacy/glue.py >=================================================================== >--- legacy/glue.py (revision 86) >+++ legacy/glue.py (working copy) >@@ -7,6 +7,7 @@ > import config > import debug > import lang >+import locale > > # The name of the transport > name = "ICQ Transport" >Index: legacy/icqt.py >=================================================================== >--- legacy/icqt.py (revision 84) >+++ legacy/icqt.py (working copy) >@@ -12,6 +12,7 @@ > import sys, warnings, pprint > import stats > import lang >+import locale > > > ############################################################################# >@@ -121,7 +122,7 @@ > if (multiparts[0][1] in ['unicode','utf-8']): > encoding = "utf-8" > else: >- encoding = config.encoding >+ encoding = multiparts[0][1] > else: > encoding = config.encoding > debug.log("B: using encoding %s" % (encoding)) >Index: jabw.py >=================================================================== >--- jabw.py (revision 75) >+++ jabw.py (working copy) >@@ -5,11 +5,11 @@ > from tlib.jabber import jid > import utils > import debug >+import locale > >- > def sendMessage(pytrans, to, fro, body, mtype=None, errorType=None, delay=None): > """ Sends a Jabber message """ >- debug.log("jabw: Sending a Jabber message \"%s\" \"%s\" \"%s\" \"%s\"" % (to, fro, utils.latin1(body), mtype)) >+ debug.log("jabw: Sending a Jabber message \"%s\" \"%s\" \"%s\" \"%s\"" % (to, fro, body, mtype)) > el = Element((None, "message")) > el.attributes["to"] = to > el.attributes["from"] = fro >@@ -33,7 +33,7 @@ > x.attributes["stamp"] = delay > > b = el.addElement("body") >- b.addContent(utils.utf8encode(body)) >+ b.addContent(body) > x = el.addElement("x") > x.attributes["xmlns"] = "jabber:x:event" > composing = x.addElement("composing") >@@ -47,10 +47,10 @@ > el.attributes["type"] = ptype > if(show): > s = el.addElement("show") >- s.addContent(utils.utf8encode(show)) >+ s.addContent(show) > if(status): > s = el.addElement("status") >- s.addContent(utils.utf8encode(status)) >+ s.addContent(status) > if(priority): > s = el.addElement("priority") > s.addContent(priority) >@@ -121,7 +121,7 @@ > For this message to be an error, mtype="error", errorType=("modify", "bad-request", "Human readable descriptive text") - See XMPP Core (RFC3920) for more details > For this message to have a <x xmlns="jabber:x:delay"/> you must pass a correctly formatted timestamp (See JEP0091) > """ >- debug.log("User: %s - JabberConnection sending message \"%s\" \"%s\" \"%s\" \"%s\"" % (self.jabberID, to, fro, utils.latin1(body), mtype)) >+ debug.log("User: %s - JabberConnection sending message \"%s\" \"%s\" \"%s\" \"%s\"" % (self.jabberID, to, fro, body, mtype)) > sendMessage(self.pytrans, to, fro, body, mtype, errorType, delay) > > def sendErrorMessage(self, to, fro, etype, eelement, econtent, body=None): >@@ -194,10 +194,9 @@ > self.typingNotificationReceived(toj.userhost(), toj.resource, composing) > > if(body): >-# body = utils.utf8(body) > # Save the message ID for later > self.messageIDs[to] = mID >- debug.log("User: %s - JabberConnection parsed message packet \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"" % (self.jabberID, froj.userhost(), to, froj.resource, mtype, utils.latin1(body))) >+ debug.log("User: %s - JabberConnection parsed message packet \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"" % (self.jabberID, froj.userhost(), to, froj.resource, mtype, body)) > self.messageReceived(froj.userhost(), froj.resource, toj.userhost(), toj.resource, mtype, body) > > def onPresence(self, el): >Index: main.py >=================================================================== >--- main.py (revision 86) >+++ main.py (working copy) >@@ -5,8 +5,11 @@ > import getopt > import sys > import os >+import locale >+ > reload(sys) >-sys.setdefaultencoding('iso-8859-1') >+locale.setlocale(locale.LC_ALL, "") >+sys.setdefaultencoding(locale.getpreferredencoding()) > del sys.setdefaultencoding > > if (float(sys.version[:3]) < 2.3): >Index: debug.py >=================================================================== >--- debug.py (revision 72) >+++ debug.py (working copy) >@@ -5,6 +5,7 @@ > import config > import utils > import time >+import locale > > """ A simple logging module. Use as follows. > >@@ -28,15 +29,19 @@ > def log(data, wtime=True): > if(wtime): > debugFile.write(time.strftime("%D - %H:%M:%S - ")) >- #debugFile.write(utils.latin1(data) + "\n") >- debugFile.write(data + "\n") >+ try: >+ debugFile.write(data + "\n") >+ except UnicodeEncodeError: >+ debugFile.write(data.encode(locale.getpreferredencoding(),'replace') + "\n") > debugFile.flush() > else: > def log(data, wtime=True): > if(wtime): > print time.strftime("%D - %H:%M:%S - "), >- #print utils.latin1(data) >- print data >+ try: >+ print data >+ except UnicodeEncodeError: >+ print data.encode(locale.getpreferredencoding(),'replace') > log("Debug logging enabled.") > else: > def log(data):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 88283
:
55575
| 55577 |
55578
|
55579
|
55687
|
55688
|
55867
|
61390
|
61391
|
61392
|
61395
|
61397
|
61556
|
61557
|
79857
|
79858
|
79859
|
81449
|
81450
|
81451
|
81474
|
81511
|
81607
|
81608
|
95453
|
95454
|
113683
|
113684
|
113685
|
113686
|
113688