fix possible import de client.py

This commit is contained in:
Daniel STAN 2015-06-03 19:44:06 +02:00
parent f826e0ebc6
commit e1eaad381d

View file

@ -33,12 +33,14 @@ try:
sys.path.append(os.path.expanduser("~/.config/%s/" % (bootstrap_cmd_name,))) sys.path.append(os.path.expanduser("~/.config/%s/" % (bootstrap_cmd_name,)))
import clientconfig as config import clientconfig as config
except ImportError: except ImportError:
ducktape_display_error = sys.stderr.isatty() and not any([opt in sys.argv for opt in ["-q", "--quiet"]]) ducktape_display_error = sys.stderr.isatty() and \
not any([opt in sys.argv for opt in ["-q", "--quiet"]]) and \
__name__ == '__main__'
envspecified = os.getenv(envvar, None) envspecified = os.getenv(envvar, None)
if envspecified is None: if envspecified is None:
if ducktape_display_error: if ducktape_display_error:
sys.stderr.write(u"Va lire le fichier README.\n".encode("utf-8")) sys.stderr.write(u"Va lire le fichier README.\n".encode("utf-8"))
sys.exit(1) sys.exit(1)
else: else:
# On a spécifié à la main le dossier de conf # On a spécifié à la main le dossier de conf
try: try: