def izba_file(self): try: if self.check() == True: global files_num self.file = time_check(os.listdir(file_dir), file_dir) os.rename(self.file, rachunki[7]) move(file_dir + "/" + rachunki[7], folder_dir + "/" + dates.strftime("%m.%Y")) MainWindow.showMinimized() files_num = len(os.listdir(file_dir)) except: os.rename(rachunki[7], self.file) msg = QMessageBox() msg.setIcon(QMessageBox.Information) msg.setWindowTitle("Informacja") msg.setText("Ten rachunek już istnieje") x = msg.exec_() pass
def other_file(self): try: if self.check() == True: global files_num self.file = time_check(os.listdir(file_dir), file_dir) self.other, check = QInputDialog.getText(None, 'Input Dialog', 'Jaki to rachunek?') os.rename(self.file, self.other) move(file_dir + "/" + self.other, folder_dir + "/" + dates.strftime("%m.%Y")) MainWindow.showMinimized() files_num = len(os.listdir(file_dir)) except: os.rename(self.other, self.file) msg = QMessageBox() msg.setIcon(QMessageBox.Information) msg.setWindowTitle("Informacja") msg.setText("Ten rachunek już istnieje") x = msg.exec_() pass