Skip to content

Commit

Permalink
linux friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed Waleed committed Jul 15, 2022
1 parent 0727553 commit c31e513
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion gui/requiem/interstellar.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ def run_interstellar(self, layer):
dataflow_explore_optimizer(memory_arch, self.output_queue[layer][0], False, report_path)
self.output_queue[layer][1] = report_path
except KeyError:
self.output_queue[layer][1] = "Dataflow exploration table is empty, please try other configuration"
self.output_queue[layer][1] = "dataflow exploration table is empty, please try other configuration"
except Exception as e:
self.output_queue[layer][1] = str(e)
self.update_output_queue_table(self.output_queue)

def memory_arch_to_dict(self):
Expand Down
2 changes: 1 addition & 1 deletion gui/requiem/interstellar_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def update_output_queue_table(self, output_queue):
item = QtWidgets.QTableWidgetItem()
if output:
if isinstance(output, str):
if ':' in output:
if (':' in output) or ('/' == output[0]):
item.setText("Finished")
else:
item.setText("Failure")
Expand Down
5 changes: 5 additions & 0 deletions gui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ def run_python_subprocess(_args):
import subprocess

cmd = "python "

if os.path.exists("./venv/Scripts/python.exe"):
cmd = "./venv/Scripts/python.exe "
elif main_dir_path[0] == '/':
cmd = "python3 "

cmd += _args
return subprocess.Popen(cmd.split())
Expand Down Expand Up @@ -61,6 +64,8 @@ def choose_file_dialog(_caption, _filter):


def choose_folder_dialog(_caption):
if main_dir_path[0] == '/':
return main_dir_path
from PyQt5.QtWidgets import QFileDialog
return QFileDialog.getExistingDirectory(parent=None, caption=_caption, directory=main_dir_path)

Expand Down
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import os
import sys

file_dir = os.path.dirname(__file__)
sys.path.append(file_dir)

# QtWebEngineWidgets must be imported before a QCoreApplication instance is created
if len(sys.argv) > 1:
from gui import utils
Expand Down

0 comments on commit c31e513

Please sign in to comment.