diff options
author | Wu Xiaotian <[email protected]> | 2020-06-22 00:01:07 +0000 |
---|---|---|
committer | mbkma <[email protected]> | 2023-01-05 19:22:19 +0100 |
commit | b724befdb6e61f97b44d04b9d55bc690aee5069f (patch) | |
tree | 6320fde2efb89bdd442119c6a0f44c691e1244b5 /tools/generate-plugin.py | |
parent | f628a6ef38b7c42febf8fbc450d46ab1f5461f6f (diff) | |
download | pluma-b724befdb6e61f97b44d04b9d55bc690aee5069f.tar.bz2 pluma-b724befdb6e61f97b44d04b9d55bc690aee5069f.tar.xz |
tools: update to use python3
Diffstat (limited to 'tools/generate-plugin.py')
-rwxr-xr-x | tools/generate-plugin.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tools/generate-plugin.py b/tools/generate-plugin.py index 151a8f31..073f5104 100755 --- a/tools/generate-plugin.py +++ b/tools/generate-plugin.py @@ -1,11 +1,11 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # generate-plugin.py - pluma plugin skeletton generator # This file is part of pluma # # Copyright (C) 2006 - Steve Frécinaux -# Copyright (C) 2012-2021 MATE Developers +# Copyright (C) 2012-2022 MATE Developers # # pluma is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -82,14 +82,14 @@ try: 'with-bottom-pane' , 'without-bottom-pane', 'with-config-dlg' , 'without-config-dlg', 'help']) -except getopt.error, exc: - print >>sys.stderr, '%s: %s' % (sys.argv[0], str(exc)) - print >>sys.stderr, USAGE +except getopt.error as exc: + print('%s: %s' % (sys.argv[0], str(exc)), file=sys.stderr) + print(USAGE, file=sys.stderr) sys.exit(1) for opt, arg in opts: if opt in ('-h', '--help'): - print >>sys.stderr, HELP + print(HELP, file=sys.stderr) sys.exit(0) elif opt in ('--description', '--author', '--email'): @@ -109,7 +109,7 @@ for opt, arg in opts: # What's the new plugin name ? if len(args) < 1: - print >>sys.stderr, USAGE + print(USAGE, file=sys.stderr) sys.exit(1) plugin_name = args[0] @@ -129,15 +129,15 @@ directives = { # Files to be generated by the preprocessor, in the form "template : outfile" output_files = { 'Makefile.am': '%s/Makefile.am' % plugin_module, - 'pluma-plugin.desktop.in': '%s/%s.pluma-plugin.desktop.in' % (plugin_module, plugin_module) + 'pluma-plugin.desktop.in': '%s/%s.plugin.desktop.in.in' % (plugin_module, plugin_module) } if options['language'] == 'c': output_files['pluma-plugin.c'] = '%s/%s-plugin.c' % (plugin_module, plugin_module) output_files['pluma-plugin.h'] = '%s/%s-plugin.h' % (plugin_module, plugin_module) else: - print >>sys.stderr, 'Value of --language should be C' - print >>sys.stderr, USAGE + print('Value of --language should be C', file=sys.stderr) + print(USAGE, file=sys.stderr) sys.exit(1) if options['standalone']: @@ -157,15 +157,15 @@ if options['with-config-dlg']: # Generate the plugin base -for infile, outfile in output_files.iteritems(): - print 'Processing %s\n' \ - ' into %s...' % (infile, outfile) +for infile, outfile in output_files.items(): + print('Processing %s\n' \ + ' into %s...' % (infile, outfile)) infile = os.path.join(TEMPLATE_DIR, infile) outfile = os.path.join(os.getcwd(), outfile) if not os.path.isfile(infile): - print >>sys.stderr, 'Input file does not exist : %s.' % os.path.basename(infile) + print('Input file does not exist : %s.' % os.path.basename(infile), file=sys.stderr) continue # Make sure the destination directory exists @@ -178,6 +178,6 @@ for infile, outfile in output_files.iteritems(): # Generate the file preprocessor.process(infile, outfile, directives.copy()) -print 'Done.' +print('Done.') # ex:ts=4:et: |