diff -Nru fvwm-crystal-3.4.1+dfsg/debian/changelog fvwm-crystal-3.4.1+dfsg/debian/changelog --- fvwm-crystal-3.4.1+dfsg/debian/changelog 2020-08-03 06:19:33.000000000 +0000 +++ fvwm-crystal-3.4.1+dfsg/debian/changelog 2020-08-23 10:58:04.000000000 +0000 @@ -1,3 +1,9 @@ +fvwm-crystal (3.4.1+dfsg-3) unstable; urgency=medium + + * d/menu: convert creatmenu.py script to Python 3 (Closes: #945673) + + -- Vincent Bernat Sun, 23 Aug 2020 12:58:04 +0200 + fvwm-crystal (3.4.1+dfsg-2) unstable; urgency=medium * d/control: B-D on python2 (Closes: #966735) diff -Nru fvwm-crystal-3.4.1+dfsg/debian/control fvwm-crystal-3.4.1+dfsg/debian/control --- fvwm-crystal-3.4.1+dfsg/debian/control 2020-08-03 06:19:33.000000000 +0000 +++ fvwm-crystal-3.4.1+dfsg/debian/control 2020-08-23 10:58:04.000000000 +0000 @@ -11,7 +11,7 @@ Package: fvwm-crystal Architecture: all -Depends: ${misc:Depends}, python2, +Depends: ${misc:Depends}, python3, fvwm (>= 1:2.5.13), rxvt-unicode | x-terminal-emulator, imagemagick, trayer | stalonetray, hsetroot, diff -Nru fvwm-crystal-3.4.1+dfsg/debian/createmenu.py fvwm-crystal-3.4.1+dfsg/debian/createmenu.py --- fvwm-crystal-3.4.1+dfsg/debian/createmenu.py 2020-08-03 06:19:33.000000000 +0000 +++ fvwm-crystal-3.4.1+dfsg/debian/createmenu.py 2020-08-23 10:58:04.000000000 +0000 @@ -1,5 +1,4 @@ -#!/usr/bin/env python2 -# -*- encoding: iso-8859-15 -*- +#!/usr/bin/env python3 # (c) Copyright 2008 Vincent Bernat # and licensed under GPL @@ -10,8 +9,8 @@ # Here is what we should have: -# text|*|/usr/bin/emacs22 -nw|*|Emacs 22 (text)|*|/debian/Applications/Éditeurs|*|/usr/share/emacs/22.2/etc/images/icons/emacs_32.xpm -# x11|*|/usr/bin/emacs22|*|Emacs 22 (X11)|*|/debian/Applications/Éditeurs|*|/usr/share/emacs/22.2/etc/images/icons/emacs_32.xpm +# text|*|/usr/bin/emacs22 -nw|*|Emacs 22 (text)|*|/debian/Applications/Editeurs|*|/usr/share/emacs/22.2/etc/images/icons/emacs_32.xpm +# x11|*|/usr/bin/emacs22|*|Emacs 22 (X11)|*|/debian/Applications/Editeurs|*|/usr/share/emacs/22.2/etc/images/icons/emacs_32.xpm import os @@ -35,7 +34,7 @@ if char in ["-", "_", ".", "(", ")", ",", "+"]: return char return "_" -transtable = "".join([trans(chr(x)) for x in range(0,256)]) +transtable = "".join([trans(chr(x)) for x in range(0, 256)]) def remove(base): for top in [base, DM_ICONBASE]: @@ -65,7 +64,7 @@ filename = "%s%s/~%s~%s" % (base, section, shortcommand, title) if not os.path.isdir(os.path.dirname(filename)): os.makedirs(os.path.dirname(filename)) - target = file(filename, "w") + target = open(filename, "w") target.write("""#!/bin/sh # This file has been generated automatically by fvwm-crystal # update-menus method. Do not edit it. Any change will be lost. @@ -129,17 +128,17 @@ def usage(): - print >>sys.stderr, "%s [--install|--remove] base" % sys.argv[0] + print("%s [--install|--remove] base" % sys.argv[0], file=sys.stderr) if __name__ == "__main__": try: opts, args = getopt.getopt(sys.argv[1:], 'hi:r:', ["help", "install=", "remove="]) - except getopt.GetoptError, err: - print >>sys.stderr, str(err) + except getopt.GetoptError as err: + print(str(err), file=sys.stderr) usage() sys.exit(2) if args: - print "Don't know what to do with %s" % " ".join(args) + print("Don't know what to do with %s" % " ".join(args)) usage() sys.exit(1) for o, a in opts: diff -Nru fvwm-crystal-3.4.1+dfsg/debian/fvwm-crystal.menu-method fvwm-crystal-3.4.1+dfsg/debian/fvwm-crystal.menu-method --- fvwm-crystal-3.4.1+dfsg/debian/fvwm-crystal.menu-method 2020-08-03 06:19:33.000000000 +0000 +++ fvwm-crystal-3.4.1+dfsg/debian/fvwm-crystal.menu-method 2020-08-23 10:58:04.000000000 +0000 @@ -37,7 +37,7 @@ prerun="rm -rf " prefix() rootsection(); # all menu files must be executable to show up in the menu -postrun="python /usr/share/fvwm-crystal/debian/createmenu.py --install " prefix(); +postrun="python3 /usr/share/fvwm-crystal/debian/createmenu.py --install " prefix(); # executed upon update-menus --remove -removemenu="python /usr/share/fvwm-crystal/debian/createmenu.py --remove " prefix(); +removemenu="python3 /usr/share/fvwm-crystal/debian/createmenu.py --remove " prefix();