From f651c980dd40c59850d1e97a6f01c980676c9490 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 1 Dec 2013 23:23:59 -0500 Subject: [PATCH] graphics: Fix textgen with Python 2. Previous fix for Python 3 broke the script under Python 2. --- graphics/text/textgen | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/graphics/text/textgen b/graphics/text/textgen index 582f3f9e..3e10c625 100755 --- a/graphics/text/textgen +++ b/graphics/text/textgen @@ -36,6 +36,7 @@ from glob import glob from os import remove +from sys import stdout from tempfile import mktemp import subprocess import re @@ -82,14 +83,16 @@ def invoke_command(command): """ for arg in command: if arg.startswith('-'): - print("\\\n ", end='') + stdout.write("\\\n ") - if ' ' in arg: - print("'%s'" % arg, end=' ') + if ' ' in arg or '#' in arg: + stdout.write(repr(arg)) else: - print(arg, end=' ') + stdout.write(arg) - print() + stdout.write(' ') + + stdout.write('\n') return subprocess.call(command) class Font(object):