From e94cd224f79fe8b1079e85c1a58d8c9a35d3e666 Mon Sep 17 00:00:00 2001 From: godofdream Date: Mon, 5 Nov 2012 21:16:05 +0100 Subject: Reworking Setup --- module/setup/Setup.py | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'module/setup/Setup.py') diff --git a/module/setup/Setup.py b/module/setup/Setup.py index ae177bbb7..ee7c8d67e 100644 --- a/module/setup/Setup.py +++ b/module/setup/Setup.py @@ -25,6 +25,7 @@ from subprocess import PIPE, call import sys from sys import exit from module.utils import get_console_encoding +from module.setup import System_Checks class Setup(): """ @@ -125,7 +126,8 @@ class Setup(): def start_cli(self): self.ask_lang() - + + System_Checks. print _("Welcome to the pyLoad Configuration Assistent.") print _("It will check your system and make a basic setup in order to run pyLoad.") @@ -140,7 +142,7 @@ class Setup(): print _("When you are ready for system check, hit enter.") raw_input() - self.get_page_next() + for self.get_page_next(). @@ -382,7 +384,6 @@ class Setup(): print "openssl req -days 36500 -x509 -key ssl.key -in ssl.csr > ssl.crt " print "" print _("If you're done and everything went fine, you can activate ssl now.") - self.config["ssl"]["activated"] = self.ask(_("Activate SSL?"), self.yes, bool=True) def set_user(self): @@ -459,34 +460,14 @@ class Setup(): except Exception, e: print _("Setting config path failed: %s") % str(e) - def print_dep(self, name, value): - """Print Status of dependency""" - if value: - print _("%s: OK") % name - else: - print _("%s: missing") % name - def check_module(self, module): - try: - __import__(module) - return True - except: - return False - def check_prog(self, command): - pipe = PIPE - try: - call(command, stdout=pipe, stderr=pipe) - return True - except: - return False + def ask_cli(self, qst, default, answers=[], bool=False, password=False): - """produce one line to asking for input""" if answers: info = "(" - for i, answer in enumerate(answers): info += (", " if i != 0 else "") + str((answer == default and "[%s]" % answer) or answer) -- cgit v1.2.3