Пример #1
0
    def limitPushButtonPressed(self, button):

        self.limit_pushButton.setEnabled(False)

        if self.limit_comboBox.currentText() == "KiB/s":

            limit_value = str(self.limit_spinBox.value()) + str("K")
        else:
            limit_value = str(self.limit_spinBox.value()) + str("M")

        # if download was started before , send the limit_speed request to aria2 .
        # else save the request in data_base
        for i in [0, 1]:

            gid = self.gid_list[i]
            dictionary = self.parent.persepolis_db.searchGidInDownloadTable(
                gid)
            status = dictionary['status']

            if status != 'scheduled':

                download.limitSpeed(self.gid, limit_value)
            else:
                # update limit value in data_base
                add_link_dictionary = {'gid': gid, 'limit_value': limit_value}
                self.parent.persepolis_db.updateAddLinkTable(
                    [add_link_dictionary])
Пример #2
0
    def limitCheckBoxToggled(self, checkBoxes):

        # user checked limit_checkBox
        if self.limit_checkBox.isChecked() == True:
            self.limit_frame.setEnabled(True)
            self.limit_pushButton.setEnabled(True)

        # user unchecked limit_checkBox
        else:
            self.limit_frame.setEnabled(False)

            # check download status is "scheduled" or not!
            for i in [0, 1]:
                gid = self.gid_list[i]
                dictionary = self.parent.persepolis_db.searchGidInDownloadTable(
                    gid)
                status = dictionary['status']

                if status != 'scheduled':

                    # tell aria2 for unlimited speed
                    download.limitSpeed(gid, "0")

                else:
                    # update limit value in data_base
                    add_link_dictionary = {'gid': gid, 'limit_value': '0'}
                    self.parent.persepolis_db.updateAddLinkTable(
                        [add_link_dictionary])
Пример #3
0
    def limitPushButtonPressed(self, button):
        self.limit_pushButton.setEnabled(False)
        if self.limit_comboBox.currentText() == "KiB/s":
            limit_value = str(self.limit_spinBox.value()) + str("K")
        else:
            limit_value = str(self.limit_spinBox.value()) + str("M")
# if download was started before , send the limit_speed request to aria2 .
# else save the request in data_base

        if self.status != 'scheduled':
            download.limitSpeed(self.gid, limit_value)
        else:
            # update limit value in data_base
            add_link_dictionary = {'gid': self.gid, 'limit_value': limit_value}
            self.parent.persepolis_db.updateAddLinkTable([add_link_dictionary])
Пример #4
0
 def limitCheckBoxToggled(self, checkBoxes):
     if self.limit_checkBox.isChecked() == True:
         self.limit_frame.setEnabled(True)
         self.limit_pushButton.setEnabled(True)
     else:
         self.limit_frame.setEnabled(False)
         if self.status != 'scheduled':
             download.limitSpeed(self.gid, "0")
         else:
             download_info_file = download_info_folder + '/' + self.gid
             download_info_file_list = readList(download_info_file)
             add_link_dictionary = download_info_file_list[9]
             add_link_dictionary['limit'] = '0'
             download_info_file_list[9] = add_link_dictionary
             writeList(download_info_file, download_info_file_list)
Пример #5
0
    def limitPushButtonPressed(self, button):
        self.limit_pushButton.setEnabled(False)
        if self.limit_comboBox.currentText() == "KiB/s":
            limit_value = str(self.limit_spinBox.value()) + str("K")
        else:
            limit_value = str(self.limit_spinBox.value()) + str("M")
# if download was started before , send the limit_speed request to aria2 .
# else save the request in data_base

        if self.status != STATUS.DOWNLOAD.SCHEDULED:
            download.limitSpeed(self.gid, limit_value)
        else:
            # update limit value in data_base
            add_link_dictionary = {'gid': self.gid, 'limit_value': limit_value}
            self.parent.persepolis_db.updateAddLinkTable([add_link_dictionary])
Пример #6
0
    def limitPushButtonPressed(self, button):
        self.limit_pushButton.setEnabled(False)
        if self.limit_comboBox.currentText() == "KB/S":
            limit = str(self.limit_spinBox.value()) + str("K")
        else:
            limit = str(self.limit_spinBox.value()) + str("M")
# if download was started before , send the limit_speed request to aria2 .
# else save the request in download_information_file
        if self.status != 'scheduled':
            download.limitSpeed(self.gid, limit)
        else:
            download_info_file = os.path.join(download_info_folder, self.gid)
            download_info_file_list = readList(download_info_file)
            add_link_dictionary = download_info_file_list[9]
            add_link_dictionary['limit'] = limit
            download_info_file_list[9] = add_link_dictionary
            writeList(download_info_file, download_info_file_list)
Пример #7
0
    def limitCheckBoxToggled(self, checkBoxes):

        # user checked limit_checkBox
        if self.limit_checkBox.isChecked() == True:
            self.limit_frame.setEnabled(True)
            self.limit_pushButton.setEnabled(True)

        # user unchecked limit_checkBox
        else:
            self.limit_frame.setEnabled(False)

            # check download status is "scheduled" or not!
            if self.status != 'scheduled':
                # tell aria2 for unlimiting speed
                download.limitSpeed(self.gid, "0")
            else:
                # update limit value in data_base
                add_link_dictionary = {'gid': self.gid, 'limit_value': '0'}
                self.parent.persepolis_db.updateAddLinkTable([add_link_dictionary])
Пример #8
0
    def limitCheckBoxToggled(self, checkBoxes):

        # user checked limit_checkBox
        if self.limit_checkBox.isChecked() == True:
            self.limit_frame.setEnabled(True)
            self.limit_pushButton.setEnabled(True)

        # user unchecked limit_checkBox
        else:
            self.limit_frame.setEnabled(False)

            # check download status is "scheduled" or not!
            if self.status != STATUS.DOWNLOAD.SCHEDULED:
                # tell aria2 for unlimiting speed
                download.limitSpeed(self.gid, "0")
            else:
                # update limit value in data_base
                add_link_dictionary = {'gid': self.gid, 'limit_value': '0'}
                self.parent.persepolis_db.updateAddLinkTable([add_link_dictionary])