diff options
author | Von Random <von@vdrandom.org> | 2016-10-31 20:16:54 +0300 |
---|---|---|
committer | Von Random <von@vdrandom.org> | 2016-10-31 20:16:54 +0300 |
commit | d2ded008d24a39dc743f3ee26198cdad80031caf (patch) | |
tree | 143c2868517cbf9e3be8807515fd2563dba10856 | |
parent | 75beff26103e0b25c2ccb80da0186f5241efb08d (diff) |
enable unbuffered print instead of using shebang
(requires python 3.3+)
-rwxr-xr-x | vdstatus | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,4 +1,4 @@ -#!/usr/bin/python3 -u +#!/usr/bin/python3 # TODO: handle SIGINT properly # TODO: add documentation / comments # TODO: add a dummy plugin to use as a starting point @@ -54,7 +54,7 @@ def run_plugins(config_file=DEFAULT_CONFIG): output_format = configuration.get('main', 'format', fallback='term') if output_format == 'i3': - print('{"version":1}\n[') + print('{"version":1}\n[', flush=True) format_outputs = format_i3wm # default to terminal output else: @@ -72,7 +72,7 @@ def run_plugins(config_file=DEFAULT_CONFIG): for plugin in plugins_l: if not plugin.hide: outputs.append(plugin.status) - print(format_outputs(outputs)) + print(format_outputs(outputs), flush=True) time.sleep(1) |