[Reportbug-commits] r633 - in branches/manual_merge (8 files)

morph-guest at users.alioth.debian.org morph-guest at users.alioth.debian.org
Sat Aug 16 23:25:50 UTC 2008


    Date: Saturday, August 16, 2008 @ 23:25:49
  Author: morph-guest
Revision: 633

cherry picking bin/ po4a/ check/ and . dirs

Added:
  branches/manual_merge/README.source
  branches/manual_merge/setup.py
Modified:
  branches/manual_merge/TODO
  branches/manual_merge/bin/querybts
  branches/manual_merge/bin/reportbug
  branches/manual_merge/checks/compare_pseudo-pkgs_lists.py
  branches/manual_merge/po4a/po4a.cfg
  branches/manual_merge/presubj

Added: branches/manual_merge/README.source
===================================================================
--- branches/manual_merge/README.source	                        (rev 0)
+++ branches/manual_merge/README.source	2008-08-16 23:25:49 UTC (rev 633)
@@ -0,0 +1,106 @@
+Source layout
+=============
+
+The source tree for ``reportbug`` is organised this way:
+
+* Top level
+
+  * Manual pages.
+
+* Debian packaging
+
+  * ``debian/`` contains the control files used to build the Debian
+    source and binary packages.
+
+* `Programs`_
+
+  * ``bin/`` contains the end-user programs (e.g. ``reportbug``,
+    ``querybts``).
+
+* `Libraries`_
+
+  * ``reportbug/`` contains the Python library module package used by
+    the programs.
+
+* `Unit testing framework`_
+
+  * ``test/`` contains the unit test suite. Unit test modules are
+    discovered and run using the ``nosetests`` program, and are named
+    as ``test_*.py``.
+
+* `Internal checking framework`_
+
+  * ``checks/`` contains various scripts that ensure reportbug's
+    internals are up-to-date with the Debian BTS.
+
+* Internationalisation and localisation
+
+  * ``po4a/`` contains configuration and data for localisation of
+    source files using the ``po4a`` tool.
+
+Unit testing framework
+======================
+
+The reportbug source package now has a unit testing framework.
+
+The directory ``test/`` contains unit test modules and supporting
+files. New unit test modules should be added to this directory and
+named ``test_*.py``.
+
+The unit test suite depends on the `python-nose` package being
+installed, to make the ``nosetests`` command available. The unit tests
+themselves can be written using either the `unittest` or `doctest`
+modules in the standard Python library.
+
+The `scaffold` module (from the ``test/scaffold.py`` file) contains
+some helper functionality for unit tests, including an extended
+`TestCase` class.
+
+``make`` targets for testing and quality checks
+-----------------------------------------------
+
+The following ``make`` targets are useful for testing and related
+tasks.
+
+* ``make test`` runs the unit test suite, preceded by a timestamp
+  banner, and reports any test failures or "OK" if all tests pass.
+
+* ``make test-continuous`` starts a loop which clears the screen, runs
+  ``make test``, then waits for any of the tests or source code to
+  change, and starts the loop again.
+
+  This is useful to run in a separate terminal during a development
+  session, so that whenever a change is made the test suite will be
+  run automatically. You might want to keep the window hidden while
+  actually editing files, and only look at it when you've created or
+  modified a file and want to check its effect on the test run.
+
+  This uses the ``inotifywait`` command from the `inotify-tools`
+  package to wait for `create` and `modify` events.
+
+* ``make coverage`` runs the test suite and collects test coverage
+  information, then reports the current statement coverage of the test
+  suite.
+
+  This requires the `python-coverage` package to be installed. See its
+  documentation for more about its operation.
+
+* ``make pyflakes`` runs the `pyflakes` static code checker on all
+  Python files found in the project tree.
+
+  This requires the `pyflakes` package to be installed. See its
+  documentation for more about its operation.
+
+* ``make pylint`` runs the `pylint` code checker on all code modules
+  and programs.
+
+  This requires the `pylint` package to be installed. See its
+  documentation for more about its operation.
+
+
+..
+    Local Variables:
+    coding: utf-8
+    mode: rst
+    End:
+    vim: filetype=rst :

Modified: branches/manual_merge/TODO
===================================================================
--- branches/manual_merge/TODO	2008-08-16 23:09:20 UTC (rev 632)
+++ branches/manual_merge/TODO	2008-08-16 23:25:49 UTC (rev 633)
@@ -1,17 +1,20 @@
-TODO list for reportbug 4.0 (lenny):
+TODO list for reportbug 4.0 (lenny+1):
 
-1. Proper GNOME interface.  My current thinking is to hack the
-   bug-buddy Glade file to pieces, or do something similar in straight
-   PyGTK, and give up on the whole "UI abstraction" nonsense for now.
+0. revisit README.developers source code layout section
 
+1. (We have one, but it needs to be updated.) Proper GNOME interface.
+   My current thinking is to hack the bug-buddy Glade file to pieces,
+   or do something similar in straight PyGTK, and give up on the whole
+   "UI abstraction" nonsense for now.
+
    (To give you an idea of the limitations of the GNOME Druid widget,
    bug-buddy doesn't even use a Druid... instead, it's a giant
    notebook hack that emulates a Druid in appearance.)
 
-2. Convert the modules to a proper package and stick it in the Python
-   search path (per #157079).  Reform the names.  Rename
-   "reportbug.py" to something sensible.  This probably has to be done
-   before #1 can happen.
+2. (In progress.)  Convert the modules to a proper package and stick
+   it in the Python search path (per #157079).  Reform the names.
+   Rename "reportbug.py" to something sensible.  This probably has to
+   be done before #1 can happen.
 
    (Not sure of a good approach here.  Maybe we should have a class
    that carries around all the information for a bug report, and be
@@ -34,11 +37,13 @@
    them... unless we figure out some way to get bug reports translated
    for maintainers.)
 
-5. Convert BTS code to use the mbox-format reports if available, as
-   they should be easier to parse.
+5. (This is already done, I believe.) Convert BTS code to use the
+   mbox-format reports if available, as they should be easier to
+   parse.
 
-6. Alternatively, cajole the BTS maintainers into producing an XML
-   serialization of the BTS data.  (See #184983)
+6. (SOAP is here, we need to integrate it.)  Alternatively, cajole the
+   BTS maintainers into producing an XML serialization of the BTS
+   data.  (See #184983)
 
 7. Allow followups from the command line using a specific bug number,
    rather than requiring people to go through the browser.  Coupled

Modified: branches/manual_merge/bin/querybts
===================================================================
--- branches/manual_merge/bin/querybts	2008-08-16 23:09:20 UTC (rev 632)
+++ branches/manual_merge/bin/querybts	2008-08-16 23:25:49 UTC (rev 633)
@@ -2,7 +2,7 @@
 # -*- python -*-
 # querybts - Examine the state of a debbugs server
 #   Written by Chris Lawrence <lawrencc at debian.org>
-#   (C) 1999-2006 Chris Lawrence
+#   (C) 1999-2008 Chris Lawrence
 #
 # This program is freely distributable per the following license:
 #
@@ -24,25 +24,24 @@
 #
 # $Id: querybts,v 1.7.2.3 2008-04-18 05:38:27 lawrencc Exp $
 
-import sys, os
-sys.path = ['/usr/share/reportbug'] + sys.path
-
+import sys
+import os
 import getopt
 import re
 
-from reportbuglib import reportbug
-from reportbuglib.reportbug_exceptions import (
+from reportbug import utils
+from reportbug.exceptions import (
     UINotImportable,
     NoPackage, NoBugs, NoReport, NoNetwork,
     )
-from reportbuglib import debianbts
-from reportbuglib import urlutils
+from reportbug import debianbts
+from reportbug import urlutils
 
 try:
-    from reportbuglib import reportbug_ui_newt as ui
+    import reportbug.ui.newt as ui
     ui_mode = 'newt'
 except:
-    from reportbuglib import reportbug_ui_text as ui
+    import reportbug.ui.text as ui
     ui_mode = 'text'
 
 VERSION = "querybts ##VERSION##"
@@ -67,7 +66,7 @@
     mirrors = None
     mbox = False
 
-    args = reportbug.parse_config_files()
+    args = utils.parse_config_files()
     for option, arg in args.items():
         if option == 'system':
             system = arg
@@ -105,7 +104,7 @@
         elif option in ('-s', '--source'):
             source = True
         elif option in ('-u', '--ui', '--interface'):
-            if arg in reportbug.AVAILABLE_UIS:
+            if arg in utils.AVAILABLE_UIS:
                 interface = arg
             elif arg == 'help':
                 print 'Permitted arguments to --ui:\n'\

Modified: branches/manual_merge/bin/reportbug
===================================================================
--- branches/manual_merge/bin/reportbug	2008-08-16 23:09:20 UTC (rev 632)
+++ branches/manual_merge/bin/reportbug	2008-08-16 23:25:49 UTC (rev 633)
@@ -2,34 +2,33 @@
 # -*- python -*-
 # reportbug - Report a bug in the Debian distribution.
 #   Written by Chris Lawrence <lawrencc at debian.org>
-#   Copyright (C) 1999-2007 Chris Lawrence
+#   Copyright (C) 1999-2008 Chris Lawrence
 #
 # This program is freely distributable per the following license:
 #
-LICENSE="""\
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appears in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation.
-
-I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL I
-BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
-DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE."""
+##  Permission to use, copy, modify, and distribute this software and its
+##  documentation for any purpose and without fee is hereby granted,
+##  provided that the above copyright notice appears in all copies and that
+##  both that copyright notice and this permission notice appear in
+##  supporting documentation.
+##
+##  I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+##  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL I
+##  BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+##  DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+##  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+##  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.33 2008-04-18 05:38:27 lawrencc Exp $
 
 DEBUGGER = 'lawrencc at debian.org'
 DEFAULT_BTS = 'debian'
 
-import sys, os
-sys.path = ['/usr/share/reportbug'] + sys.path
-
+import sys
+import os
 import optparse
 import re
 import locale
@@ -38,25 +37,25 @@
 import gettext
 import textwrap
 
-from reportbuglib import reportbug
-from reportbuglib.reportbug import (
+from reportbug import utils
+from reportbug.utils import (
     VERSION, COPYRIGHT,
     MODE_EXPERT, MODE_ADVANCED, MODE_NOVICE, MODE_STANDARD,
     )
-from reportbuglib.rbtempfile import (
+from reportbug.tempfiles import (
     TempFile,
     tempfile_prefix,
     cleanup_temp_file,
     )
-from reportbuglib.reportbug_exceptions import (
+from reportbug.exceptions import (
     UINotImportable, UINotImplemented,
     NoNetwork, NoPackage, NoBugs, NoReport,
     )
-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
+from reportbug import submit
+from reportbug import checkversions
+from reportbug import debianbts
+from reportbug import checkbuildd
+import reportbug.ui.text as ui
 
 try:
     gettext.install('reportbug')
@@ -122,7 +121,7 @@
         """
     if inline:
         try:
-            fp = file(include_filename)
+            fp = open(include_filename)
             message += '\n*** %s\n%s' % (
                        include_filename.decode(charset, 'replace'),
                        fp.read().decode(charset, 'replace'))
@@ -145,7 +144,7 @@
                    editor=None, charset='utf-8'):
     if not editor:
         editor = options.editor
-    editor = reportbug.which_editor(editor)
+    editor = utils.which_editor(editor)
     message = None
     skip_editing = False
     while True:
@@ -164,7 +163,7 @@
                     stopmsg(filename)
                     sys.exit(1)
 
-            message = file(filename).read().decode(charset, 'replace')
+            message = open(filename).read().decode(charset, 'replace')
             changed = True
 
         prompt = 'Submit this report on %s (e to edit)' % package
@@ -238,12 +237,12 @@
             if ed:
                 editor = ed
         elif x == 'm':
-            mailers = [(x, '') for x in reportbug.MUA.keys()]
+            mailers = [(x, '') for x in utils.MUA.keys()]
             mailers.sort()
             mailer = ui.menu('Choose a mailer for your report', mailers,
                              'Select mailer: ', default='', empty_ok=True)
             if mailer:
-                mailer = reportbug.MUA.get(mailer)
+                mailer = utils.MUA.get(mailer)
                 if mailer:
                     options.mua = mailer
                     break
@@ -276,11 +275,11 @@
             else:
                 break
 
-    return file(filename).read()
+    return open(filename).read()
 
 def find_package_for(filename, notatty=False, pathonly=False):
     ewrite("Finding package for '%s'...\n", filename)
-    (newfilename, packages) = reportbug.find_package_for(filename, pathonly)
+    (newfilename, packages) = utils.find_package_for(filename, pathonly)
     if newfilename != filename:
         filename = newfilename
         ewrite("Resolved as '%s'.\n", filename)
@@ -423,15 +422,14 @@
                         'the first time you have used reportbug, we are '
                         'configuring its behavior.  These settings will be '
                         'saved to the file "%s", which you will be free to '
-                        'edit further.\n\n', reportbug.USERFILE)
+                        'edit further.\n\n', utils.USERFILE)
     mode = ui.menu('Please choose the default operating mode for reportbug.',
-                   reportbug.MODES, 'Select mode: ', options.mode,
-                   order=reportbug.MODELIST)
-
+                   utils.MODES, 'Select mode: ', options.mode,
+                   order=utils.MODELIST)
     uis = dict()
-    for i in reportbug.AVAILABLE_UIS:
-        if (i in reportbug.UIS) and i != 'newt':
-            uis[i] = reportbug.UIS[i]
+    for i in utils.AVAILABLE_UIS:
+        if (i in utils.UIS) and i != 'newt':
+            uis[i] = utils.UIS[i]
     if len(uis) > 1:
         interface = ui.menu(
             'Please choose the default interface for reportbug.', uis,
@@ -450,7 +448,7 @@
                        'receive mail.',
                        default=(not options.offline))
 
-    def_realname, def_email = reportbug.get_email()
+    def_realname, def_email = utils.get_email()
 
     try:
         if options.realname:
@@ -502,21 +500,21 @@
              'don\'t need a user name.' % smtphost), force_prompt=True)
     else:
         smtpuser = ''
-
-    if os.path.exists(reportbug.USERFILE):
+    
+    if os.path.exists(utils.USERFILE):
         try:
-            os.rename(reportbug.USERFILE, reportbug.USERFILE+'~')
+            os.rename(utils.USERFILE, utils.USERFILE+'~')
         except OSError:
-            ewrite('Unable to rename %s as %s~\n', reportbug.USERFILE,
-                   reportbug.USERFILE)
+            ewrite('Unable to rename %s as %s~\n', utils.USERFILE,
+                   utils.USERFILE)
 
     try:
-        fd = os.open(reportbug.USERFILE, os.O_WRONLY|os.O_TRUNC|os.O_CREAT,
+        fd = os.open(utils.USERFILE, os.O_WRONLY|os.O_TRUNC|os.O_CREAT,
                      0600)
     except OSError, x:
         ui.long_message('Unable to save %s; most likely, you do not have a '
                         'home directory.  Please fix this before using '
-                        'reportbug again.\n', reportbug.USERFILE)
+                        'reportbug again.\n', utils.USERFILE)
         sys.exit(1)
 
     fp = os.fdopen(fd, 'w')
@@ -525,7 +523,7 @@
     print >> fp, '# Version of reportbug this preferences file was written by'
     print >> fp, 'reportbug_version "##VERSION##"'
     print >> fp, '# default operating mode: one of:',
-    print >> fp, ', '.join(reportbug.MODELIST)
+    print >> fp, ', '.join(utils.MODELIST)
     print >> fp, 'mode %s' % mode
     print >> fp, '# default user interface'
     print >> fp, 'ui %s' % interface
@@ -635,9 +633,9 @@
     # the original value as determined by the cascade of command-line options
     # and configuration files.  When we need to adjust a value, we first say
     # "foo = options.foo" and then refer to just `foo'.
-    args = reportbug.parse_config_files()
+    args = utils.parse_config_files()
     for option, arg in args.items():
-        if option in reportbug.CONFIG_ARGS:
+        if option in utils.CONFIG_ARGS:
             if isinstance(arg, unicode):
                 arg = arg.encode(charset, 'replace')
             defaults[option] = arg
@@ -669,7 +667,7 @@
                       dest='sign', const='gpg',
                       help='sign report with GNU Privacy Guard')
     parser.add_option('-G', '--gnus', action='store_const', dest='mua',
-                      const=reportbug.MUA['gnus'],
+                      const=utils.MUA['gnus'],
                       help='send the report using GNUS')
     parser.add_option('--pgp', action='store_const', dest='sign',
                       const='pgp', help='sign report with PGP')
@@ -685,16 +683,16 @@
                       dest='sendto', const='maintonly',
                       help='send the report to the maintainer only')
     parser.add_option('-M', '--mutt', action='store_const', dest='mua',
-                      const=reportbug.MUA['mutt'],
+                      const=utils.MUA['mutt'],
                       help='send the report using mutt')
     parser.add_option('--mirror', action='append', help='add a BTS mirror',
                       dest='mirrors')
     parser.add_option('-a', '--af', action='store_const', dest='mua',
-                      const=reportbug.MUA['af'],
+                      const=utils.MUA['af'],
                       help='send the report using af')
     parser.add_option('-n', '--mh', '--nmh', action='store_const', dest='mua',
                       help='send the report using mh/nmh',
-                      const=reportbug.MUA['mh'])
+                      const=utils.MUA['mh'])
     parser.add_option('--mua', dest='mua',
                       help='send the report using the specified mailer')
     parser.add_option('--mta', dest='mta', help='send the report using the '
@@ -757,7 +755,7 @@
     parser.add_option('-u', '--interface', '--ui', action='callback',
                       callback=verify_option, type='string', dest='interface',
                       callback_args=('Valid user interfaces',
-                                     reportbug.AVAILABLE_UIS),
+                                     utils.AVAILABLE_UIS),
                       help='choose which user interface to use')
     parser.add_option('-Q', '--query-only', action='store_true',
                       dest='queryonly', help='only query the BTS')
@@ -788,7 +786,7 @@
                       'mode for reportbug', callback=verify_option,
                       type='string', dest='mode',
                       callback_args=('Permitted operating modes',
-                                     reportbug.MODES.keys()))
+                                     utils.MODES.keys()))
     parser.add_option('-v', '--verify', action='store_true', help='verify '
                       'integrity of installed package using debsums')
     parser.add_option('--no-verify', action='store_false', dest='verify',
@@ -839,7 +837,7 @@
                             interface, msg)
             ewrite('\n')
 
-        reportbug_submit.ui = ui
+        reportbug.submit.ui = ui
         # Add INTERFACE as an environment variable to access it from the
         # script gathering the special information for reportbug, when
         # a new bug should be filed against it.
@@ -899,7 +897,7 @@
             body = textwrap.fill(self.options.body)
         elif self.options.bodyfile:
             try:
-                body = file(self.options.bodyfile).read()
+                body = open(self.options.bodyfile).read()
             except:
                 ewrite('Unable to read body from file %s.\n', self.options.bodyfile)
                 sys.exit(1)
@@ -950,7 +948,7 @@
             ewrite('Attachments are incompatible with using an MUA.  They will be ignored.\n')
             attachments = []
 
-        if reportbug.first_run():
+        if utils.first_run():
             if not self.args:
                 offer_configuration(self.options)
                 main()
@@ -958,7 +956,7 @@
             else:
                 ewrite('Warning: no reportbug configuration found.  Proceeding in %s mode.\n' % self.options.mode)
 
-        mode = reportbug.MODELIST.index(self.options.mode)
+        mode = utils.MODELIST.index(self.options.mode)
 
         # Disable signatures when in printonly or mua mode
         # (since they'll be bogus anyway)
@@ -989,7 +987,7 @@
                     ewrite("reportbug stopped.\n")
                     sys.exit(1)
 
-        if (reportbug.first_run() and not self.args):
+        if (utils.first_run() and not self.args):
             offer_configuration(self.options)
             ewrite('To report a bug, please rerun reportbug.\n')
             sys.exit(0)
@@ -1034,16 +1032,16 @@
             ewrite("Detected character set: %s\n"
                    "Please change your locale if this is incorrect.\n\n", charset)
 
-        fromaddr = reportbug.get_user_id(self.options.email, self.options.realname, charset)
+        fromaddr = utils.get_user_id(self.options.email, self.options.realname, charset)
         ewrite("Using '%s' as your from address.\n", fromaddr.encode(charset, 'replace'))
         fromaddr = fromaddr.encode('utf-8')
         if self.options.debugmode:
             sendto = fromaddr
 
-        edname = reportbug.which_editor(self.options.editor)
+        edname = utils.which_editor(self.options.editor)
         baseedname = os.path.basename(edname)
         if baseedname == 'sensible-editor':
-            edname = reportbug.realpath('/usr/bin/editor')
+            edname = utils.realpath('/usr/bin/editor')
 
         if not notatty and 'vi' in baseedname and mode < MODE_STANDARD and \
                'EDITOR' not in os.environ:
@@ -1063,7 +1061,7 @@
         if self.options.include:
             for f in self.options.include:
                 if os.path.exists(f):
-                    fp = file(f)
+                    fp = open(f)
                     incfiles = u'%s\n*** %s\n%s' % (
                                incfiles, f.decode('utf-8', 'replace'),
                                fp.read().decode('utf-8', 'replace'))
@@ -1087,7 +1085,7 @@
         if not pkgversion and self.options.querydpkg and \
                sysinfo.get('query-dpkg', True):
             ewrite("Getting status for %s...\n", package)
-            status = reportbug.get_package_status(package)
+            status = utils.get_package_status(package)
 
             pkgavail, installed = status[1], status[6]
             # Packages that only exist to do weird dependency things
@@ -1107,7 +1105,7 @@
                                 package = depends[0]
                         else:
                             opts = [(x,
-                                     (reportbug.get_package_status(x)[11] or
+                                     (utils.get_package_status(x)[11] or
                                       'not installed')) for x in depends]
                             if mode >= MODE_ADVANCED:
                                 opts += [(package,
@@ -1119,12 +1117,12 @@
                                               opts,
                                               'Select one of these packages: ')
                         ewrite("Getting status for %s...\n", package)
-                        status = reportbug.get_package_status(package)
+                        status = utils.get_package_status(package)
                         pkgavail, installed = status[1], status[6]
 
             if not pkgavail and not isvirtual:
                 # Look for a matching source package
-                packages = reportbug.get_source_package(package)
+                packages = utils.get_source_package(package)
                 if len(packages) > 0:
                     src = package
                     if len(packages) and not notatty:
@@ -1145,7 +1143,7 @@
 
                     if package != src:
                         ewrite("Getting status for %s...\n", package)
-                        status = reportbug.get_package_status(package)
+                        status = utils.get_package_status(package)
                         pkgavail, installed = status[1], status[6]
                     elif len(packages) > 1:
                         issource = True
@@ -1153,7 +1151,7 @@
                     ewrite('No matching source or binary packages.\n')
 
             if (not installed and not isvirtual and not issource) and not notatty:
-                packages = reportbug.packages_providing(package)
+                packages = utils.packages_providing(package)
                 tmp = pack = None
                 if not packages:
                     if ui.yes_no(
@@ -1167,7 +1165,7 @@
                         pack = package
                         packages = [(package, '')]
                         ewrite("Getting available info for %s...\n", package)
-                        status = reportbug.get_package_status(package, avail=True)
+                        status = utils.get_package_status(package, avail=True)
                         check_available = False
                         usedavail = True
 
@@ -1187,7 +1185,7 @@
                 if not status and pack:
                     foundfile, package = tmp, pack
                     ewrite("Getting status for %s...\n", package)
-                    status = reportbug.get_package_status(package)
+                    status = utils.get_package_status(package)
                 elif not packages:
                     if not ui.yes_no(
                         'This package does not appear to be installed; continue '
@@ -1205,7 +1203,7 @@
                         efail("No package specified; stopping.\n")
                     else:
                         ewrite("Getting status for %s...\n", package)
-                        status = reportbug.get_package_status(package)
+                        status = utils.get_package_status(package)
             elif not pkgavail and not notatty and not isvirtual and not issource:
                 if not ui.yes_no(
                     'This package does not appear to exist; continue',
@@ -1233,7 +1231,7 @@
 
             if os.path.isfile(buginfo+'/control'):
                 submitas, submitto, reportwith, supplemental = \
-                          reportbug.parse_bug_control_file(buginfo+'/control')
+                          utils.parse_bug_control_file(buginfo+'/control')
         elif os.path.isfile('/usr/share/bug/default/'+package) \
              and os.access('/usr/share/bug/default/'+package, os.X_OK):
             bugexec = '/usr/share/bug/default/'+package
@@ -1248,7 +1246,7 @@
 
             if os.path.isfile(buginfo+'/control'):
                 submitas, submitto, reportwith, supplemental = \
-                          reportbug.parse_bug_control_file(buginfo+'/control')
+                          utils.parse_bug_control_file(buginfo+'/control')
 
         if submitas and (submitas not in reportwith):
             reportwith += [submitas]
@@ -1281,7 +1279,7 @@
                                            '(blank OK)', force_prompt=True)
         elif (check_available and not (self.options.kudos or notatty or self.options.offline)
               and state == 'installed' and bts == 'debian'):
-            arch = reportbug.get_arch()
+            arch = utils.get_arch()
             check_more = (mode > MODE_STANDARD)
             if check_more:
                 ewrite('Checking for newer versions at packages.debian.org,'+
@@ -1432,28 +1430,28 @@
         # Grab dependency list, removing version conditions.
         if (depends or recommends or suggests) and not self.options.kudos:
             ewrite("Looking up dependencies of %s...\n", package)
-            depinfo = (reportbug.get_dependency_info(package, depends) +
-                       reportbug.get_dependency_info(package, recommends, "recommends") +
-                       reportbug.get_dependency_info(package, suggests, "suggests"))
+            depinfo = (utils.get_dependency_info(package, depends) +
+                       utils.get_dependency_info(package, recommends, "recommends") +
+                       utils.get_dependency_info(package, suggests, "suggests"))
 
         if reportwith and not self.options.kudos:
             for extrapackage in reportwith:
                 ewrite("Getting status for related package %s...\n", extrapackage)
-                extrastatus = reportbug.get_package_status(extrapackage)
+                extrastatus = utils.get_package_status(extrapackage)
                 if extrastatus[2]:
                     extradepends = [x for x in extrastatus[2] if package not in x]
                     ewrite("Looking up dependencies of related package %s...\n", extrapackage)
-                    depinfo += reportbug.get_dependency_info(extrapackage, extradepends)
+                    depinfo += utils.get_dependency_info(extrapackage, extradepends)
 
         if supplemental and not self.options.kudos:
             ewrite("Looking up status of additional packages...\n")
-            depinfo += reportbug.get_dependency_info(
+            depinfo += utils.get_dependency_info(
                 package, [[x] for x in supplemental], rel='is related to')
 
         confinfo = []
         if conffiles and not self.options.kudos:
             ewrite("Getting changed configuration files...\n")
-            confinfo, changed = reportbug.get_changed_config_files(
+            confinfo, changed = utils.get_changed_config_files(
                 conffiles, nocompress)
 
             if self.options.noconf and changed:
@@ -1513,7 +1511,7 @@
         ewrite('\n')
         prompted = False
         if interactive and not (self.options.kudos or exinfo) and presubj:
-            ui.display_report(file(presubj).read()+'\n')
+            ui.display_report(open(presubj).read()+'\n')
 
         if self.options.kudos:
             subject = subject or ('Thanks for packaging %s!' % package)
@@ -1718,11 +1716,11 @@
             if not mua:
                 SIGFILE = os.path.join(HOMEDIR, '.signature')
                 try:
-                    message = u"\n\n-- \n"+file(SIGFILE).read().decode('utf-8', 'replace')
+                    message = u"\n\n-- \n"+open(SIGFILE).read().decode('utf-8', 'replace')
                 except IOError:
                     pass
         else:
-            message = reportbug.generate_blank_report(
+            message = utils.generate_blank_report(
                 submitas or package, pkgversion, severity, justification,
                 depinfo, conftext, foundfile, incfiles, bts, exinfo, rtype,
                 klass, subject, tags, body, mode, pseudos)
@@ -1793,12 +1791,12 @@
                     else:
                         break
 
-        body, headers, pseudoheaders = reportbug.cleanup_msg(message,headers,rtype)
+        body, headers, pseudoheaders = utils.cleanup_msg(message,headers,rtype)
 
         if sign:
             ewrite('Passing message to %s for signature...\n', sign)
             oldbody = body
-            body = reportbug_submit.sign_message(body, fromaddr, package, pgp_addr,
+            body = reportbug.submit.sign_message(body, fromaddr, package, pgp_addr,
                                                  sign)
             if not body:
                 ewrite('Signature failed; sending message unsigned.\n')
@@ -1811,7 +1809,7 @@
         # newline in the message.  See #234963.
         body = body.rstrip('\n')+'\n'
 
-        reportbug_submit.send_report(
+        reportbug.submit.send_report(
             body, attachments, mua, fromaddr, sendto, ccaddr, bccaddr,
             headers, package, charset, mailing, sysinfo, rtype, exinfo,
             self.options.replyto, self.options.printonly, self.options.template,

Modified: branches/manual_merge/checks/compare_pseudo-pkgs_lists.py
===================================================================
--- branches/manual_merge/checks/compare_pseudo-pkgs_lists.py	2008-08-16 23:09:20 UTC (rev 632)
+++ branches/manual_merge/checks/compare_pseudo-pkgs_lists.py	2008-08-16 23:25:49 UTC (rev 633)
@@ -8,7 +8,7 @@
 import sys, os
 sys.path = ['.'] + sys.path
 
-import reportbuglib.debianbts as debianbts
+from reportbug import debianbts
 
 import urllib, re
 

Modified: branches/manual_merge/po4a/po4a.cfg
===================================================================
--- branches/manual_merge/po4a/po4a.cfg	2008-08-16 23:09:20 UTC (rev 632)
+++ branches/manual_merge/po4a/po4a.cfg	2008-08-16 23:25:49 UTC (rev 633)
@@ -1,7 +1,7 @@
 [po4a_paths] po4a/po/reportbug.pot fr:po4a/po/fr.po
 [po4a_alias:man] man opt_fr:"-L ISO-8859-15 -A UTF-8"
 
-[type: man] reportbug.1 \
-	fr:reportbug.fr.1 add_fr:po4a/add_fr/reportbug.add
-[type: man] querybts.1 \
-	fr:querybts.fr.1 add_fr:po4a/add_fr/querybts.add
+[type: man] man/reportbug.1 \
+	fr:man/reportbug.fr.1 add_fr:po4a/add_fr/reportbug.add
+[type: man] man/querybts.1 \
+	fr:man/querybts.fr.1 add_fr:po4a/add_fr/querybts.add

Modified: branches/manual_merge/presubj
===================================================================
--- branches/manual_merge/presubj	2008-08-16 23:09:20 UTC (rev 632)
+++ branches/manual_merge/presubj	2008-08-16 23:25:49 UTC (rev 633)
@@ -3,7 +3,7 @@
 EXIM IS CONFIGURED FOR LOCAL DELIVERY: In Debian 4.0 (etch) and later,
    exim4 is configured by default to only deliver email to addresses
    on your system.  YOUR BUG REPORTS WILL NOT ARRIVE AT THE BUG
-   TRACKING SYSTEM UNLESS YOU FOLLOW ONE OF THE FOLLOWING STEPS, either:
+   TRACKING SYSTEM UNLESS YOU FOLLOW ONE OF THE FOLLOWING STEPS:
 
    - Reconfigure exim (using 'dpkg-reconfigure -plow exim4') to send
      mail to the Internet directly or via a smarthost.
@@ -11,6 +11,9 @@
    - Configure reportbug to deliver mail to your ISP's smarthost or
      bugs.debian.org directly (using 'reportbug --configure').
 
+   - Alternatively, see /usr/share/doc/reportbug/README.Users for
+     instructions on how to use GMail's SMTP server to submit reports.
+
 EMAIL ADDRESS SETTING: See the manual page reportbug(1) for how to set
    your email address (i.e. the address that appears in the "From:"
    header), if reportbug is unable to correctly figure it out for you.
@@ -23,3 +26,6 @@
    well.  As an alternative, some mail programs, such as "mutt", can
    be configured to be used as the editor for your report, which you
    may find preferable.
+
+(You may need to press 'q' to exit your pager and continue using
+reportbug at this point.)

Added: branches/manual_merge/setup.py
===================================================================
--- branches/manual_merge/setup.py	                        (rev 0)
+++ branches/manual_merge/setup.py	2008-08-16 23:25:49 UTC (rev 633)
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+#
+# $Id: setup.py,v 1.8 2005/03/04 04:45:44 lordsutch Exp $
+
+from setuptools import setup
+import reportbug
+import os
+import glob
+
+# i18n = []
+# for lang in glob.glob('*.po'):
+#     lang = lang[:-3]
+#     if lang == 'messages':
+#         continue
+#     i18n.append( ('share/locale/%s/LC_MESSAGES' % lang,
+#                   ['i18n/%s/LC_MESSAGES/foomatic-gui.mo' % lang]) )
+
+setup(name='reportbug', version=reportbug.VERSION_NUMBER,
+      description='bug reporting tool',
+      author='reportbug maintainence team',
+      author_email='reportbug-maint at lists.alioth.debian.org',
+      url='http://alioth.debian.org/projects/reportbug',
+      data_files=[('share/reportbug', ['handle_bugscript', 'reportbug.el']),
+                  ('share/bug/reportbug', ['presubj', 'script'])],
+      license='MIT', packages=['reportbug'],
+      scripts=['bin/reportbug', 'bin/querybts'])


Property changes on: branches/manual_merge/setup.py
___________________________________________________________________
Name: svn:executable
   + *




More information about the Reportbug-commits mailing list