From 903c6d7612fec637b28a8b78332888862ffdfb1b Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Sep 03 2019 08:05:28 +0000 Subject: [PATCH 1/2] Change shebang of the convenience script to Python 3 --- diff --git a/fedora-business-cards b/fedora-business-cards index 07e3ea2..0fbc1ee 100755 --- a/fedora-business-cards +++ b/fedora-business-cards @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # This file is provided as a conveinence to people using the Git repository. # It is not included in source distributions, and it is created in binary # distributions as a setuptools entry point. From 63b12329895ae436f56fb6a007b76bc25d70810c Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Sep 03 2019 08:06:33 +0000 Subject: [PATCH 2/2] Simplify status prints The Python 2 original with trailing comma and explicit flush: print "Generating front...", sys.stdout.flush() would be best translated as: print("Generating front...", end=" ", flush=True) (file=sys.stdout is the default) but I see no reason to print all status on the same line, possibly making other messages more unreadable. So, change them to simple print(). --- diff --git a/fedora_business_cards/frontend/cmdline.py b/fedora_business_cards/frontend/cmdline.py index 46e6feb..07bb002 100644 --- a/fedora_business_cards/frontend/cmdline.py +++ b/fedora_business_cards/frontend/cmdline.py @@ -137,7 +137,7 @@ def main(): gen.collect_information() # generate front of business card - print("Generating front...", file=sys.stdout, flush=False) + print("Generating front...") xml = gen.generate_front() if options.output == "svg": export.svg_to_file(xml, 'front.' + options.output) @@ -148,7 +148,7 @@ def main(): export.svg_to_pdf_png(xml, 'front.' + options.output, options.output, options.dpi) # generate back of business card - print("Generating back...", file=sys.stdout, flush=False) + print("Generating back...") xml = gen.generate_back() if xml: if options.output == "svg": @@ -162,4 +162,4 @@ def main(): options.output, options.dpi) else: print("(no back generated)") - print("Done.", file=sys.stdout, flush=False) + print("Done.")