diff options
Diffstat (limited to 'doc/tools/convert_papermode_to_metadata.py')
-rwxr-xr-x | doc/tools/convert_papermode_to_metadata.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/tools/convert_papermode_to_metadata.py b/doc/tools/convert_papermode_to_metadata.py index 61427c83..e73df344 100755 --- a/doc/tools/convert_papermode_to_metadata.py +++ b/doc/tools/convert_papermode_to_metadata.py @@ -14,10 +14,9 @@ import json import os import sys -if sys.version < '3.': - getuserinput = raw_input -else: - getuserinput = input +if sys.version_info[0] < 3: + input = raw_input # NOQA pylint: disable=undefined-variable,redefined-builtin,invalid-name + FIELDS = ["name", "year", "title", "authors", "url"] @@ -30,7 +29,7 @@ def replace(source, target): # Ask for user confirmation if the target file already exists if os.path.exists(target): sys.stdout.write("Warning: target file `%s' exists! Overwrite? [y/N]") - userinput = getuserinput() + userinput = input() if not (userinput.startswith("y") or userinput.startswith("Y")): print("Skipping file `%s'" % source) return @@ -63,6 +62,7 @@ def replace(source, target): else: print("Skipping writing `%s' due to a lack of data" % target) + if __name__ == "__main__": if set(['--help', '-h']) & set(sys.argv[1:]): print(__doc__.strip()) |