Skip to content

Commit 73d5046

Browse files
author
Michel Lampo
committed
Fix Linux errors
1 parent aee9dfc commit 73d5046

7 files changed

+26
-12
lines changed

PropCCompiler.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,13 @@ def compile(self, action, code):
7171
descriptors = self.get_includes(includes) # get lib descriptors for includes
7272
executing_data = self.create_executing_data(c_file, binary_file, descriptors) # build execution command
7373

74-
startupinfo = subprocess.STARTUPINFO()
75-
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
74+
if platform.system() == "Windows":
75+
startupinfo = subprocess.STARTUPINFO()
76+
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
7677

77-
process = subprocess.Popen(executing_data, stdout=subprocess.PIPE, stderr=subprocess.PIPE, startupinfo=startupinfo) # call compile
78+
process = subprocess.Popen(executing_data, stdout=subprocess.PIPE, stderr=subprocess.PIPE, startupinfo=startupinfo) # call compile
79+
else:
80+
process = subprocess.Popen(executing_data, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # call compile
7881
out, err = process.communicate()
7982

8083
if process.returncode == 0:

PropellerLoad.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ def __init__(self):
2828
self.appdir = os.getcwd()
2929

3030
def get_ports(self):
31-
startupinfo = subprocess.STARTUPINFO()
32-
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
31+
if platform.system() == "Windows":
32+
startupinfo = subprocess.STARTUPINFO()
33+
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
34+
35+
process = subprocess.Popen([self.appdir + self.propeller_load_executables[platform.system()], "-P"], stdout=subprocess.PIPE, startupinfo=startupinfo)
36+
else:
37+
process = subprocess.Popen([self.appdir + self.propeller_load_executables[platform.system()], "-P"], stdout=subprocess.PIPE)
3338

34-
process = subprocess.Popen([self.appdir + self.propeller_load_executables[platform.system()], "-P"], stdout=subprocess.PIPE, startupinfo=startupinfo)
3539
out, err = process.communicate()
3640
# return json.dumps(out.splitlines())
3741
return out.splitlines()
@@ -46,10 +50,14 @@ def load(self, action, file_to_load, com_port):
4650
executing_data.append(com_port)
4751
executing_data.append(file_to_load.name)
4852

49-
startupinfo = subprocess.STARTUPINFO()
50-
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
53+
if platform.system() == "Windows":
54+
startupinfo = subprocess.STARTUPINFO()
55+
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
56+
57+
process = subprocess.Popen(executing_data, stdout=subprocess.PIPE, startupinfo=startupinfo)
58+
else:
59+
process = subprocess.Popen(executing_data, stdout=subprocess.PIPE)
5160

52-
process = subprocess.Popen(executing_data, stdout=subprocess.PIPE, startupinfo=startupinfo)
5361
out, err = process.communicate()
5462

5563
if process.returncode == 0:

SpinCompiler.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,13 @@ def compile(self, action, code):
6666
executing_data.extend(self.compile_actions[action]["compile-options"])
6767
executing_data.append(spin_file.name)
6868

69-
startupinfo = subprocess.STARTUPINFO()
70-
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
69+
if platform.system() == "Windows":
70+
startupinfo = subprocess.STARTUPINFO()
71+
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
7172

72-
process = subprocess.Popen(executing_data, stdout=subprocess.PIPE, startupinfo=startupinfo)
73+
process = subprocess.Popen(executing_data, stdout=subprocess.PIPE, startupinfo=startupinfo)
74+
else:
75+
process = subprocess.Popen(executing_data, stdout=subprocess.PIPE)
7376
out, err = process.communicate()
7477

7578
if process.returncode == 0:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)