Browse Source

More Pythonics util.print_error

283
Amir Taaki 13 years ago
parent
commit
2598e89d00
  1. 2
      lib/gui_lite.py
  2. 7
      lib/util.py

2
lib/gui_lite.py

@ -491,7 +491,7 @@ class MiniActuator:
try: try:
theme_prefix, theme_path = self.themes[self.theme_name] theme_prefix, theme_path = self.themes[self.theme_name]
except KeyError: except KeyError:
util.print_error("Theme not found! ", self.theme_name) util.print_error("Theme not found!", self.theme_name)
return return
QDir.setCurrent(os.path.join(theme_prefix, theme_path)) QDir.setCurrent(os.path.join(theme_prefix, theme_path))
with open(rsrc("style.css")) as style_file: with open(rsrc("style.css")) as style_file:

7
lib/util.py

@ -3,10 +3,9 @@ import platform
import sys import sys
def print_error(*args): def print_error(*args):
"""Print out the arguments to standard error.""" # Stringify args
for item in args: args = [str(item) for item in args]
sys.stderr.write(str(item)) sys.stderr.write(" ".join(args) + "\n")
sys.stderr.write("\n")
sys.stderr.flush() sys.stderr.flush()
def appdata_dir(): def appdata_dir():

Loading…
Cancel
Save