def get_widgets(self, prefix):
# identify names of the widget objects
names = self._get_widget_names(prefix)
# Get the objects themselves
widgets = [getattr(self.ui, this) for this in names]
# the double underscore __ is used instead of dash - in qt designer
# because dash is not acceptable within the object name. so we must
# replace it. We also strip the prefix and suffix (_value)
names = [this.replace(prefix + "_", "") for this in names]
names = [this.replace("__", "-") for this in names]
names = [this.replace("_value", "") for this in names]
options = []
snakemake_version = StrictVersion(snakemake.version.__version__)
for name, widget in zip(names, widgets):
# This option is valid for snakemake above 3.10
if name == "restart-times" and snakemake_version < StrictVersion("3.10"):
print("You should use Snakemake 3.10 or above")
continue
options.append(SOptions(name, widget))
return options
评论列表
文章目录