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

Method profile_env_bin

mod/project/python/pyenv_tool.py:536–551  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

534
535 @classmethod
536 def profile_env_bin(cls) -> Optional[str]:
537 if not os.path.isfile("/etc/profile"):
538 return None
539 data = public.readFile("/etc/profile")
540 for line in data.split("\n"):
541 if line.find("source /www/server/panel/data/bt_etc_pyenv.sh"):
542 break
543 else:
544 return None
545
546 active_data: str = public.readFile(cls._bt_etc_pyenv)
547 if not active_data:
548 return None
549
550 bin_path = active_data.split("\n", 1)[0].strip("#")
551 return bin_path
552
553 def use2project(self, project_name: str):
554 if not project_name:

Callers 1

Calls 3

readFileMethod · 0.80
splitMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected