update question on set_var

This commit is contained in:
Matthieu Lamalle 2021-09-02 10:09:16 +02:00
parent f081522e1e
commit 84834a228f

View File

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys, getpass, socket, cjson, os import sys, getpass, socket, cjson, os
from pyeole.ihm import print_line from pyeole.ihm import print_line, question_ouinon
from pyeole.ansiprint import print_orange, print_red from pyeole.ansiprint import print_orange, print_red
from creole.client import CreoleClient from creole.client import CreoleClient
from collections import OrderedDict from collections import OrderedDict
@ -66,14 +66,12 @@ def main():
fh.write(cjson.encode(store)) fh.write(cjson.encode(store))
fh.close() fh.close()
to_save = ""
if save is None : if save is None :
to_save = raw_input("Souhaitez vous sauvegarder la configuration sur Zephir ? (O/N) ") if question_ouinon("Souhaitez vous sauvegarder la configuration sur Zephir ?", default='non') == 'oui':
if to_save == "O":
save = True
print("Sauvegarde de la configuration sur zephir") print("Sauvegarde de la configuration sur zephir")
elif to_save == "N": save=True
print("La configuration ne sera pas sauvegardé sur le zephir") else:
print("La configuration ne sera pas sauvegardé sur zephir")
if save: if save:
cmd="""/usr/share/zephir/scripts/zephir_client save_files""" cmd="""/usr/share/zephir/scripts/zephir_client save_files"""