takeFiles.py 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # Form implementation generated from reading ui file 'takeFiles.ui'
  2. #
  3. # Created by: PyQt6 UI code generator 6.0.3
  4. #
  5. # WARNING: Any manual changes made to this file will be lost when pyuic6 is
  6. # run again. Do not edit this file unless you know what you are doing.
  7. from PyQt6.QtWidgets import QFileDialog
  8. from PyQt6 import QtCore, QtGui, QtWidgets
  9. # Забей, этот код описывает интерфейс формы выбора папки откуда брать файлы, кроме последней функции EE НЕ УДАЛЯТЬ
  10. class Ui_takeFiles(object):
  11. def setupUi(self, takeFiles):
  12. takeFiles.setObjectName("takeFiles")
  13. takeFiles.resize(745, 163)
  14. takeFiles.setStyleSheet("background-color: rgb(51, 252, 255);")
  15. self.label = QtWidgets.QLabel(takeFiles)
  16. self.label.setGeometry(QtCore.QRect(20, 40, 91, 21))
  17. font = QtGui.QFont()
  18. font.setFamily("Calibri")
  19. font.setPointSize(12)
  20. font.setBold(True)
  21. font.setWeight(75)
  22. self.label.setFont(font)
  23. self.label.setObjectName("label")
  24. self.lineEdit = QtWidgets.QLineEdit(takeFiles)
  25. self.lineEdit.setGeometry(QtCore.QRect(130, 30, 481, 41))
  26. font = QtGui.QFont()
  27. font.setPointSize(10)
  28. self.lineEdit.setFont(font)
  29. self.lineEdit.setStyleSheet("background-color: rgb(255, 255, 255);\n"
  30. "color: rgb(0, 0, 0);")
  31. self.lineEdit.setText("")
  32. self.lineEdit.setObjectName("lineEdit")
  33. self.pushButton = QtWidgets.QPushButton(takeFiles)
  34. self.pushButton.setGeometry(QtCore.QRect(630, 35, 93, 31))
  35. font = QtGui.QFont()
  36. font.setFamily("Calibri")
  37. font.setPointSize(12)
  38. font.setBold(True)
  39. font.setWeight(75)
  40. self.pushButton.setFont(font)
  41. self.pushButton.setStyleSheet("background-color: rgb(255, 255, 255);")
  42. self.pushButton.setObjectName("pushButton")
  43. self.label_2 = QtWidgets.QLabel(takeFiles)
  44. self.label_2.setGeometry(QtCore.QRect(20, 110, 91, 21))
  45. font = QtGui.QFont()
  46. font.setFamily("Calibri")
  47. font.setPointSize(12)
  48. font.setBold(True)
  49. font.setWeight(75)
  50. self.label_2.setFont(font)
  51. self.label_2.setObjectName("label_2")
  52. self.lineEdit_2 = QtWidgets.QLineEdit(takeFiles)
  53. self.lineEdit_2.setGeometry(QtCore.QRect(130, 100, 481, 41))
  54. font = QtGui.QFont()
  55. font.setPointSize(10)
  56. self.lineEdit_2.setFont(font)
  57. self.lineEdit_2.setStyleSheet("background-color: rgb(255, 255, 255);\n"
  58. "color: rgb(0, 0, 0);")
  59. self.lineEdit_2.setText("")
  60. self.lineEdit_2.setObjectName("lineEdit_2")
  61. self.pushButton_2 = QtWidgets.QPushButton(takeFiles)
  62. self.pushButton_2.setGeometry(QtCore.QRect(630, 105, 93, 31))
  63. font = QtGui.QFont()
  64. font.setFamily("Calibri")
  65. font.setPointSize(12)
  66. font.setBold(True)
  67. font.setWeight(75)
  68. self.pushButton_2.setFont(font)
  69. self.pushButton_2.setStyleSheet("background-color: rgb(255, 255, 255);")
  70. self.pushButton_2.setObjectName("pushButton_2")
  71. self.retranslateUi(takeFiles)
  72. QtCore.QMetaObject.connectSlotsByName(takeFiles)
  73. def retranslateUi(self, takeFiles):
  74. _translate = QtCore.QCoreApplication.translate
  75. takeFiles.setWindowTitle(_translate("takeFiles", "Выберите папку с файлами PRISMA"))
  76. self.label.setText(_translate("takeFiles", "1-кластер"))
  77. self.lineEdit.setPlaceholderText(_translate("takeFiles", "Введите папку c нужными файлами"))
  78. self.pushButton.setText(_translate("takeFiles", "Обзор"))
  79. self.label_2.setText(_translate("takeFiles", "2-кластер"))
  80. self.lineEdit_2.setPlaceholderText(_translate("takeFiles", "Введите папку c нужными файлами"))
  81. self.pushButton_2.setText(_translate("takeFiles", "Обзор"))
  82. def get_file_directory(self, filename):
  83. dirlist = QFileDialog.getExistingDirectory()
  84. if filename == 'path_prisma_1cl_files':
  85. self.lineEdit.setText(dirlist)
  86. else:
  87. self.lineEdit_2.setText(dirlist)
  88. with open(filename + '.txt', 'w') as f:
  89. f.write(dirlist)
  90. print(dirlist)