primitive 0.1.12__py3-none-any.whl → 0.1.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- primitive/__about__.py +1 -1
- primitive/cli.py +2 -0
- primitive/client.py +2 -0
- primitive/daemons/actions.py +75 -0
- primitive/daemons/commands.py +65 -0
- primitive/daemons/launch_agents.py +144 -0
- primitive/daemons/launch_service.py +170 -0
- {primitive-0.1.12.dist-info → primitive-0.1.13.dist-info}/METADATA +1 -1
- {primitive-0.1.12.dist-info → primitive-0.1.13.dist-info}/RECORD +12 -8
- {primitive-0.1.12.dist-info → primitive-0.1.13.dist-info}/WHEEL +0 -0
- {primitive-0.1.12.dist-info → primitive-0.1.13.dist-info}/entry_points.txt +0 -0
- {primitive-0.1.12.dist-info → primitive-0.1.13.dist-info}/licenses/LICENSE.txt +0 -0
primitive/__about__.py
CHANGED
primitive/cli.py
CHANGED
@@ -9,6 +9,7 @@ from .hardware.commands import cli as hardware_commands
|
|
9
9
|
from .lint.commands import cli as lint_commands
|
10
10
|
from .agent.commands import cli as agent_commands
|
11
11
|
from .git.commands import cli as git_commands
|
12
|
+
from .daemons.commands import cli as daemons_commands
|
12
13
|
|
13
14
|
|
14
15
|
@click.group()
|
@@ -59,6 +60,7 @@ cli.add_command(hardware_commands, "hardware")
|
|
59
60
|
cli.add_command(lint_commands, "lint")
|
60
61
|
cli.add_command(agent_commands, "agent")
|
61
62
|
cli.add_command(git_commands, "git")
|
63
|
+
cli.add_command(daemons_commands, "daemons")
|
62
64
|
|
63
65
|
if __name__ == "__main__":
|
64
66
|
cli(obj={})
|
primitive/client.py
CHANGED
@@ -9,6 +9,7 @@ from .hardware.actions import Hardware
|
|
9
9
|
from .lint.actions import Lint
|
10
10
|
from .agent.actions import Agent
|
11
11
|
from .git.actions import Git
|
12
|
+
from .daemons.actions import Daemons
|
12
13
|
|
13
14
|
from loguru import logger
|
14
15
|
|
@@ -61,6 +62,7 @@ class Primitive:
|
|
61
62
|
self.lint: Lint = Lint(self)
|
62
63
|
self.agent: Agent = Agent(self)
|
63
64
|
self.git: Git = Git(self)
|
65
|
+
self.daemons: Daemons = Daemons(self)
|
64
66
|
|
65
67
|
def get_host_config(self):
|
66
68
|
self.full_config = read_config_file()
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import platform
|
2
|
+
import typing
|
3
|
+
|
4
|
+
if typing.TYPE_CHECKING:
|
5
|
+
from ..client import Primitive
|
6
|
+
|
7
|
+
from .launch_agents import (
|
8
|
+
full_launch_agent_install,
|
9
|
+
full_launch_agent_uninstall,
|
10
|
+
start_launch_agent,
|
11
|
+
stop_launch_agent,
|
12
|
+
view_launch_agent_logs,
|
13
|
+
)
|
14
|
+
|
15
|
+
from .launch_service import (
|
16
|
+
full_service_install,
|
17
|
+
full_service_uninstall,
|
18
|
+
start_service,
|
19
|
+
stop_service,
|
20
|
+
view_service_logs,
|
21
|
+
)
|
22
|
+
|
23
|
+
|
24
|
+
class Daemons:
|
25
|
+
def __init__(self, primitive) -> None:
|
26
|
+
self.primitive: Primitive = primitive
|
27
|
+
self.os_family = platform.system()
|
28
|
+
|
29
|
+
def install(self):
|
30
|
+
result = True
|
31
|
+
if self.os_family == "Darwin":
|
32
|
+
full_launch_agent_install()
|
33
|
+
elif self.os_family == "Linux":
|
34
|
+
full_service_install()
|
35
|
+
elif self.os_family == "Windows":
|
36
|
+
print("Not Implemented")
|
37
|
+
return result
|
38
|
+
|
39
|
+
def uninstall(self):
|
40
|
+
result = True
|
41
|
+
if self.os_family == "Darwin":
|
42
|
+
full_launch_agent_uninstall()
|
43
|
+
elif self.os_family == "Linux":
|
44
|
+
full_service_uninstall()
|
45
|
+
elif self.os_family == "Windows":
|
46
|
+
print("Not Implemented")
|
47
|
+
return result
|
48
|
+
|
49
|
+
def stop(self) -> bool:
|
50
|
+
result = True
|
51
|
+
if self.os_family == "Darwin":
|
52
|
+
result = stop_launch_agent()
|
53
|
+
elif self.os_family == "Linux":
|
54
|
+
stop_service()
|
55
|
+
elif self.os_family == "Windows":
|
56
|
+
print("Not Implemented")
|
57
|
+
return result
|
58
|
+
|
59
|
+
def start(self) -> bool:
|
60
|
+
result = True
|
61
|
+
if self.os_family == "Darwin":
|
62
|
+
result = start_launch_agent()
|
63
|
+
elif self.os_family == "Linux":
|
64
|
+
start_service()
|
65
|
+
elif self.os_family == "Windows":
|
66
|
+
print("Not Implemented")
|
67
|
+
return result
|
68
|
+
|
69
|
+
def logs(self):
|
70
|
+
if self.os_family == "Darwin":
|
71
|
+
view_launch_agent_logs()
|
72
|
+
elif self.os_family == "Linux":
|
73
|
+
view_service_logs()
|
74
|
+
elif self.os_family == "Windows":
|
75
|
+
print("Not Implemented")
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import click
|
2
|
+
|
3
|
+
from ..utils.printer import print_result
|
4
|
+
import typing
|
5
|
+
|
6
|
+
if typing.TYPE_CHECKING:
|
7
|
+
from ..client import Primitive
|
8
|
+
|
9
|
+
|
10
|
+
@click.group()
|
11
|
+
@click.pass_context
|
12
|
+
def cli(context):
|
13
|
+
"""Daemon"""
|
14
|
+
pass
|
15
|
+
|
16
|
+
|
17
|
+
@cli.command("install")
|
18
|
+
@click.pass_context
|
19
|
+
def install_daemon_command(context):
|
20
|
+
"""Install the full primitive daemon"""
|
21
|
+
primitive: Primitive = context.obj.get("PRIMITIVE")
|
22
|
+
result = primitive.daemons.install()
|
23
|
+
print_result(message=result, context=context)
|
24
|
+
|
25
|
+
|
26
|
+
@cli.command("uninstall")
|
27
|
+
@click.pass_context
|
28
|
+
def uninstall_daemon_command(context):
|
29
|
+
"""Uninstall the full primitive Daemon"""
|
30
|
+
primitive: Primitive = context.obj.get("PRIMITIVE")
|
31
|
+
result = primitive.daemons.uninstall()
|
32
|
+
print_result(message=result, context=context)
|
33
|
+
|
34
|
+
|
35
|
+
@cli.command("stop")
|
36
|
+
@click.pass_context
|
37
|
+
def stop_daemon_command(context):
|
38
|
+
"""Stop primitive Daemon"""
|
39
|
+
primitive: Primitive = context.obj.get("PRIMITIVE")
|
40
|
+
result = primitive.daemons.stop()
|
41
|
+
message = "stopping primitive daemon"
|
42
|
+
if context.obj["JSON"]:
|
43
|
+
message = result
|
44
|
+
print_result(message=message, context=context)
|
45
|
+
|
46
|
+
|
47
|
+
@cli.command("start")
|
48
|
+
@click.pass_context
|
49
|
+
def start_daemon_command(context):
|
50
|
+
"""Start primitive Daemon"""
|
51
|
+
primitive: Primitive = context.obj.get("PRIMITIVE")
|
52
|
+
result = primitive.daemons.start()
|
53
|
+
message = "starting primitive daemon"
|
54
|
+
if context.obj["JSON"]:
|
55
|
+
message = result
|
56
|
+
print_result(message=message, context=context)
|
57
|
+
|
58
|
+
|
59
|
+
@cli.command("logs")
|
60
|
+
@click.pass_context
|
61
|
+
def log_daemon_command(context):
|
62
|
+
"""Logs from primitive Daemon"""
|
63
|
+
primitive: Primitive = context.obj.get("PRIMITIVE")
|
64
|
+
result = primitive.daemons.logs()
|
65
|
+
print_result(message=result, context=context)
|
@@ -0,0 +1,144 @@
|
|
1
|
+
import os
|
2
|
+
from pathlib import Path
|
3
|
+
import subprocess
|
4
|
+
|
5
|
+
HOME_DIRECTORY = Path.home()
|
6
|
+
CURRENT_USER = str(HOME_DIRECTORY.expanduser()).lstrip("/Users/")
|
7
|
+
|
8
|
+
PRIMITIVE_BINARY_PATH = Path(HOME_DIRECTORY / ".pyenv" / "shims" / "primitive")
|
9
|
+
PRIMITIVE_LAUNCH_AGENT_FILEPATH = Path(
|
10
|
+
HOME_DIRECTORY / "Library" / "LaunchAgents" / "tech.primitive.agent.plist"
|
11
|
+
)
|
12
|
+
PRIMITIVE_LAUNCH_AGENT_LOGS = Path(
|
13
|
+
HOME_DIRECTORY / "Library" / "Logs" / "tech.primitive.agent.log"
|
14
|
+
)
|
15
|
+
PRIMITIVE_LAUNCH_AGENT_LABEL = "tech.primitive.agent"
|
16
|
+
PRIMITIVE_LAUNCH_AGENT_WORKING_DIR = Path(
|
17
|
+
HOME_DIRECTORY / "Logs" / "tech.primitive.agent.log"
|
18
|
+
)
|
19
|
+
|
20
|
+
|
21
|
+
def stop_launch_agent():
|
22
|
+
try:
|
23
|
+
stop_existing_process = f"launchctl stop {PRIMITIVE_LAUNCH_AGENT_LABEL}"
|
24
|
+
subprocess.check_output(stop_existing_process.split(" "))
|
25
|
+
return True
|
26
|
+
except subprocess.CalledProcessError as exception:
|
27
|
+
print("stop_launch_agent: ", exception)
|
28
|
+
return False
|
29
|
+
|
30
|
+
|
31
|
+
def start_launch_agent():
|
32
|
+
try:
|
33
|
+
start_new_agent = f"launchctl start {PRIMITIVE_LAUNCH_AGENT_LABEL}"
|
34
|
+
subprocess.check_output(start_new_agent.split(" "))
|
35
|
+
return True
|
36
|
+
except subprocess.CalledProcessError as exception:
|
37
|
+
print("start_launch_agent: ", exception)
|
38
|
+
return False
|
39
|
+
|
40
|
+
|
41
|
+
def unload_launch_agent():
|
42
|
+
try:
|
43
|
+
remove_existing_agent = f"launchctl unload -w {PRIMITIVE_LAUNCH_AGENT_FILEPATH}"
|
44
|
+
subprocess.check_output(remove_existing_agent.split(" "))
|
45
|
+
return True
|
46
|
+
except subprocess.CalledProcessError as exception:
|
47
|
+
print("remove_launch_agent: ", exception)
|
48
|
+
return False
|
49
|
+
|
50
|
+
|
51
|
+
def load_launch_agent():
|
52
|
+
try:
|
53
|
+
load_new_plist = f"launchctl load -w {PRIMITIVE_LAUNCH_AGENT_FILEPATH}"
|
54
|
+
subprocess.check_output(load_new_plist.split(" "))
|
55
|
+
return True
|
56
|
+
except subprocess.CalledProcessError as exception:
|
57
|
+
print("load_launch_agent: ", exception)
|
58
|
+
return False
|
59
|
+
|
60
|
+
|
61
|
+
def create_stdout_file():
|
62
|
+
if not PRIMITIVE_LAUNCH_AGENT_LOGS.exists():
|
63
|
+
PRIMITIVE_LAUNCH_AGENT_LOGS.parent.mkdir(parents=True, exist_ok=True)
|
64
|
+
PRIMITIVE_LAUNCH_AGENT_LOGS.touch()
|
65
|
+
|
66
|
+
|
67
|
+
def delete_stdout_file():
|
68
|
+
if PRIMITIVE_LAUNCH_AGENT_LOGS.exists():
|
69
|
+
PRIMITIVE_LAUNCH_AGENT_LOGS.unlink()
|
70
|
+
|
71
|
+
|
72
|
+
def populate_fresh_launch_agent():
|
73
|
+
PRIMITIVE_LAUNCH_AGENT_LOGS.parent.mkdir(parents=True, exist_ok=True)
|
74
|
+
PRIMITIVE_LAUNCH_AGENT_LOGS.touch()
|
75
|
+
|
76
|
+
if PRIMITIVE_LAUNCH_AGENT_FILEPATH.exists():
|
77
|
+
PRIMITIVE_LAUNCH_AGENT_FILEPATH.unlink()
|
78
|
+
PRIMITIVE_LAUNCH_AGENT_FILEPATH.parent.mkdir(parents=True, exist_ok=True)
|
79
|
+
PRIMITIVE_LAUNCH_AGENT_FILEPATH.touch()
|
80
|
+
|
81
|
+
PRIMITIVE_LAUNCH_AGENT_FILEPATH.write_text(
|
82
|
+
f"""<?xml version="1.0" encoding="UTF-8"?>
|
83
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
84
|
+
<plist version="1.0">
|
85
|
+
<dict>
|
86
|
+
<key>KeepAlive</key>
|
87
|
+
<true/>
|
88
|
+
<key>Label</key>
|
89
|
+
<string>{PRIMITIVE_LAUNCH_AGENT_LABEL}</string>
|
90
|
+
<key>LimitLoadToSessionType</key>
|
91
|
+
<array>
|
92
|
+
<string>Aqua</string>
|
93
|
+
<string>Background</string>
|
94
|
+
<string>LoginWindow</string>
|
95
|
+
<string>StandardIO</string>
|
96
|
+
</array>
|
97
|
+
<key>ProgramArguments</key>
|
98
|
+
<array>
|
99
|
+
<string>{PRIMITIVE_BINARY_PATH}</string>
|
100
|
+
<string>agent</string>
|
101
|
+
</array>
|
102
|
+
<key>RunAtLoad</key>
|
103
|
+
<true/>
|
104
|
+
<key>StandardErrorPath</key>
|
105
|
+
<string>{PRIMITIVE_LAUNCH_AGENT_LOGS}</string>
|
106
|
+
<key>StandardOutPath</key>
|
107
|
+
<string>{PRIMITIVE_LAUNCH_AGENT_LOGS}</string>
|
108
|
+
</dict>
|
109
|
+
</plist>""" # noqa: E501
|
110
|
+
)
|
111
|
+
PRIMITIVE_LAUNCH_AGENT_FILEPATH.chmod(0o644)
|
112
|
+
verify_launch_agent()
|
113
|
+
|
114
|
+
|
115
|
+
def verify_launch_agent():
|
116
|
+
plutil_check = f"plutil -lint {PRIMITIVE_LAUNCH_AGENT_FILEPATH}"
|
117
|
+
try:
|
118
|
+
subprocess.check_output(plutil_check.split(" "))
|
119
|
+
return True
|
120
|
+
except subprocess.CalledProcessError as exception:
|
121
|
+
print("verify_launch_agent: ", exception)
|
122
|
+
return False
|
123
|
+
|
124
|
+
|
125
|
+
def view_launch_agent_logs():
|
126
|
+
follow_logs = f"tail -f -n +1 {PRIMITIVE_LAUNCH_AGENT_LOGS}"
|
127
|
+
os.system(follow_logs)
|
128
|
+
|
129
|
+
|
130
|
+
def full_launch_agent_install():
|
131
|
+
stop_launch_agent()
|
132
|
+
unload_launch_agent()
|
133
|
+
populate_fresh_launch_agent()
|
134
|
+
create_stdout_file()
|
135
|
+
load_launch_agent()
|
136
|
+
start_launch_agent()
|
137
|
+
|
138
|
+
|
139
|
+
def full_launch_agent_uninstall():
|
140
|
+
stop_launch_agent()
|
141
|
+
unload_launch_agent()
|
142
|
+
if PRIMITIVE_LAUNCH_AGENT_FILEPATH.exists():
|
143
|
+
PRIMITIVE_LAUNCH_AGENT_FILEPATH.unlink()
|
144
|
+
delete_stdout_file()
|
@@ -0,0 +1,170 @@
|
|
1
|
+
import os
|
2
|
+
import configparser
|
3
|
+
import subprocess
|
4
|
+
from pathlib import Path
|
5
|
+
|
6
|
+
HOME_DIRECTORY = Path.home()
|
7
|
+
|
8
|
+
PRIMITIVE_BINARY_PATH = Path(HOME_DIRECTORY / ".pyenv" / "shims" / "primitive")
|
9
|
+
|
10
|
+
PRIMITIVE_AGENT_SERVICE = "tech.primitive.agent.service"
|
11
|
+
PRIMITIVE_AGENT_LOGS = "tech.primitive.agent.log"
|
12
|
+
PRIMITIVE_AGENT_SERVICE_FILEPATH = Path(
|
13
|
+
HOME_DIRECTORY / ".config" / "systemd" / "user" / PRIMITIVE_AGENT_SERVICE
|
14
|
+
)
|
15
|
+
PRIMITIVE_AGENT_LOGS_FILEPATH = Path(
|
16
|
+
HOME_DIRECTORY / ".cache" / "primitive" / PRIMITIVE_AGENT_LOGS
|
17
|
+
)
|
18
|
+
|
19
|
+
|
20
|
+
def stop_service():
|
21
|
+
try:
|
22
|
+
if is_service_active():
|
23
|
+
stop_existing_service = f"systemctl --user stop {PRIMITIVE_AGENT_SERVICE}"
|
24
|
+
subprocess.check_output(stop_existing_service.split(" "))
|
25
|
+
return True
|
26
|
+
except subprocess.CalledProcessError as exception:
|
27
|
+
print("stop_service: ", exception)
|
28
|
+
return False
|
29
|
+
|
30
|
+
|
31
|
+
def is_service_active():
|
32
|
+
try:
|
33
|
+
is_service_active = (
|
34
|
+
f"systemctl --user show {PRIMITIVE_AGENT_SERVICE} -p ActiveState --value"
|
35
|
+
)
|
36
|
+
output = subprocess.check_output(is_service_active.split(" ")).decode().strip()
|
37
|
+
return output == "active"
|
38
|
+
except subprocess.CalledProcessError as exception:
|
39
|
+
print("is_service_active: ", exception)
|
40
|
+
return False
|
41
|
+
|
42
|
+
|
43
|
+
def disable_service():
|
44
|
+
try:
|
45
|
+
if is_service_enabled():
|
46
|
+
disable_existing_service = (
|
47
|
+
f"systemctl --user disable {PRIMITIVE_AGENT_SERVICE}"
|
48
|
+
)
|
49
|
+
subprocess.check_output(disable_existing_service.split(" "))
|
50
|
+
return True
|
51
|
+
except subprocess.CalledProcessError as exception:
|
52
|
+
print("disable_service: ", exception)
|
53
|
+
return False
|
54
|
+
|
55
|
+
|
56
|
+
def is_service_enabled():
|
57
|
+
try:
|
58
|
+
is_service_active = (
|
59
|
+
f"systemctl --user show {PRIMITIVE_AGENT_SERVICE} -p UnitFileState --value" # noqa
|
60
|
+
)
|
61
|
+
output = subprocess.check_output(is_service_active.split(" ")).decode().strip()
|
62
|
+
return output == "enabled"
|
63
|
+
except subprocess.CalledProcessError as exception:
|
64
|
+
print("is_service_enabled: ", exception)
|
65
|
+
return False
|
66
|
+
|
67
|
+
|
68
|
+
def populate_service_file():
|
69
|
+
PRIMITIVE_AGENT_LOGS_FILEPATH.parent.mkdir(parents=True, exist_ok=True)
|
70
|
+
PRIMITIVE_AGENT_LOGS_FILEPATH.touch()
|
71
|
+
|
72
|
+
if PRIMITIVE_AGENT_SERVICE_FILEPATH.exists():
|
73
|
+
PRIMITIVE_AGENT_SERVICE_FILEPATH.unlink()
|
74
|
+
PRIMITIVE_AGENT_SERVICE_FILEPATH.parent.mkdir(parents=True, exist_ok=True)
|
75
|
+
PRIMITIVE_AGENT_SERVICE_FILEPATH.touch()
|
76
|
+
|
77
|
+
config = configparser.ConfigParser()
|
78
|
+
config.optionxform = str # type: ignore
|
79
|
+
|
80
|
+
config["Unit"] = {
|
81
|
+
"Description": "Primitive Agent",
|
82
|
+
"After": "network.target",
|
83
|
+
}
|
84
|
+
|
85
|
+
config["Service"] = {
|
86
|
+
"ExecStart": f"{PRIMITIVE_BINARY_PATH} agent",
|
87
|
+
"Restart": "always",
|
88
|
+
"StandardError": f"append:{PRIMITIVE_AGENT_LOGS_FILEPATH}",
|
89
|
+
"StandardOutput": f"append:{PRIMITIVE_AGENT_LOGS_FILEPATH}",
|
90
|
+
}
|
91
|
+
|
92
|
+
config["Install"] = {
|
93
|
+
"WantedBy": "default.target",
|
94
|
+
}
|
95
|
+
|
96
|
+
try:
|
97
|
+
with open(PRIMITIVE_AGENT_SERVICE_FILEPATH, "w") as service_file:
|
98
|
+
config.write(service_file)
|
99
|
+
except IOError as exception:
|
100
|
+
print(f"populate_service_file: {exception}")
|
101
|
+
|
102
|
+
PRIMITIVE_AGENT_SERVICE_FILEPATH.chmod(0o644)
|
103
|
+
verify_service_file()
|
104
|
+
|
105
|
+
|
106
|
+
def verify_service_file():
|
107
|
+
systemctl_check = (
|
108
|
+
f"systemctl --user show {PRIMITIVE_AGENT_SERVICE} -p CanStart --value"
|
109
|
+
)
|
110
|
+
try:
|
111
|
+
output = subprocess.check_output(systemctl_check.split(" ")).decode().strip()
|
112
|
+
if output == "no":
|
113
|
+
raise Exception(f"{systemctl_check} yielded {output}")
|
114
|
+
return True
|
115
|
+
except subprocess.CalledProcessError as exception:
|
116
|
+
print("verify_service_file: ", exception)
|
117
|
+
return False
|
118
|
+
|
119
|
+
|
120
|
+
def create_stdout_file():
|
121
|
+
if not PRIMITIVE_AGENT_LOGS_FILEPATH.exists():
|
122
|
+
PRIMITIVE_AGENT_LOGS_FILEPATH.parent.mkdir(parents=True, exist_ok=True)
|
123
|
+
PRIMITIVE_AGENT_LOGS_FILEPATH.touch()
|
124
|
+
|
125
|
+
|
126
|
+
def delete_stdout_file():
|
127
|
+
if PRIMITIVE_AGENT_LOGS_FILEPATH.exists():
|
128
|
+
PRIMITIVE_AGENT_LOGS_FILEPATH.unlink()
|
129
|
+
|
130
|
+
|
131
|
+
def enable_service():
|
132
|
+
try:
|
133
|
+
enable_service = f"systemctl --user enable {PRIMITIVE_AGENT_SERVICE}"
|
134
|
+
subprocess.check_output(enable_service.split(" "))
|
135
|
+
return True
|
136
|
+
except subprocess.CalledProcessError as exception:
|
137
|
+
print("enable_service: ", exception)
|
138
|
+
return False
|
139
|
+
|
140
|
+
|
141
|
+
def start_service():
|
142
|
+
try:
|
143
|
+
start_new_service = f"systemctl --user start {PRIMITIVE_AGENT_SERVICE}"
|
144
|
+
subprocess.check_output(start_new_service.split(" "))
|
145
|
+
return True
|
146
|
+
except subprocess.CalledProcessError as exception:
|
147
|
+
print("start_service: ", exception)
|
148
|
+
return False
|
149
|
+
|
150
|
+
|
151
|
+
def view_service_logs():
|
152
|
+
follow_logs = f"tail -f -n +1 {PRIMITIVE_AGENT_LOGS_FILEPATH}"
|
153
|
+
os.system(follow_logs)
|
154
|
+
|
155
|
+
|
156
|
+
def full_service_install():
|
157
|
+
stop_service()
|
158
|
+
disable_service()
|
159
|
+
populate_service_file()
|
160
|
+
create_stdout_file()
|
161
|
+
enable_service()
|
162
|
+
start_service()
|
163
|
+
|
164
|
+
|
165
|
+
def full_service_uninstall():
|
166
|
+
stop_service()
|
167
|
+
disable_service()
|
168
|
+
if PRIMITIVE_AGENT_SERVICE_FILEPATH.exists():
|
169
|
+
PRIMITIVE_AGENT_SERVICE_FILEPATH.unlink()
|
170
|
+
delete_stdout_file()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: primitive
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.13
|
4
4
|
Project-URL: Documentation, https://github.com//primitivecorp/primitive-cli#readme
|
5
5
|
Project-URL: Issues, https://github.com//primitivecorp/primitive-cli/issues
|
6
6
|
Project-URL: Source, https://github.com//primitivecorp/primitive-cli
|
@@ -1,12 +1,16 @@
|
|
1
|
-
primitive/__about__.py,sha256=
|
1
|
+
primitive/__about__.py,sha256=xMBcV0dgZBAcVvP4QqmQUK6YrJ-xPRUcJbx7NA4hQWw,129
|
2
2
|
primitive/__init__.py,sha256=bwKdgggKNVssJFVPfKSxqFMz4IxSr54WWbmiZqTMPNI,106
|
3
|
-
primitive/cli.py,sha256=
|
4
|
-
primitive/client.py,sha256=
|
3
|
+
primitive/cli.py,sha256=2IEAdHj93nmWaDauyua3hw0kFsqhW2zPPVB7W05d7-Q,1978
|
4
|
+
primitive/client.py,sha256=A2Ir9KRnm7VptG6iUba4zihx12SzQZLnsF19neyJmdY,2229
|
5
5
|
primitive/agent/actions.py,sha256=8eQDvUy0THT-zVvSTVgrDAsthRdSIpmhCkDr0iTXqDE,3673
|
6
6
|
primitive/agent/commands.py,sha256=-dVDilELfkGfbZB7qfEPs77Dm1oT62qJj4tsIk4KoxI,254
|
7
7
|
primitive/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
primitive/auth/actions.py,sha256=N2bGcwXNsB89pzs66gF9A5_WzUScY5fhfOyWixqo2y8,1054
|
9
9
|
primitive/auth/commands.py,sha256=JahUq0E2e7Xa-FX1WEUv7TgM6ieDvNH4VwRRtxAW7HE,2340
|
10
|
+
primitive/daemons/actions.py,sha256=Nt3yNtbBhen0jK4sRsH_N7AP3UBuyL48VaUhtC7wYq8,2015
|
11
|
+
primitive/daemons/commands.py,sha256=-Muh-6ib4uAVtPn_67AcMrDwuCwYlCnRQozCi2Xurmk,1726
|
12
|
+
primitive/daemons/launch_agents.py,sha256=xR_JDL93mt5-fSbj-v3qvYFvLqfn486fPNbNxZOb1wU,4412
|
13
|
+
primitive/daemons/launch_service.py,sha256=3ktr0n0rSNA-IV6hQ8hbG50L2Y3V8-IeW79C8CrZi8U,5203
|
10
14
|
primitive/files/actions.py,sha256=f4JN3QFB2WXw-0JpnE-4-movnqtvXIpCrGd_9pdkeW4,2624
|
11
15
|
primitive/files/commands.py,sha256=DDizo3xJnU3KLUBTMeeM72viVpnJinLwxs84tmqKhqo,810
|
12
16
|
primitive/git/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -30,8 +34,8 @@ primitive/utils/memory_size.py,sha256=4xfha21kW82nFvOTtDFx9Jk2ZQoEhkfXii-PGNTpIU
|
|
30
34
|
primitive/utils/printer.py,sha256=f1XUpqi5dkTL3GWvYRUGlSwtj2IxU1q745T4Fxo7Tn4,370
|
31
35
|
primitive/utils/shell.py,sha256=-7UjQaBqSGHzEEyX8pNjeYFFP0P3lVnDV0OkgPz1qHU,1050
|
32
36
|
primitive/utils/verible.py,sha256=QYczN1IvxODfj4jeq0nqjFuF0Oi0Zdx-Q32ySOJgcw8,2205
|
33
|
-
primitive-0.1.
|
34
|
-
primitive-0.1.
|
35
|
-
primitive-0.1.
|
36
|
-
primitive-0.1.
|
37
|
-
primitive-0.1.
|
37
|
+
primitive-0.1.13.dist-info/METADATA,sha256=fUowLloXzAcRrLMhUloZAmRpiOLiVMXH8PZspjLb0YE,1818
|
38
|
+
primitive-0.1.13.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
39
|
+
primitive-0.1.13.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
|
40
|
+
primitive-0.1.13.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
|
41
|
+
primitive-0.1.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|