Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pycomsdk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
com
pycomsdk
Commits
c6401bbc
Commit
c6401bbc
authored
3 years ago
by
Anton Pershin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed wrong Windows command in execute() in LocalCommunication
parent
fc326355
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
communication.py
comsdk/communication.py
+12
-5
No files found.
comsdk/communication.py
View file @
c6401bbc
...
...
@@ -165,12 +165,19 @@ class LocalCommunication(BaseCommunication):
return
LocalCommunication
(
local_host
)
def
execute
(
self
,
command
,
working_dir
=
None
):
command_line
=
command
if
working_dir
is
None
else
'cd {}; {}'
.
format
(
working_dir
,
command
)
#print('\t' + command_line)
# use PIPEs to avoid breaking the child process when the parent process finishes
# (works on Linux, solution for Windows is to add creationflags=0x00000010 instead of stdout, stderr, stdin)
if
working_dir
is
None
:
command_line
=
command
else
:
if
os
.
name
==
'posix'
:
command_line
=
'cd {}; {}'
.
format
(
working_dir
,
command
)
elif
os
.
name
==
'nt'
:
command_line
=
''
if
working_dir
[
0
]
!=
'C'
:
command_line
+=
f
'{working_dir[0]}: && '
command_line
+=
'cd {} && {}'
.
format
(
working_dir
,
command
)
#self._print_exec_msg(command_line, is_remote=False)
subprocess
.
call
([
command_line
],
shell
=
True
)
#res = subprocess.call([command_line], shell=True)
res
=
subprocess
.
run
(
command_line
,
shell
=
True
)
return
[],
[]
def
copy
(
self
,
from_
,
to_
,
mode
=
'from_local'
,
show_msg
=
False
):
...
...
This diff is collapsed.
Click to expand it.
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