MCPcopy
hub / github.com/pyload/pyload / Setup

Class Setup

module/setup.py:28–517  ·  view source on GitHub ↗

pyLoads initial setup configuration assistent

Source from the content-addressed store, hash-verified

26from module.utils import get_console_encoding
27
28class Setup():
29 """
30 pyLoads initial setup configuration assistent
31 """
32
33 def __init__(self, path, config):
34 self.path = path
35 self.config = config
36 self.stdin_encoding = get_console_encoding(sys.stdin.encoding)
37
38 def start(self):
39 langs = self.config.getMetaData("general", "language")["type"].split(";")
40 lang = self.ask(u"Choose your Language / Wähle deine Sprache", "en", langs)
41 gettext.setpaths([os.path.join(os.sep, "usr", "share", "pyload", "locale"), None])
42 translation = gettext.translation("setup", os.path.join(self.path, "locale"), languages=[lang, "en"], fallback=True)
43 translation.install(True)
44
45 #Input shorthand for yes
46 self.yes = _("y")
47 #Input shorthand for no
48 self.no = _("n")
49
50 # print ""
51 # print _("Would you like to configure pyLoad via Webinterface?")
52 # print _("You need a Browser and a connection to this PC for it.")
53 # viaweb = self.ask(_("Start initial webinterface for configuration?"), "y", bool=True)
54 # if viaweb:
55 # try:
56 # from module.web import ServerThread
57 # ServerThread.setup = self
58 # from module.web import webinterface
59 # webinterface.run_simple()
60 # return False
61 # except Exception, e:
62 # print "Setup failed with this error: ", e
63 # print "Falling back to commandline setup."
64
65
66 print ""
67 print _("Welcome to the pyLoad Configuration Assistent.")
68 print _("It will check your system and make a basic setup in order to run pyLoad.")
69 print ""
70 print _("The value in brackets [] always is the default value,")
71 print _("in case you don't want to change it or you are unsure what to choose, just hit enter.")
72 print _(
73 "Don't forget: You can always rerun this assistent with --setup or -s parameter, when you start pyLoadCore.")
74 print _("If you have any problems with this assistent hit STRG-C,")
75 print _("to abort and don't let him start with pyLoadCore automatically anymore.")
76 print ""
77 print _("When you are ready for system check, hit enter.")
78 raw_input()
79
80 basic, ssl, captcha, gui, web, js = self.system_check()
81 print ""
82
83 if not basic:
84 print _("You need pycurl, sqlite and python 2.5, 2.6 or 2.7 to run pyLoad.")
85 print _("Please correct this and re-run pyLoad.")

Callers 3

__init__Method · 0.90
startMethod · 0.90
setup.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected