Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
85c94472
Commit
85c94472
authored
Jul 07, 2023
by
Jonas Kaufmann
Committed by
Antoine Kaufmann
Nov 05, 2023
Browse files
orchestration exectools.py: make executor an abstract base class
parent
6f560fd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
experiments/simbricks/orchestration/exectools.py
experiments/simbricks/orchestration/exectools.py
+15
-10
No files found.
experiments/simbricks/orchestration/exectools.py
View file @
85c94472
...
...
@@ -300,25 +300,30 @@ class SimpleRemoteComponent(SimpleComponent):
await
self
.
_kill_cmd
(
'KILL'
)
class
Executor
(
object
):
class
Executor
(
abc
.
ABC
):
def
__init__
(
self
):
self
.
ip
=
None
@
abc
.
abstractmethod
def
create_component
(
self
,
label
,
parts
,
**
kwargs
)
->
SimpleComponent
:
raise
NotImplementedError
(
'Please Implement this method'
)
pass
async
def
await_file
(
self
,
path
,
delay
=
0.05
,
verbose
=
False
):
raise
NotImplementedError
(
'Please Implement this method'
)
@
abc
.
abstractmethod
async
def
await_file
(
self
,
path
,
delay
=
0.05
,
verbose
=
False
)
->
None
:
pass
async
def
send_file
(
self
,
path
,
verbose
=
False
):
raise
NotImplementedError
(
'Please Implement this method'
)
@
abc
.
abstractmethod
async
def
send_file
(
self
,
path
,
verbose
=
False
)
->
None
:
pass
async
def
mkdir
(
self
,
path
,
verbose
=
False
):
raise
NotImplementedError
(
'Please Implement this method'
)
@
abc
.
abstractmethod
async
def
mkdir
(
self
,
path
,
verbose
=
False
)
->
None
:
pass
async
def
rmtree
(
self
,
path
,
verbose
=
False
):
raise
NotImplementedError
(
'Please Implement this method'
)
@
abc
.
abstractmethod
async
def
rmtree
(
self
,
path
,
verbose
=
False
)
->
None
:
pass
# runs the list of commands as strings sequentially
async
def
run_cmdlist
(
self
,
label
,
cmds
,
verbose
=
True
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment