Update DataClass_Pupil.py, MgrCalibreUI.py, and 2 more files...
This commit is contained in:
@@ -18,13 +18,13 @@ from PyQt5.QtGui import QResizeEvent, QCloseEvent, QColor
|
||||
|
||||
class MyApp(QMainWindow):
|
||||
m_DictDuplicate: dict[int, list[str]] = {}
|
||||
m_ListIncomplMngas: list[str] = []
|
||||
m_ListIncompleteMangas: list[str] = []
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.initUI()
|
||||
self.loadINI()
|
||||
self.initDB()
|
||||
self.initUI()
|
||||
|
||||
#
|
||||
def closeEvent(self, a0: 'QCloseEvent | None'):
|
||||
@@ -65,6 +65,8 @@ class MyApp(QMainWindow):
|
||||
if False == os.path.exists(self.pathDB):
|
||||
os.makedirs(self.pathDB, exist_ok=True)
|
||||
|
||||
self.edit_DB.setText(self.pathLastCalibre)
|
||||
|
||||
self.fileNamePupilDB = "MyMangaData.db"
|
||||
self.fileNameCallibreDB = "metadata.db"
|
||||
|
||||
@@ -92,6 +94,7 @@ class MyApp(QMainWindow):
|
||||
settings.setValue(f'folders/{idx}', item.text())
|
||||
|
||||
settings.setValue('folders/count', self.listWidget_Folders.count())
|
||||
settings.setValue('LastCalibrePath', self.edit_DB.text())
|
||||
|
||||
#
|
||||
def initDB(self):
|
||||
@@ -167,7 +170,7 @@ class MyApp(QMainWindow):
|
||||
layout_top = QHBoxLayout()
|
||||
self.edit_DB = QLineEdit(self)
|
||||
self.edit_DB.setReadOnly(True)
|
||||
self.edit_DB.setText(self.pathLastCalibre)
|
||||
self.edit_DB.setText("...")
|
||||
btn_DB = QPushButton("...")
|
||||
btn_DB.setFixedWidth(50)
|
||||
btn_DB.clicked.connect(self.on_btnDB_clicked)
|
||||
@@ -282,12 +285,23 @@ class MyApp(QMainWindow):
|
||||
|
||||
# JSon 데이터의 파일 개수와 실제 다운받은 파일 개수가 다르면 리스트에 저장, 표시한다.
|
||||
if 0 >= nImgFileCnt or 0 >= nImgListLen or nImgFileCnt != nImgListLen:
|
||||
self.m_ListNotCompleteMngas.append(pathDir)
|
||||
self.m_ListIncompleteMangas.append(pathDir)
|
||||
self.SrcTableRowBgColor(nRow, Qt.GlobalColor.lightGray)
|
||||
|
||||
nRow += 1
|
||||
del data
|
||||
|
||||
#
|
||||
def LoadPupilJson(self, path:str) -> None:
|
||||
itemPathFull = os.path.join(path, ".metadata")
|
||||
if False == os.path.exists(itemPathFull):
|
||||
util.DbgOut(f"JSon File not found: {itemPathFull}", True)
|
||||
return
|
||||
|
||||
data = pupil.PupilData(itemPathFull)
|
||||
print(data.GetText())
|
||||
|
||||
|
||||
## metadata.db
|
||||
def LoadCalibreDB(self, path:str ) -> None:
|
||||
pathDB = path
|
||||
@@ -321,7 +335,7 @@ class MyApp(QMainWindow):
|
||||
self.tableWidget_DB.setItem(nRow, 2, itemCover)
|
||||
|
||||
# format, uncompressed_size, name
|
||||
tupleData = DB.GetDataByBookID(int(strID))
|
||||
tupleData = self.DBCalibre.GetDataByBookID(int(strID))
|
||||
itemExt = QTableWidgetItem(tupleData[0])
|
||||
pathArc = os.path.join(path, strBookPath, f"{tupleData[2]}.{tupleData[0]}")
|
||||
if False == os.path.exists(pathArc):
|
||||
@@ -361,7 +375,7 @@ class MyApp(QMainWindow):
|
||||
# 중복 검사을 위한 딕셔너리 초기화
|
||||
self.m_DictDuplicate.clear()
|
||||
# 다운로드가 완료되지 않은 만화 목록 초기화
|
||||
self.m_ListNotCompleteMngas.clear()
|
||||
self.m_ListIncompleteMangas.clear()
|
||||
# 테이블 위젯 비우기
|
||||
self.tableWidget_Src.setRowCount(0)
|
||||
|
||||
@@ -412,7 +426,7 @@ class MyApp(QMainWindow):
|
||||
def on_btn_Emptyfolder_clicked(self):
|
||||
folder_path = QFileDialog.getExistingDirectory(self, '폴더 선택', '')
|
||||
|
||||
for pathItem in self.m_ListNotCompleteMngas:
|
||||
for pathItem in self.m_ListIncompleteMangas:
|
||||
# 유효하지 않은 경로면 건드리지 말자
|
||||
if False == os.path.exists(pathItem):
|
||||
continue
|
||||
@@ -451,7 +465,13 @@ class MyApp(QMainWindow):
|
||||
|
||||
#
|
||||
def on_btn_Archive_clicked(self):
|
||||
pass
|
||||
itemCount = self.tableWidget_Src.rowCount()
|
||||
if 0 >= itemCount:
|
||||
return
|
||||
|
||||
for idx in range(itemCount):
|
||||
item = self.tableWidget_Src.item(idx, 0)
|
||||
self.LoadPupilJson(item.text())
|
||||
|
||||
#
|
||||
def on_btn_EnterCalibre_clicked(self):
|
||||
|
||||
Reference in New Issue
Block a user