Browse Source

Various unicode cleanups.

suites/jessie-proposed-backports
Chris Lawrence 16 years ago
parent
commit
b5bee14f3b
  1. 11
      debian/changelog
  2. 13
      reportbug
  3. 4
      reportbug.py
  4. 18
      reportbug_ui_text.py

11
debian/changelog

@ -1,3 +1,14 @@
reportbug (3.32) unstable; urgency=low
* Remove recommendations of python-{cjkcodecs,iconvcodec}.
(Closes: #401870)
* Encode unicode strings before output in text interface's ewrite()
function. (Closes: #404165)
* More unicode fixups. (Closes: #397357)
* Fix typo in help message. (Closes: #397983)
--
reportbug (3.31) unstable; urgency=low
* Add po4a support for translating man pages. (Closes: #392458)

13
reportbug

@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE."""
#
# Version ##VERSION##; see changelog for revision history
# $Id: reportbug,v 1.98.2.18 2006-11-05 23:30:34 lawrencc Exp $
# $Id: reportbug,v 1.98.2.19 2006-12-23 06:44:43 lawrencc Exp $
# Work around case where Python install might be broken (#290043)
try:
@ -794,6 +794,9 @@ class UI(object):
if charset.lower() == 'ansi_x3.4-1968':
charset = 'us-ascii'
# Allow the UI to know what charset we're using
ui.charset = charset
if self.options.configure:
offer_configuration(self.options)
sys.exit(0)
@ -1450,7 +1453,7 @@ orphaned for a long period of time are often removed from the archive.\n''')
if not ui.yes_no('Does this bug still exist in version %s '
'of this package?' % pkgversion,
'Yes, it does.',
'No, it does\'t (or I don\'t know).',
'No, it doesn\'t (or I don\'t know).',
default=False):
pkgversion = None
elif not subject and not notatty:
@ -1631,11 +1634,11 @@ orphaned for a long period of time are often removed from the archive.\n''')
# Prepare bug report
if self.options.kudos:
message = '\n\n'
message = u'\n\n'
if not mua:
SIGFILE = os.path.join(HOMEDIR, '.signature')
try:
message = "\n\n-- \n"+file(SIGFILE).read()
message = u"\n\n-- \n"+file(SIGFILE).read().decode('utf-8', 'replace')
except IOError:
pass
else:
@ -1672,7 +1675,7 @@ orphaned for a long period of time are often removed from the archive.\n''')
' Bug Tracking System', sendto))
mailing = not (mua or self.options.printonly or self.options.template)
message = "Subject: %s\n%s" % (subject, message)
message = u"Subject: %s\n%s" % (subject, message)
if mailing:
fh, filename = TempFile(prefix=tfprefix)

4
reportbug.py

@ -21,7 +21,7 @@
#
# Version ##VERSION##; see changelog for revision history
#
# $Id: reportbug.py,v 1.35.2.4 2006-10-19 21:10:31 lawrencc Exp $
# $Id: reportbug.py,v 1.35.2.5 2006-12-23 06:44:43 lawrencc Exp $
VERSION = "reportbug ##VERSION##"
VERSION_NUMBER = "##VERSION##"
@ -726,7 +726,7 @@ def generate_blank_report(package, pkgversion, severity, justification,
else:
uname_string = '%s %s' % (un[0], un[2])
return """%s%s%s
return u"""%s%s%s
-- System Information:
%sKernel: %s
Locale: %s

18
reportbug_ui_text.py

@ -18,7 +18,7 @@
## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
## SOFTWARE.
#
# $Id: reportbug_ui_text.py,v 1.19.2.6 2006-12-23 06:27:50 lawrencc Exp $
# $Id: reportbug_ui_text.py,v 1.19.2.7 2006-12-23 06:44:43 lawrencc Exp $
import commands, sys, os, re, math, string, debianbts, errno, reportbug
from reportbug_exceptions import *
@ -213,14 +213,22 @@ def get_string(prompt, options=None, title=None, force_prompt=False,
if prompt and (len(prompt) < 2*columns/3) and not force_prompt:
if default:
prompt = '%s [%s]: ' % (prompt, default)
return our_raw_input(prompt, options, completer) or default
return our_raw_input(prompt, options, completer)
response = our_raw_input(prompt, options, completer) or default
else:
response = our_raw_input(prompt, options, completer)
else:
if prompt:
ewrite(indent_wrap_text(prompt))
if default:
return our_raw_input('[%s]> ' % default, options, completer) or default
return our_raw_input('> ', options, completer)
response = our_raw_input('[%s]> ' % default, options, completer) or default
else:
response = our_raw_input('> ', options, completer)
# Translate the response into a Unicode string
if response is not None:
response = unicode(response, charset, 'replace')
return response
def get_multiline(prompt):
ewrite('\n')

Loading…
Cancel
Save