Skip to content

Commit

Permalink
Init some class..
Browse files Browse the repository at this point in the history
  • Loading branch information
Wh1isper committed Sep 22, 2023
1 parent ea8b7f5 commit 8fba814
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
25 changes: 24 additions & 1 deletion duetector/tracers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,27 @@ def set_callback(self, host, callback: Callable[[NamedTuple], None]):


class SubprocessTracer(Tracer):
pass
default_config = {
**Tracer.default_config,
}
"""
Default config for this tracer.
"""

executable_: List[str]
"""
shell command
"""

sudo: bool = False
"""
If use sudo to run this command
"""

preserve_env: bool = False
"""
If preserve env for this command
"""

def __init__(self, config: Optional[Union[Config, Dict[str, Any]]] = None, *args, **kwargs):
super().__init__(config, *args, **kwargs)
11 changes: 11 additions & 0 deletions duetector/tracers/subprocess/dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from duetector.tracers.base import SubprocessTracer


class DummySpTracer(SubprocessTracer):
default_config = {
**SubprocessTracer.default_config,
"disabled": True,
}

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
23 changes: 23 additions & 0 deletions duetector/tracers/subprocess/dummy_process.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python

# TODO: Implement a dummy process that can be used to test the tracer


def start():
pass


def do_something():
pass


def stop():
pass


def main():
pass


if __name__ == "__main__":
main()

0 comments on commit 8fba814

Please sign in to comment.