Skip to content

Commit

Permalink
./ not needed for run
Browse files Browse the repository at this point in the history
  • Loading branch information
KylieGong committed Sep 7, 2023
1 parent 3dab824 commit f338f93
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions qtrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ def initUI(self):

# runs the file. takes the input file and runs it, piping the set paraments into the file as args
def run(self):
print("running: " + self.input_file)
contents = self.gather_data()
param = ""
param = self.input_file
for line in contents:
for key, value in line.items():
param += f"{key}={value} "
subprocess.run([self.input_file_type, self.input_file] + param.split())
param += f" {key}={value}"
subprocess.run(param.split())

# saves the options into a separate file named inputfilename.key. Thiswill be saved in the format
# saves the options into a separate file named inputfilename.key. This will be saved in the format
# key=value and formatted according to the input file type.
def save(self):
contents = self.gather_data()
Expand Down Expand Up @@ -124,7 +125,6 @@ def load(self):

def quit(self):
self.close()
print('quit')

def help(self):
print('help')
Expand Down Expand Up @@ -219,7 +219,8 @@ def createWidgetsFromGroups(self):
slider.setValue(int(float(default_option[0])*multiplier))

slider_label = QtWidgets.QLabel(f"{slider.value()/multiplier}", self)
slider.valueChanged.connect(lambda: self.updateLabel())

slider.valueChanged.connect(lambda: self.update_label()) # updates to current value
slider.setObjectName(group_name)
self.slider_multiplier.append(multiplier)
self.sliders.append((slider, slider_label, multiplier))
Expand All @@ -234,7 +235,7 @@ def createWidgetsFromGroups(self):
separator.setFixedHeight(1) # Set a fixed height for the separator
self.pagelayout.addWidget(separator)

def updateLabel(self):
def update_label(self):
for slider, label, multiplier in self.sliders:
label.setText(f"{slider.value()/multiplier}")

Expand Down Expand Up @@ -337,8 +338,9 @@ def parsefile(file):
groups, filetype = parsefile(args.input_file)

app = QtWidgets.QApplication(sys.argv)
w = MainWindow(groups, args.input_file, filetype)
w.inputFile = args.input_file

w = MainWindow(groups, os.path.abspath(args.input_file), filetype)
# w.inputFile = args.input_file
w.adjustSize() #adjust to fit elements accordingly

#sets a minimum window size
Expand Down

0 comments on commit f338f93

Please sign in to comment.