@@ -308,6 +308,11 | |||
|
308 | 308 | var_cmd = "cp -rfv "+var_output[1] .split()[-1]+"/ "+var_Rpath_tmpdata+"/" |
|
309 | 309 | return var_cmd |
|
310 | 310 | |
|
311 | def cmd_manual_check(var_data_dir, var_TDpath): | |
|
312 | ||
|
313 | var_cmd = "cp -rfv "+var_data_dir+"/ "+var_TDpath+"/" | |
|
314 | return var_cmd | |
|
315 | ||
|
311 | 316 | |
|
312 | 317 | def remove_iso(self): |
|
313 | 318 | var_Rpath_iso=self.var_Rpath+"/iso" |
@@ -80,6 +80,23 | |||
|
80 | 80 | return var_dev_sr |
|
81 | 81 | |
|
82 | 82 | |
|
83 | #----------------------------------- expulsa los dispositivos de grabacion -------------------------------------------- | |
|
84 | def mounted_devices(): | |
|
85 | var_output=commands.getstatusoutput('df -hT | grep tmpfs') | |
|
86 | ||
|
87 | if var_output[0] != 0: | |
|
88 | return "FATAL ERROR" | |
|
89 | ||
|
90 | else: | |
|
91 | if len(var_output[1]) == 0: | |
|
92 | return "FATAL ERROR" | |
|
93 | ||
|
94 | list_dirs = [] | |
|
95 | for var_dir in var_output[1].split('\n'): | |
|
96 | list_dirs.append(var_dir.split()[-1]) | |
|
97 | ||
|
98 | return list_dirs | |
|
99 | ||
|
83 | 100 | |
|
84 | 101 | #----------------------------------- listado de los dispositivos de grabacion seleccionados -------------------------------------------- |
|
85 | 102 | |
@@ -222,7 +239,7 | |||
|
222 | 239 | |
|
223 | 240 | #---------------------------------------------- Actualiza estado en los labels ------------------------------------------------------- |
|
224 | 241 | |
|
225 |
def update_message(type, message, self, index=0 |
|
|
242 | def update_message(type, message, self, index=0): | |
|
226 | 243 | if index == 0: |
|
227 | 244 | var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices) |
|
228 | 245 | else: |
@@ -43,6 +43,7 | |||
|
43 | 43 | self.var_real_burn = True |
|
44 | 44 | self.var_real_check = True |
|
45 | 45 | self.var_real_eject = True |
|
46 | self.var_real_manual_check = True | |
|
46 | 47 | self.var_real_show_cmd = True |
|
47 | 48 | |
|
48 | 49 | else: |
@@ -50,8 +51,9 | |||
|
50 | 51 | self.var_real_detect_devices = False |
|
51 | 52 | self.var_real_iso = False |
|
52 | 53 | self.var_real_burn = False |
|
53 |
self.var_real_check = |
|
|
54 | self.var_real_check = False | |
|
54 | 55 | self.var_real_eject = False |
|
56 | self.var_real_manual_check = False | |
|
55 | 57 | self.var_real_show_cmd = True |
|
56 | 58 | |
|
57 | 59 | if self.var_real_detect_devices == True: |
@@ -121,6 +123,10 | |||
|
121 | 123 | self.connect(self.process_check, QtCore.SIGNAL('readyReadStandardError()'), self.readError_check) |
|
122 | 124 | self.connect(self.process_check, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_check) |
|
123 | 125 | |
|
126 | self.process_manual_check = QtCore.QProcess() | |
|
127 | self.connect(self.process_manual_check, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_manual_check) | |
|
128 | self.connect(self.process_manual_check, QtCore.SIGNAL('readyReadStandardError()'), self.readError_manual_check) | |
|
129 | self.connect(self.process_manual_check, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_manual_check) | |
|
124 | 130 | |
|
125 | 131 | def changeParameters(self): |
|
126 | 132 | dlg=QtGui.QDialog() |
@@ -485,6 +491,50 | |||
|
485 | 491 | |
|
486 | 492 | functions.is_last_disc_and_copy(self) |
|
487 | 493 | |
|
494 | #----------------------------------------------------- Funciones del proceso de verificacion manual --------------------------------------------------------------- | |
|
495 | ||
|
496 | def readOuput_manual_check(self): | |
|
497 | self.txtProgress.setText("stdout check: " + QtCore.QString(self.process_manual_check.readAllStandardOutput())) | |
|
498 | ||
|
499 | def readError_manual_check(self): | |
|
500 | self.txtProgress.setText("stderr check: " + QtCore.QString(self.process_manual_check.readAllStandardError())) | |
|
501 | ||
|
502 | def finished_manual_check(self): | |
|
503 | self.txtProgress.clear() | |
|
504 | ||
|
505 | if not(self.bool_state_manual_check): | |
|
506 | return | |
|
507 | ||
|
508 | if self.process_manual_check.exitCode() == 0: | |
|
509 | self.txtInfo.append("--------Complete checking, disc: "+str(self.var_n_check_dirs + 1)) | |
|
510 | functions2.update_message(2, "CHECKED", self, index=self.var_n_check_dirs) | |
|
511 | ||
|
512 | else: | |
|
513 | self.txtInfo.append("#######Error checking, disc: "+str(self.var_n_check_dirs + 1) | |
|
514 | +", code "+QtCore.QString(self.process_manual_check.exitCode())) | |
|
515 | functions2.update_message(2, "ERROR", self, index=self.var_n_check_dirs) | |
|
516 | ||
|
517 | #borrar el contenido de tmpdata | |
|
518 | var_tmpdata=self.var_Rpath+"/tmpdata" | |
|
519 | ||
|
520 | bool_return = functions.remove_dir(var_tmpdata, self) | |
|
521 | if not(bool_return): | |
|
522 | self.txtInfo.append("Error deleting directory: "+var_tmpdata) | |
|
523 | self.bool_state_burning = False | |
|
524 | return | |
|
525 | ||
|
526 | bool_return = functions.make_dir(var_tmpdata, self) | |
|
527 | if not(bool_return): | |
|
528 | self.txtInfo.append("Error creating directory:"+ var_tmpdata) | |
|
529 | self.bool_state_burning = False | |
|
530 | return | |
|
531 | ||
|
532 | if self.var_n_check_dirs >= len(self.list_check_dirs) : | |
|
533 | self.bool_state_manual_check = False | |
|
534 | return | |
|
535 | ||
|
536 | self.var_n_check_dirs +=1 | |
|
537 | self.manual_check() | |
|
488 | 538 | |
|
489 | 539 | |
|
490 | 540 | #============================================================================== |
@@ -656,6 +706,8 | |||
|
656 | 706 | self.var_TDpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
657 | 707 | self.txtTDpath.setText(self.var_TDpath) |
|
658 | 708 | self.statusTDpath = functions.dir_exists(self.var_TDpath, self) |
|
709 | if self.statusTDpath: | |
|
710 | self.btnCHstart.setEnabled(True) | |
|
659 | 711 | |
|
660 | 712 | |
|
661 | 713 | @pyqtSignature("") |
@@ -663,4 +715,44 | |||
|
663 | 715 | """ |
|
664 | 716 | Slot documentation goes here. |
|
665 | 717 | """ |
|
666 | pass | |
|
718 | list_dirs = functions2.mounted_devices() | |
|
719 | if list_dirs == "FATAL ERROR": | |
|
720 | self.txtInfo.append("ERROR") | |
|
721 | return | |
|
722 | ||
|
723 | for i in list_dirs: | |
|
724 | self.txtInfo.append(i) | |
|
725 | ||
|
726 | self.list_check_dirs = list_dirs #contiene los directorios donde estan montados los discos a verificar | |
|
727 | self.var_n_check_dirs = 0 | |
|
728 | self.bool_state_manual_check = True | |
|
729 | ||
|
730 | self.btnTDpath.setEnabled(False) #Deshabilito el boton que permite cambiar la ruta de verificacion | |
|
731 | self.btnCHstart.setText("STOP") #Cambio el texto del boton | |
|
732 | ||
|
733 | self.function_manual_check() | |
|
734 | ||
|
735 | ||
|
736 | def function_manual_check(self): | |
|
737 | ||
|
738 | #Verificacion de los discos | |
|
739 | if self.bool_state_manual_check == True: | |
|
740 | ||
|
741 | self.txtInfo.append("-----------manually checking disc: "+self.var_n_check_dirs | |
|
742 | +" data"+self.list_check_dirs[self.var_n_check_dirs]) | |
|
743 | ||
|
744 | functions2.update_message(2, "CHECKING", self, index=self.var_n_check_dirs) | |
|
745 | ||
|
746 | var_data_dir = self.list_check_dirs[self.var_n_check_dirs] #Carpeta donde esta montado el disco actual | |
|
747 | ||
|
748 | var_cmd = functions.cmd_manual_check(var_data_dir, self.var_TDpath) | |
|
749 | ||
|
750 | if self.var_real_show_cmd == True: | |
|
751 | self.txtInfo.append("CMD: "+var_cmd) | |
|
752 | ||
|
753 | if self.var_real_manual_check == False: | |
|
754 | self.txtInfo.append('**function_manual_check') | |
|
755 | var_cmd="echo 'function_manual_check'" | |
|
756 | ||
|
757 | self.process_manual_check.start(var_cmd) | |
|
758 |
@@ -2,8 +2,8 | |||
|
2 | 2 | |
|
3 | 3 | # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/About.ui' |
|
4 | 4 | # |
|
5 |
# Created: |
|
|
6 |
# by: PyQt4 UI code generator 4. |
|
|
5 | # Created: Wed May 26 16:31:58 2010 | |
|
6 | # by: PyQt4 UI code generator 4.6 | |
|
7 | 7 | # |
|
8 | 8 | # WARNING! All changes made in this file will be lost! |
|
9 | 9 |
@@ -2,8 +2,8 | |||
|
2 | 2 | |
|
3 | 3 | # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/MainWindow.ui' |
|
4 | 4 | # |
|
5 |
# Created: |
|
|
6 |
# by: PyQt4 UI code generator 4. |
|
|
5 | # Created: Wed May 26 16:31:57 2010 | |
|
6 | # by: PyQt4 UI code generator 4.6 | |
|
7 | 7 | # |
|
8 | 8 | # WARNING! All changes made in this file will be lost! |
|
9 | 9 | |
@@ -12,7 +12,7 | |||
|
12 | 12 | class Ui_MainWindow(object): |
|
13 | 13 | def setupUi(self, MainWindow): |
|
14 | 14 | MainWindow.setObjectName("MainWindow") |
|
15 |
MainWindow.resize( |
|
|
15 | MainWindow.resize(824, 717) | |
|
16 | 16 | self.centralwidget = QtGui.QWidget(MainWindow) |
|
17 | 17 | self.centralwidget.setObjectName("centralwidget") |
|
18 | 18 | self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget) |
@@ -458,6 +458,7 | |||
|
458 | 458 | self.horizontalLayout_17.addItem(spacerItem13) |
|
459 | 459 | self.txtTDpath = QtGui.QLineEdit(self.tabStatus) |
|
460 | 460 | self.txtTDpath.setEnabled(False) |
|
461 | self.txtTDpath.setReadOnly(True) | |
|
461 | 462 | self.txtTDpath.setObjectName("txtTDpath") |
|
462 | 463 | self.horizontalLayout_17.addWidget(self.txtTDpath) |
|
463 | 464 | self.btnTDpath = QtGui.QPushButton(self.tabStatus) |
@@ -576,7 +577,7 | |||
|
576 | 577 | self.verticalLayout.addLayout(self.horizontalLayout_2) |
|
577 | 578 | MainWindow.setCentralWidget(self.centralwidget) |
|
578 | 579 | self.menubar = QtGui.QMenuBar(MainWindow) |
|
579 |
self.menubar.setGeometry(QtCore.QRect(0, 0, |
|
|
580 | self.menubar.setGeometry(QtCore.QRect(0, 0, 824, 25)) | |
|
580 | 581 | self.menubar.setObjectName("menubar") |
|
581 | 582 | self.menuFile = QtGui.QMenu(self.menubar) |
|
582 | 583 | self.menuFile.setObjectName("menuFile") |
@@ -603,7 +604,7 | |||
|
603 | 604 | self.menubar.addAction(self.menuHelp.menuAction()) |
|
604 | 605 | |
|
605 | 606 | self.retranslateUi(MainWindow) |
|
606 |
self.tabWidget.setCurrentIndex( |
|
|
607 | self.tabWidget.setCurrentIndex(2) | |
|
607 | 608 | self.lstDcapacity.setCurrentIndex(2) |
|
608 | 609 | QtCore.QObject.connect(self.actionQuit, QtCore.SIGNAL("triggered()"), MainWindow.close) |
|
609 | 610 | QtCore.QObject.connect(self.chkCheck, QtCore.SIGNAL("toggled(bool)"), self.txtTDpath.setEnabled) |
@@ -2,8 +2,8 | |||
|
2 | 2 | |
|
3 | 3 | # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/Parameters.ui' |
|
4 | 4 | # |
|
5 |
# Created: |
|
|
6 |
# by: PyQt4 UI code generator 4. |
|
|
5 | # Created: Wed May 26 16:31:58 2010 | |
|
6 | # by: PyQt4 UI code generator 4.6 | |
|
7 | 7 | # |
|
8 | 8 | # WARNING! All changes made in this file will be lost! |
|
9 | 9 |
General Comments 0
You need to be logged in to leave comments.
Login now