diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-05-05 20:31:16 +0100 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-05-05 20:31:16 +0100 |
commit | cf383257f7abe863ddca8eabb20464409c7f0e53 (patch) | |
tree | 1ce054ca323e24c7406c2f544cc8a1e3b7e074bc | |
parent | 168171fc34e65879fd6d25a9e4795caabc0e0af8 (diff) | |
download | pykolab-cf383257f7abe863ddca8eabb20464409c7f0e53.tar.gz |
Correct running in unbuffered mode
-rw-r--r-- | pykolab/utils.py | 10 | ||||
-rwxr-xr-x | setup-kolab.py | 2 |
2 files changed, 1 insertions, 11 deletions
diff --git a/pykolab/utils.py b/pykolab/utils.py index c40b252..0ba203a 100644 --- a/pykolab/utils.py +++ b/pykolab/utils.py @@ -35,11 +35,6 @@ def ask_question(question, default="", password=False): Usage: pykolab.utils.ask_question("What is the server?", default="localhost") """ - - # Remove any buffering that may exist - sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0) - sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) - if password: if default == "": answer = getpass.getpass("%s: " % (question)) @@ -62,11 +57,6 @@ def ask_confirmation(question, default="y", all_inclusive_no=True): and a "yes" or "no" parsing that can either require an explicit, full "yes" or "no", or take the default or any YyNn answer. """ - - # Remove any buffering that may exist - sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0) - sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) - if default in [ "y", "Y" ]: default_answer = True default_no = "n" diff --git a/setup-kolab.py b/setup-kolab.py index edb9f90..34818a7 100755 --- a/setup-kolab.py +++ b/setup-kolab.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -tt +#!/usr/bin/python -u # -*- coding: utf-8 -*- # # Copyright 2010-2012 Kolab Systems AG (http://www.kolabsys.com) |