MCPcopy
hub / github.com/pyload/pyload / start

Method start

pyLoadCore.py:272–489  ·  view source on GitHub ↗

starts the fun :D

(self, rpc=True, web=True)

Source from the content-addressed store, hash-verified

270 remove(join(path, f))
271
272 def start(self, rpc=True, web=True):
273 """ starts the fun :D """
274
275 self.version = CURRENT_VERSION
276
277 if not exists("pyload.conf"):
278 from module.setup import Setup
279
280 print "This is your first start, running configuration assistent now."
281 self.config = ConfigParser()
282 s = Setup(pypath, self.config)
283 res = False
284 try:
285 res = s.start()
286 except SystemExit:
287 pass
288 except KeyboardInterrupt:
289 print "\nSetup interrupted"
290 except:
291 res = False
292 print_exc()
293 print "Setup failed"
294 if not res:
295 remove("pyload.conf")
296
297 exit()
298
299 try: signal.signal(signal.SIGQUIT, self.quit)
300 except: pass
301
302 self.config = ConfigParser()
303
304 gettext.setpaths([join(os.sep, "usr", "share", "pyload", "locale"), None])
305 translation = gettext.translation("pyLoad", self.path("locale"),
306 languages=[self.config['general']['language'],"en"],fallback=True)
307 translation.install(True)
308
309 self.debug = self.doDebug or self.config['general']['debug_mode']
310 self.remote &= self.config['remote']['activated']
311
312 pid = self.isAlreadyRunning()
313 if pid:
314 print _("pyLoad already running with pid %s") % pid
315 exit()
316
317 if os.name != "nt" and self.config["general"]["renice"]:
318 os.system("renice %d %d" % (self.config["general"]["renice"], os.getpid()))
319
320 if self.config["permission"]["change_group"]:
321 if os.name != "nt":
322 try:
323 from grp import getgrnam
324
325 group = getgrnam(self.config["permission"]["group"])
326 os.setgid(group[2])
327 except Exception, e:
328 print _("Failed changing group: %s") % e
329

Callers 3

deamonFunction · 0.95
mainFunction · 0.95
init_webserverMethod · 0.45

Calls 15

startMethod · 0.95
pathMethod · 0.95
isAlreadyRunningMethod · 0.95
check_fileMethod · 0.95
init_loggerMethod · 0.95
writePidFileMethod · 0.95
check_installMethod · 0.95
setupDBMethod · 0.95
init_webserverMethod · 0.95
restartMethod · 0.95
shutdownMethod · 0.95
removeLoggerMethod · 0.95

Tested by

no test coverage detected