diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2011-05-02 16:36:32 +0200 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2011-05-02 16:36:32 +0200 |
commit | b33ba4ac19575dee30c6dff5e8b0ff0a9147298b (patch) | |
tree | be03497b2a32e3f7ba30c2bc40a0ad05c5fa4a07 | |
parent | f53444b10fcbc03f88f7f1f797abaeaa587f1006 (diff) | |
download | abrt-b33ba4ac19575dee30c6dff5e8b0ff0a9147298b.tar.gz abrt-b33ba4ac19575dee30c6dff5e8b0ff0a9147298b.tar.xz abrt-b33ba4ac19575dee30c6dff5e8b0ff0a9147298b.zip |
list-dsos: added package install time trac#123
- also clened-up the python code a bit
- removed support for gettext
-rwxr-xr-x | src/plugins/abrt-action-list-dsos.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/plugins/abrt-action-list-dsos.py b/src/plugins/abrt-action-list-dsos.py index 8b8a06ab..40cb32cc 100755 --- a/src/plugins/abrt-action-list-dsos.py +++ b/src/plugins/abrt-action-list-dsos.py @@ -7,13 +7,6 @@ import os import getopt import rpm -GETTEXT_PROGNAME = "abrt" -import locale -import gettext - -_ = lambda x: gettext.lgettext(x) - - def log(s): sys.stderr.write("%s\n" % s) @@ -22,13 +15,13 @@ def error_msg(s): def error_msg_and_die(s): sys.stderr.write("%s\n" % s) - os.exit(1) + sys.exit(1) def xopen(name, mode): try: r = open(name, mode) except IOError, e: - error_msg_and_die("Can't open '%s': %s" % (name, e)); + error_msg_and_die("Can't open '%s': %s" % (name, e)) return r @@ -37,11 +30,11 @@ def parse_maps(maps_path): f = xopen(maps_path, "r") return [x.strip()[x.find('/'):] for x in f.readlines() if x.find('/') > -1] except IOError, e: - error_msg_and_die("Can't read '%s': %s" % (name, e)); + error_msg_and_die("Can't read '%s': %s" % (maps_path, e)) if __name__ == "__main__": progname = os.path.basename(sys.argv[0]) - help_text = _("Usage: %s [-o OUTFILE] -m PROC_PID_MAP_FILE") % progname + help_text = ("Usage: %s [-o OUTFILE] -m PROC_PID_MAP_FILE") % progname try: opts, args = getopt.getopt(sys.argv[1:], "o:m:h", ["help"]) except getopt.GetoptError, err: @@ -63,7 +56,7 @@ if __name__ == "__main__": memfile = arg if not memfile: - error_msg(_("MAP_FILE is not specified")) + error_msg("MAP_FILE is not specified") error_msg_and_die(help_text) try: @@ -81,10 +74,15 @@ if __name__ == "__main__": if outname: outfile = xopen(outname, "w") outname = None - outfile.write("%s %s (%s)\n" % (path, h[rpm.RPMTAG_NEVRA], h[rpm.RPMTAG_VENDOR])) + outfile.write("%s %s (%s) %s\n" % + (path, + h[rpm.RPMTAG_NEVRA], + h[rpm.RPMTAG_VENDOR], + h[rpm.RPMTAG_INSTALLTIME]) + ) except Exception, ex: - error_msg_and_die("Can't get the DSO list: %s", ex) + error_msg_and_die("Can't get the DSO list: %s" % ex) outfile.close() except: |