MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / get_celery_env

Method get_celery_env

mod/project/python/serviceMod.py:366–376  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

364class CeleryService(PythonService):
365
366 def get_celery_env(self) -> Tuple[str, str]:
367 celery = "{}/celery".format(self.env.python_path)
368 if not os.path.isfile(celery):
369 return '', ''
370 celery_data = public.readFile(celery)
371 if not isinstance(celery_data, str):
372 return '', ''
373 celery_python = celery_data.split("\n", 1)[0]
374 if celery_python.startswith("#!"):
375 celery_python = celery_python[2:].strip()
376 return celery_python, celery
377
378 def get_pid_by_command(self) -> Optional[int]:
379 celery_env = self.get_celery_env()

Callers 1

get_pid_by_commandMethod · 0.95

Calls 3

readFileMethod · 0.80
formatMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected