Skip to content

Commit

Permalink
added -d flag,
Browse files Browse the repository at this point in the history
  • Loading branch information
KylieGong committed Sep 9, 2023
1 parent 1ef772c commit 5dddbef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions qtrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ def createWidgetsFromGroups(self):
group_type, group_name, options, default_option, help = group

if group_type == "RADIO":
# print("radio button created")
new_group = QtWidgets.QButtonGroup()
self.radio_groups.append(new_group)
group_layout = QtWidgets.QHBoxLayout()
Expand All @@ -156,7 +155,6 @@ def createWidgetsFromGroups(self):
self.pagelayout.addLayout(group_layout)

elif group_type == "IFILE" or group_type == "OFILE" or group_type == "IDIR" or group_type == "ODIR":
print("browse files button created")
group_layout = QtWidgets.QHBoxLayout()
label = QtWidgets.QLabel(group_name+":")
label.setToolTip(help)
Expand All @@ -177,7 +175,6 @@ def createWidgetsFromGroups(self):
self.pagelayout.addLayout(group_layout)

elif group_type == "CHECK":
# print("checkbox created")
group_layout = QtWidgets.QHBoxLayout()
label = QtWidgets.QLabel(group_name+":")
label.setToolTip(help)
Expand All @@ -192,7 +189,6 @@ def createWidgetsFromGroups(self):
self.pagelayout.addLayout(group_layout)

elif group_type == "ENTRY":
# print("textbox created")
group_layout = QtWidgets.QHBoxLayout()
label = QtWidgets.QLabel(group_name+":")
label.setToolTip(help)
Expand All @@ -210,9 +206,7 @@ def createWidgetsFromGroups(self):
group_layout.addWidget(label)
options = ''.join(options)
options = options.split(':')
print(default_option)

# print("slider created")
#creates a horizontal decimal slider
decimals = len(str(options[2]).split('.')[1]) if '.' in str(options[2]) else 0
multiplier = 10**decimals
Expand Down Expand Up @@ -240,6 +234,9 @@ def createWidgetsFromGroups(self):
separator.setFixedHeight(1) # Set a fixed height for the separator
self.pagelayout.addWidget(separator)

if args.debug:
print(f"{group_name} created as {group_type}")

def update_label(self):
for slider, label, multiplier in self.sliders:
label.setText(f"{slider.value()/multiplier}")
Expand Down Expand Up @@ -336,8 +333,11 @@ def parsefile(file):
return groups, filetype

if __name__ == '__main__':
global args # global to access args outside
parser = argparse.ArgumentParser(description="Dynamic GUI Builder")
parser.add_argument("input_file", help="Path to the text file containing parameters")
parser.add_argument('-d', '--debug', action='store_true', help='Enable debug mode')

args = parser.parse_args()

groups, filetype = parsefile(args.input_file)
Expand Down

0 comments on commit 5dddbef

Please sign in to comment.