MCPcopy
hub / github.com/pyload/pyload / conf_path

Method conf_path

module/setup.py:400–425  ·  view source on GitHub ↗
(self, trans=False)

Source from the content-addressed store, hash-verified

398 db.shutdown()
399
400 def conf_path(self, trans=False):
401 if trans:
402 gettext.setpaths([os.path.join(os.sep, "usr", "share", "pyload", "locale"), None])
403 translation = gettext.translation("setup", os.path.join(self.path, "locale"),
404 languages=[self.config["general"]["language"], "en"], fallback=True)
405 translation.install(True)
406
407 print _("Setting new configpath, current configuration will not be transfered!")
408 current_path = os.path.abspath("")
409 path = self.ask(_("Configpath"), current_path)
410 if path == current_path:
411 print _("\nConfigpath not changed, continuing with setup.")
412 return
413 try:
414 path = os.path.join(pypath, path)
415 if not os.path.exists(path):
416 os.makedirs(path)
417 f = open(os.path.join(pypath, "module", "config", "configdir"), "wb")
418 f.write(path)
419 f.close()
420 print _("Configpath changed, setup will now close, please restart to go on.")
421 print _("Press Enter to exit.")
422 raw_input()
423 exit(1)
424 except Exception, e:
425 print _("Setting config path failed: %s") % str(e)
426
427 def print_dep(self, name, value):
428 """Print Status of dependency"""

Callers 2

__init__Method · 0.95
startMethod · 0.95

Calls 6

askMethod · 0.95
joinMethod · 0.80
installMethod · 0.80
_Function · 0.50
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected