예제 #1
0
 def __init__(self, option, value=None, directory=False):
     super().__init__(option)
     self.layout.setContentsMargins(0, 0, 0, 0)
     self.browser = FileBrowser(directory=directory)
     self.layout.addWidget(self.browser)
     if value:
         self.browser.set_filenames(value)
예제 #2
0
파일: widgets.py 프로젝트: sequana/sequana
 def __init__(self, option, value=None, directory=False):
     super().__init__(option)
     self.layout.setContentsMargins(0, 0, 0, 0)
     self.browser = FileBrowser(directory=directory)
     self.layout.addWidget(self.browser)
     if value:
         self.browser.set_filenames(value)
예제 #3
0
class FileBrowserOption(GeneralOption):
    """ A file browser dialog"""
    def __init__(self, option, value=None, directory=False):
        super().__init__(option)
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.browser = FileBrowser(directory=directory)
        self.layout.addWidget(self.browser)
        if value:
            self.browser.set_filenames(value)

    def get_value(self):
        if not self.browser.get_filenames():
            return "''"
        return self.browser.get_filenames()

    def set_enable(self, switch_bool):
        self.browser.set_enable(switch_bool)

    def connect(self, task):
        self.browser.clicked_connect(task)
예제 #4
0
파일: widgets.py 프로젝트: sequana/sequana
class FileBrowserOption(GeneralOption):
    """ A file browser dialog"""
    def __init__(self, option, value=None, directory=False):
        super().__init__(option)
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.browser = FileBrowser(directory=directory)
        self.layout.addWidget(self.browser)
        if value:
            self.browser.set_filenames(value)

    def get_value(self):
        if not self.browser.get_filenames():
            return "''"
        return self.browser.get_filenames()

    def set_enable(self, switch_bool):
        self.browser.set_enable(switch_bool)

    def connect(self, task):
        self.browser.clicked_connect(task)
예제 #5
0
    def __init__(self, parent=None):
        super().__init__(parent=parent)

        self.ui = Ui_Snakemake()
        self.ui.setupUi(self)

        # This is for the --cluster-config case
        # Note the double underscore that is used later to be replaced by a dash
        self.ui.snakemake_options_cluster_cluster__config_value = FileBrowser()
        self.ui.horizontalLayout_4.addWidget(
            self.ui.snakemake_options_cluster_cluster__config_value)

        self._application = "sequana_gui"
        self._section = "snakemake_dialog"
        self.read_settings()

        # Set maximum of local cores to be used
        cpu = multiprocessing.cpu_count()
        self.ui.snakemake_options_local_cores_value.setMaximum(cpu)
예제 #6
0
def test_others(qtbot):
    widget = FileBrowser(paired=True)
    qtbot.addWidget(widget)
    widget.set_enable(True)
    widget.set_enable(False)
    widget.clicked_connect(widget.close)
예제 #7
0
def test_setfilenames(qtbot, tmpdir):
    #tmpdir.join('AA_R1_.fastq.gz').ensure()
    widget = FileBrowser(paired=True)
    qtbot.addWidget(widget)
    widget.set_filenames("AA_R1_.fastq.gz")
    widget.set_filenames("AA_R2_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.fastq.gz")
예제 #8
0
def test_directory_dialog_3(qtbot, tmpdir):
    widget = FileBrowser(paired=True)
    qtbot.addWidget(widget)
예제 #9
0
def test_directory_dialog(qtbot, mock):

    widget = FileBrowser(paired=False, directory=False, file_filter=None)

    qtbot.addWidget(widget)
    widget.show()
    assert widget.isVisible()
    widget.setup_color()

    widget.set_empty_path()
    assert widget.get_filenames() == ""
    assert widget.path_is_setup() == False

    # Now, we open the dialog, which pops up. We need to close it...
    widget = FileBrowser(paired=True, directory=False, file_filter=None)
    qtbot.addWidget(widget)
    #qtbot.mouseClick(widget.btn, QtCore.Qt.LeftButton)

    widget.Nmax = 10
    widget._set_paired_filenames(["test1.fastq.gz"])
    qtbot.addWidget(widget)

    widget.Nmax = 30
    widget._set_paired_filenames(["test1.fastq.gz", "test2.fastq.gz"])
    qtbot.addWidget(widget)
예제 #10
0
def test_others(qtbot):
    widget = FileBrowser(paired=True)
    qtbot.addWidget(widget)
    widget.set_enable(True)
    widget.set_enable(False)
    widget.clicked_connect(widget.close)
예제 #11
0
def test_setfilenames(qtbot, tmpdir):
    #tmpdir.join('AA_R1_.fastq.gz').ensure()
    widget = FileBrowser(paired=True)
    qtbot.addWidget(widget)
    widget.set_filenames("AA_R1_.fastq.gz")
    widget.set_filenames("AA_R2_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.fastq.gz")
예제 #12
0
def test_directory_dialog(qtbot, mock):

    widget = FileBrowser(paired=False, directory=False, file_filter=None)

    qtbot.addWidget(widget)
    widget.show()
    assert widget.isVisible()
    widget.setup_color()

    widget.set_empty_path()
    assert widget.get_filenames() == ""
    assert widget.path_is_setup() == False

    # Now, we open the dialog, which pops up. We need to close it...
    widget = FileBrowser(paired=True, directory=False, file_filter=None)
    qtbot.addWidget(widget)
    #qtbot.mouseClick(widget.btn, QtCore.Qt.LeftButton)

    widget.Nmax = 10
    widget._set_paired_filenames([ "test1.fastq.gz"])
    qtbot.addWidget(widget)

    widget.Nmax = 30
    widget._set_paired_filenames(["test1.fastq.gz", "test2.fastq.gz"])
    qtbot.addWidget(widget)