kindle manager

This commit is contained in:
gavin
2020-06-01 15:27:24 +08:00
parent b4e23cf5e3
commit dbe3cad7f4
30 changed files with 181 additions and 4 deletions

View File

@@ -31,27 +31,27 @@ b['1']['2'] = {'3':1} # OK
- no c/c++/java/perl switch-case, not use two much if-elif-elif, use this to simplify:
```
suff = {'MD':'.md','CSV':'.csv','JSON':'.json'}
198 op = OUTPREF+suff[ft]
op = OUTPREF+suff[ft]
```
- assign value style is pithiness
```
(authinfo, dateinfo, content) = (s[0], s[1], s[2] if len(s)==3 else None)
```
## 1.0.1 (20200530)
## 1.0.2 (20200530)
### feature
- remove duplication
- refactor some code
- optimize search feature
## learn lesson
- change dict keys between iteration, will throw RuntimeError:
dictionary changed size during iteration
- reference - http://www.cocoachina.com/articles/89748
- pyQt5 reference - https://www.learnpyqt.com/
# feature plan
## 20200528
- optimize search feature
- first abstract from kindle hard / local directory for different OS
- add GUI use QT

BIN
icons/Ab10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
icons/Ab2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
icons/Ab5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
icons/Ab6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
icons/Ar18.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
icons/Ar5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
icons/Cbb14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
icons/Cbb20.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
icons/file1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
icons/file18.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

23
kmanapp.py Normal file
View File

@@ -0,0 +1,23 @@
# This Python file uses the following encoding: utf-8
import sys
from PySide2.QtWidgets import QApplication
from PySide2.QtWidgets import QApplication
from PySide2.QtWidgets import QMainWindow
from mainwindow import Ui_MainWindow # 加载我们的布局
class UsingTest(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
super(UsingTest, self).__init__(*args, **kwargs)
self.setupUi(self) # 初始化ui
# 在这里可以做一些UI的操作了或者是点击事件或者是别的
# 也可以另外写方法可以改变lable的内容
if __name__ == "__main__":
import sys
from PySide2.QtWidgets import QApplication, QLabel
app = QApplication(sys.argv)
mw = UsingTest()
mw.show()
app.exec_()

3
kmanapp.pyproject Normal file
View File

@@ -0,0 +1,3 @@
{
"files": ["kmanapp.py"]
}

74
mainwindow.py Normal file
View File

@@ -0,0 +1,74 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'mainwindow.ui'
##
## Created by: Qt User Interface Compiler version 5.15.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide2.QtCore import (QCoreApplication, QDate, QDateTime, QMetaObject,
QObject, QPoint, QRect, QSize, QTime, QUrl, Qt)
from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont,
QFontDatabase, QIcon, QKeySequence, QLinearGradient, QPalette, QPainter,
QPixmap, QRadialGradient)
from PySide2.QtWidgets import *
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
if not MainWindow.objectName():
MainWindow.setObjectName(u"MainWindow")
MainWindow.resize(800, 600)
self.actionimport = QAction(MainWindow)
self.actionimport.setObjectName(u"actionimport")
icon = QIcon(QIcon.fromTheme(u"Ab6.png"))
self.actionimport.setIcon(icon)
self.actionimport_2 = QAction(MainWindow)
self.actionimport_2.setObjectName(u"actionimport_2")
self.actionimport_3 = QAction(MainWindow)
self.actionimport_3.setObjectName(u"actionimport_3")
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName(u"centralwidget")
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QStatusBar(MainWindow)
self.statusbar.setObjectName(u"statusbar")
MainWindow.setStatusBar(self.statusbar)
self.toolBar = QToolBar(MainWindow)
self.toolBar.setObjectName(u"toolBar")
MainWindow.addToolBar(Qt.TopToolBarArea, self.toolBar)
self.menuBar = QMenuBar(MainWindow)
self.menuBar.setObjectName(u"menuBar")
self.menuBar.setGeometry(QRect(0, 0, 800, 22))
self.menuImport = QMenu(self.menuBar)
self.menuImport.setObjectName(u"menuImport")
MainWindow.setMenuBar(self.menuBar)
self.toolBar.addAction(self.actionimport)
self.toolBar.addAction(self.actionimport_2)
self.toolBar.addAction(self.actionimport_3)
self.menuBar.addAction(self.menuImport.menuAction())
self.menuImport.addAction(self.actionimport_2)
self.menuImport.addAction(self.actionimport_3)
self.retranslateUi(MainWindow)
QMetaObject.connectSlotsByName(MainWindow)
# setupUi
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
self.actionimport.setText(QCoreApplication.translate("MainWindow", u"Import", None))
#if QT_CONFIG(tooltip)
self.actionimport.setToolTip(QCoreApplication.translate("MainWindow", u"import clipping file from kindle", None))
#endif // QT_CONFIG(tooltip)
#if QT_CONFIG(shortcut)
self.actionimport.setShortcut(QCoreApplication.translate("MainWindow", u"Meta+I", None))
#endif // QT_CONFIG(shortcut)
self.actionimport_2.setText(QCoreApplication.translate("MainWindow", u"import", None))
self.actionimport_3.setText(QCoreApplication.translate("MainWindow", u"import", None))
self.toolBar.setWindowTitle(QCoreApplication.translate("MainWindow", u"toolBar", None))
self.menuImport.setTitle(QCoreApplication.translate("MainWindow", u"Import", None))
# retranslateUi

77
mainwindow.ui Normal file
View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget"/>
<widget class="QStatusBar" name="statusbar"/>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="actionimport"/>
<addaction name="actionimport_2"/>
<addaction name="actionimport_3"/>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuImport">
<property name="title">
<string>Import</string>
</property>
<addaction name="actionimport_2"/>
<addaction name="actionimport_3"/>
</widget>
<addaction name="menuImport"/>
</widget>
<action name="actionimport">
<property name="icon">
<iconset theme="Ab6.png"/>
</property>
<property name="text">
<string>Import</string>
</property>
<property name="toolTip">
<string>import clipping file from kindle</string>
</property>
<property name="shortcut">
<string>Meta+I</string>
</property>
</action>
<action name="actionimport_2">
<property name="text">
<string>import</string>
</property>
</action>
<action name="actionimport_3">
<property name="text">
<string>import</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>

BIN
ui/屏幕截图(10).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 KiB

BIN
ui/屏幕截图(11).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 KiB

BIN
ui/屏幕截图(12).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 KiB

BIN
ui/屏幕截图(13).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
ui/屏幕截图(14).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
ui/屏幕截图(15).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 KiB

BIN
ui/屏幕截图(16).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 KiB

BIN
ui/屏幕截图(2).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 KiB

BIN
ui/屏幕截图(3).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 KiB

BIN
ui/屏幕截图(4).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 873 KiB

BIN
ui/屏幕截图(5).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 912 KiB

BIN
ui/屏幕截图(6).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 KiB

BIN
ui/屏幕截图(7).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 925 KiB

BIN
ui/屏幕截图(8).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 KiB

BIN
ui/屏幕截图(9).png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 798 KiB