Browse Source

Merged from branches/reportbuglib.

suites/jessie-proposed-backports
Ben Finney 14 years ago
parent
commit
7addb2d942
  1. 3
      debian/changelog
  2. 1
      debian/dirs
  3. 11
      debian/rules
  4. 15
      querybts
  5. 30
      reportbug
  6. 0
      reportbuglib/__init__.py
  7. 3
      reportbuglib/checkbuildd.py
  8. 3
      reportbuglib/checkversions.py
  9. 3
      reportbuglib/debianbts.py
  10. 3
      reportbuglib/hiermatch.py
  11. 2
      reportbuglib/rbtempfile.py
  12. 17
      reportbuglib/reportbug.py
  13. 1
      reportbuglib/reportbug_exceptions.py
  14. 18
      reportbuglib/reportbug_submit.py
  15. 1
      reportbuglib/reportbug_ui_newt.py
  16. 1
      reportbuglib/reportbug_ui_text.py
  17. 1
      reportbuglib/reportbug_ui_urwid.py
  18. 0
      reportbuglib/urlutils.py
  19. 4
      test/test_checkbuildd.py
  20. 4
      test/test_checkversions.py
  21. 4
      test/test_debianbts.py
  22. 4
      test/test_hiermatch.py
  23. 4
      test/test_rbtempfile.py
  24. 4
      test/test_reportbug.py
  25. 4
      test/test_reportbug_exceptions.py
  26. 4
      test/test_reportbug_submit.py
  27. 4
      test/test_reportbug_ui_newt.py
  28. 4
      test/test_reportbug_ui_text.py
  29. 4
      test/test_reportbug_ui_urwid.py
  30. 6
      test/test_urlutils.py
  31. 6
      test_hiermatch.py

3
debian/changelog

@ -37,6 +37,9 @@ reportbug (3.42) UNRELEASED; urgency=low
- Don't munge sys.path unnecessarily.
- test/*.py
- Ensure programs and modules don't cause ImportError.
* Move library modules to new 'reportbuglib' Python package.
* debian/rules
- Install library modules from current location.
-- Sandro Tosi <matrixhasu@gmail.com> Tue, 24 Jun 2008 02:29:56 +0200

1
debian/dirs

@ -1,4 +1,5 @@
etc
usr/bin
usr/share/reportbug
usr/share/reportbug/reportbuglib
usr/share/bug/reportbug

11
debian/rules

@ -37,15 +37,10 @@ install-stamp: build-stamp
@echo "s/##VERSION##/`head -n 1 debian/changelog | sed -e 's/[^(]*(\([^)]*\).*/\1/'`/g" > sed-script
cat sed-script
# Add here commands to install the package into debian/reportbug.
debian/install-sed /usr/bin reportbug querybts
debian/install-sed /usr/share/reportbug *.py
# Copy correct email module into place under the reportbug private path
#mkdir `pwd`/debian/reportbug/usr/share/reportbug/email
#cp -vr /usr/lib/python2.3/email/*.py `pwd`/debian/reportbug/usr/share/reportbug/email
debian/install-sed /usr/share/reportbug reportbuglib/*.py
# Remove unneeded .py files
rm -f `pwd`/debian/reportbug/usr/share/reportbug/urllib2.py
rm `pwd`/debian/reportbug/usr/share/reportbug/test_hiermatch.py
chmod 0755 `pwd`/debian/reportbug/usr/bin/*
cp handle_bugscript reportbug.el `pwd`/debian/reportbug/usr/share/reportbug
@ -71,7 +66,7 @@ binary-indep: build install
dh_installcron
dh_installman querybts.1 reportbug.1 reportbug.fr.1 querybts.fr.1 reportbug.ja.1 reportbug.conf.5
# dh_undocumented
dh_installchangelogs
dh_installchangelogs
dh_link
dh_strip
dh_compress
@ -85,7 +80,7 @@ binary-indep: build install
dh_md5sums
dh_builddeb
source diff:
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-indep binary-arch

15
querybts

@ -30,19 +30,19 @@ sys.path = ['/usr/share/reportbug'] + sys.path
import getopt
import re
import reportbug
from reportbug_exceptions import (
from reportbuglib import reportbug
from reportbuglib.reportbug_exceptions import (
UINotImportable,
NoPackage, NoBugs, NoReport, NoNetwork,
)
import debianbts
import urlutils
from reportbuglib import debianbts
from reportbuglib import urlutils
try:
import reportbug_ui_newt as ui
from reportbuglib import reportbug_ui_newt as ui
ui_mode = 'newt'
except:
import reportbug_ui_text as ui
from reportbuglib import reportbug_ui_text as ui
ui_mode = 'text'
VERSION = "querybts ##VERSION##"
@ -172,7 +172,8 @@ def main():
global ui, ui_mode
iface = 'reportbug_ui_%(interface)s' % vars()
try:
ui = __import__(iface)
lib_package = __import__('reportbuglib', fromlist=[iface])
ui = getattr(lib_package, iface)
ui_mode = interface
except UINotImportable, msg:
ui.long_message('*** Unable to import %s interface: %s '

30
reportbug

@ -38,26 +38,31 @@ import rfc822
import gettext
import textwrap
import reportbug
from reportbug import MODE_EXPERT, MODE_ADVANCED, MODE_NOVICE, MODE_STANDARD
from reportbug import VERSION, COPYRIGHT
from rbtempfile import TempFile, tempfile_prefix, cleanup_temp_file
from reportbug_exceptions import (
from reportbuglib import reportbug
from reportbuglib.reportbug import (
VERSION, COPYRIGHT,
MODE_EXPERT, MODE_ADVANCED, MODE_NOVICE, MODE_STANDARD,
)
from reportbuglib.rbtempfile import (
TempFile,
tempfile_prefix,
cleanup_temp_file,
)
from reportbuglib.reportbug_exceptions import (
UINotImportable, UINotImplemented,
NoNetwork, NoPackage, NoBugs, NoReport,
)
import reportbug_submit
import checkversions
import debianbts
import checkbuildd
from reportbuglib import reportbug_submit
from reportbuglib import checkversions
from reportbuglib import debianbts
from reportbuglib import checkbuildd
from reportbuglib import reportbug_ui_text as ui
try:
gettext.install('reportbug')
except IOError:
pass
import reportbug_ui_text as ui
# Magic constant time
MIN_USER_ID = 250
@ -823,7 +828,8 @@ def main():
iface = 'reportbug_ui_%(interface)s' % vars()
try:
ui = __import__(iface)
lib_package = __import__('reportbuglib', fromlist=[iface])
ui = getattr(lib_package, iface)
except UINotImportable, msg:
ui.long_message('*** Unable to import %s interface: %s '
'Falling back to text interface.\n',

0
reportbuglib/__init__.py

3
checkbuildd.py → reportbuglib/checkbuildd.py

@ -1,5 +1,6 @@
#
# checkbuildd.py - Check buildd.debian.org for successful past builds
# reportbuglib/checkbuildd.py
# Check buildd.debian.org for successful past builds
#
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 2002 Chris Lawrence

3
checkversions.py → reportbuglib/checkversions.py

@ -1,5 +1,6 @@
#
# checkversions.py - Find if the installed version of a package is the latest
# reportbuglib/checkversions.py
# Find if the installed version of a package is the latest
#
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 2002-06 Chris Lawrence

3
debianbts.py → reportbuglib/debianbts.py

@ -1,5 +1,6 @@
#
# debianbts.py - Routines to deal with the debbugs web pages
# reportbuglib/debianbts.py
# Routines to deal with the debbugs web pages
#
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 1999-2006 Chris Lawrence

3
hiermatch.py → reportbuglib/hiermatch.py

@ -1,7 +1,8 @@
# Doing match on a list of string or a hierarchy.
import re
import reportbug_exceptions
from reportbuglib import reportbug_exceptions
def egrep_list(strlist, pattern_str, subindex=None):
"""Use the pattern_str to find any match in a list of strings."""

2
rbtempfile.py → reportbuglib/rbtempfile.py

@ -1,5 +1,5 @@
#
# rbtempfile module - Temporary file handling for reportbug
# reportbuglib/rbtempfile module - Temporary file handling for reportbug
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 1999-2004 Chris Lawrence
#

17
reportbug.py → reportbuglib/reportbug.py

@ -1,5 +1,7 @@
#
# Reportbug module - common functions for reportbug and greportbug
# reportbuglib/reportbug.py
# Common functions for reportbug and greportbug
#
# Written by Chris Lawrence <lawrencc@debian.org>
# Copyright (C) 1999-2006 Chris Lawrence
#
@ -36,6 +38,7 @@ import shlex
import rfc822
import socket
import subprocess
import imp
import debianbts
@ -49,13 +52,13 @@ PSEUDOHEADERS = ('Package', 'Version', 'Severity', 'File', 'Tags',
'Justification', 'Followup-For', 'Owner', 'User', 'Usertags')
VALID_UIS = ['newt', 'text', 'gnome2', 'urwid']
AVAILABLE_UIS = []
AVAILABLE_UIS = VALID_UIS
for ui in VALID_UIS:
pkgname = 'reportbug_ui_%s.py' % ui
for d in sys.path:
if os.path.exists(os.path.join(d, pkgname)):
AVAILABLE_UIS.append(ui)
break
module_name = 'reportbug_ui_%(ui)s' % vars()
try:
imp.find_module(module_name)
except ImportError:
AVAILABLE_UIS.remove(ui)
UIS = {'text': 'A text-oriented console interface',
'urwid': 'A menu-based console interface',

1
reportbug_exceptions.py → reportbuglib/reportbug_exceptions.py

@ -1,3 +1,4 @@
# reportbuglib/reportbug_exceptions.py
# Exceptions for reportbug
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 2002-04 Chris Lawrence

18
reportbug_submit.py → reportbuglib/reportbug_submit.py

@ -1,4 +1,4 @@
# reportbug_submit module - email and GnuPG functions
# reportbuglib/reportbug_submit module - email and GnuPG functions
# Written by Chris Lawrence <lawrencc@debian.org>
# Copyright (C) 1999-2006 Chris Lawrence
#
@ -39,14 +39,18 @@ from email.MIMEMessage import MIMEMessage
from email.Header import Header
import mimetypes
import reportbug
from reportbug import VERSION, VERSION_NUMBER
import debianbts
from rbtempfile import TempFile, open_write_safe, tempfile_prefix
from reportbug_exceptions import (
from reportbuglib import reportbug
from reportbuglib.reportbug import VERSION, VERSION_NUMBER
from reportbuglib import debianbts
from reportbuglib.rbtempfile import (
TempFile,
open_write_safe,
tempfile_prefix,
)
from reportbuglib.reportbug_exceptions import (
NoMessage,
)
import reportbug_ui_text as ui
from reportbuglib import reportbug_ui_text as ui
quietly = False

1
reportbug_ui_newt.py → reportbuglib/reportbug_ui_newt.py

@ -23,6 +23,7 @@
import sys
import commands
import string
import debianbts
from reportbug_exceptions import (
UINotImportable,

1
reportbug_ui_text.py → reportbuglib/reportbug_ui_text.py

@ -1,3 +1,4 @@
# reportbuglib/reportbug_ui_text.py
# Text user interface for reportbug
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 2001-06 Chris Lawrence

1
reportbug_ui_urwid.py → reportbuglib/reportbug_ui_urwid.py

@ -1,3 +1,4 @@
# reportbuglib/reportbug_ui_urwid.py
# urwid user interface for reportbug
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 2006 Chris Lawrence

0
urlutils.py → reportbuglib/urlutils.py

4
test/test_checkbuildd.py

@ -8,9 +8,9 @@
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.
""" Unit test for checkbuildd module
""" Unit test for reportbuglib.checkbuildd module
"""
import scaffold
import checkbuildd
from reportbuglib import checkbuildd

4
test/test_checkversions.py

@ -8,9 +8,9 @@
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.
""" Unit test for checkversions module
""" Unit test for reportbuglib.checkversions module
"""
import scaffold
import checkversions
from reportbuglib import checkversions

4
test/test_debianbts.py

@ -8,9 +8,9 @@
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.
""" Unit test for debianbts module
""" Unit test for reportbuglib.debianbts module
"""
import scaffold
import debianbts
from reportbuglib import debianbts

4
test/test_hiermatch.py

@ -8,9 +8,9 @@
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.
""" Unit test for hiermatch module
""" Unit test for reportbuglib.hiermatch module
"""
import scaffold
import hiermatch
from reportbuglib import hiermatch

4
test/test_rbtempfile.py

@ -8,7 +8,7 @@
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.
""" Unit test for rbtempfile module
""" Unit test for reportbuglib.rbtempfile module
"""
import os
@ -16,7 +16,7 @@ import os
import scaffold
from scaffold import TestCase
import rbtempfile
from reportbuglib import rbtempfile
class Test_cleanup_temp_file(TestCase):

4
test/test_reportbug.py

@ -8,7 +8,7 @@
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.
""" Unit test for reportbug module
""" Unit test for reportbuglib.reportbug module
"""
import os
@ -16,7 +16,7 @@ import os
import scaffold
from scaffold import TestCase
import reportbug
from reportbuglib import reportbug
class Test_glob_escape(TestCase):

4
test/test_reportbug_exceptions.py

@ -8,9 +8,9 @@
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.
""" Unit test for reportbug_exceptions module
""" Unit test for reportbuglib.reportbug_exceptions module
"""
import scaffold
import reportbug_exceptions
from reportbuglib import reportbug_exceptions

4
test/test_reportbug_submit.py

@ -8,9 +8,9 @@
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.
""" Unit test for reportbug_submit module
""" Unit test for reportbuglib.reportbug_submit module
"""
import scaffold
import reportbug_submit
from reportbuglib import reportbug_submit

4
test/test_reportbug_ui_newt.py

@ -8,9 +8,9 @@
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.
""" Unit test for reportbug_ui_newt module
""" Unit test for reportbuglib.reportbug_ui_newt module
"""
import scaffold
import reportbug_ui_newt
from reportbuglib import reportbug_ui_newt

4
test/test_reportbug_ui_text.py

@ -8,9 +8,9 @@
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.
""" Unit test for reportbug_ui_text module
""" Unit test for reportbuglib.reportbug_ui_text module
"""
import scaffold
import reportbug_ui_text
from reportbuglib import reportbug_ui_text

4
test/test_reportbug_ui_urwid.py

@ -8,9 +8,9 @@
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.
""" Unit test for reportbug_ui_urwid module
""" Unit test for reportbuglib.reportbug_ui_urwid module
"""
import scaffold
import reportbug_ui_urwid
from reportbuglib import reportbug_ui_urwid

6
test/test_urlutils.py

@ -8,7 +8,7 @@
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.
""" Unit test for urlutils module
""" Unit test for reportbuglib.urlutils module
"""
import httplib
@ -16,8 +16,8 @@ import httplib
import scaffold
from scaffold import TestCase
import reportbug_exceptions
import urlutils
from reportbuglib import reportbug_exceptions
from reportbuglib import urlutils
class StubObject(object):

6
test_hiermatch.py

@ -1,6 +1,6 @@
# $Id: test_hiermatch.py,v 1.1.1.1 2004-02-05 04:29:08 lawrencc Exp $
import hiermatch as hier
from reportbuglib import hiermatch as hier
def test_list():
import sys
@ -38,11 +38,7 @@ def test_mhier():
d = [len(i[1]) for i in c]
print reduce(lambda x, y: x+y, d)
test_mhier()
# vim:ts=8:sw=4:expandtab:

Loading…
Cancel
Save