Browse Source

Tidy up import statements: remove redundant imports, import names explicitly.

tags/3.42
Ben Finney 13 years ago
parent
commit
ac6f6964e1
3 changed files with 35 additions and 4 deletions
  1. +6
    -0
      debian/changelog
  2. +9
    -4
      querybts
  3. +20
    -0
      test/test_querybts_program.py

+ 6
- 0
debian/changelog View File

@@ -19,6 +19,12 @@ reportbug (3.42) UNRELEASED; urgency=low
* reportbug_submit.py
* checks/compare_pseudo-pkgs_lists.py
- Remove shebang line from non-exectable modules.
* Tidy up imports.
- reportbug, querybts
- Remove redundant imports.
- Import names explicitly.
- test/test_querybts_program.py
- Ensure 'querybts' program doesn't cause ImportError.

-- Ben Finney <ben+debian@benfinney.id.au> Thu, 12 Jun 2008 17:45:51 +1000



+ 9
- 4
querybts View File

@@ -27,15 +27,20 @@
import sys, os
sys.path = ['/usr/share/reportbug'] + sys.path

from reportbug_exceptions import *
import getopt
import re

import reportbug, debianbts, commands, getopt, re, mailcap, urlutils
import reportbug
from reportbug_exceptions import (
UINotImportable,
NoPackage, NoBugs, NoReport, NoNetwork,
)
import debianbts
import urlutils

try:
import reportbug_ui_newt as ui
ui_mode = 'newt'
## import reportbug_ui_text
## ui = reportbug_ui_text
except:
import reportbug_ui_text as ui
ui_mode = 'text'


+ 20
- 0
test/test_querybts_program.py View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8; -*-

# test/test_querybts_program.py
# Part of reportbug, a Debian bug reporting tool.
#
# Copyright © 2008 Ben Finney <ben+python@benfinney.id.au>
# This is free software; you may copy, modify and/or distribute this work
# 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 querybts program
"""

import os

import scaffold

module_name = 'querybts'
module_file_path = os.path.join(scaffold.bin_dir, "querybts")
reportbug = scaffold.make_module_from_file(module_name, module_file_path)

Loading…
Cancel
Save