starts the fun :D
(self, rpc=True, web=True)
| 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 |
no test coverage detected