diff options
author | Benjamin Berg <benjamin@sipsolutions.net> | 2010-03-30 18:21:04 +0200 |
---|---|---|
committer | Benjamin Berg <benjamin@sipsolutions.net> | 2010-03-30 18:21:04 +0200 |
commit | 94534bdbf85dbde0e4aa35b379fa4dd66d48d3ed (patch) | |
tree | 7c749a2ad97cbe3735e13997f26e08c2fa35e967 | |
parent | e01d845d0a790d487505c01efa7847c56c7a8e2c (diff) | |
download | adwaita-icon-theme-94534bdbf85dbde0e4aa35b379fa4dd66d48d3ed.tar.gz |
Better logic in the render script to wait for the inkscape prompt.
-rwxr-xr-x | render-icon-theme.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/render-icon-theme.py b/render-icon-theme.py index 0502a92c4..0f6c61382 100755 --- a/render-icon-theme.py +++ b/render-icon-theme.py @@ -14,12 +14,16 @@ def wait_for_prompt(process, command=None): if command is not None: process.stdin.write(command+'\n') + # This is kinda ugly ... + # Wait for just a '>', or '\n>' if some other char appearead first output = process.stdout.read(1) + if output == '>': + return + output += process.stdout.read(1) - while output != "\n>": - output = output[-1:] output += process.stdout.read(1) + output = output[1:] def start_inkscape(): process = subprocess.Popen([INKSCAPE, '--shell'], bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE) |