liuyuqi-dellpc 7 months ago
parent
commit
a6021743b0
5 changed files with 164 additions and 5 deletions
  1. BIN
      506.png
  2. 1 1
      crawl_mrdx/__init__.py
  3. 7 4
      main.py
  4. 151 0
      main.ui
  5. 5 0
      resources.qrc

BIN
506.png


+ 1 - 1
crawl_mrdx/__init__.py

@@ -9,6 +9,6 @@
 
 from crawl_mrdx.crawl_mrdx import CrawlMrdx
 
-def main(start: str=None, end: str=None):
+def run(start: str=None, end: str=None):
     crawl = CrawlMrdx()
     crawl.crawl(start, end)

+ 7 - 4
main.py

@@ -10,9 +10,12 @@
 '''
 import crawl_mrdx
 import argparse
+
+parser = argparse.ArgumentParser(description='Process some integers.')
+parser.add_argument('--start', dest='start', help="start date" , type=str, default=None,)
+parser.add_argument('--end', dest='end', help="end date", type=str, default=None,)
+
 if __name__ == '__main__':
-    parser = argparse.ArgumentParser(description='Process some integers.')
-    parser.add_argument('--start', dest='start', help="start date" , type=str, default=None,)
-    parser.add_argument('--end', dest='end', help="end date", type=str, default=None,)
     args = parser.parse_args()
-    crawl_mrdx.main(start=args.start, end=args.end)
+    crawl_mrdx.run(start=args.start, end=args.end)
+

+ 151 - 0
main.ui

@@ -0,0 +1,151 @@
+<?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>463</width>
+    <height>266</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>新闻电讯报纸PDF批量下载工具</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="resources.qrc">
+    <normaloff>:/newPrefix/C:/Users/liuyuqi/Desktop/506.png</normaloff>:/newPrefix/C:/Users/liuyuqi/Desktop/506.png</iconset>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <widget class="QPushButton" name="pushButton">
+    <property name="geometry">
+     <rect>
+      <x>190</x>
+      <y>190</y>
+      <width>75</width>
+      <height>23</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>开始</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_5">
+    <property name="geometry">
+     <rect>
+      <x>80</x>
+      <y>50</y>
+      <width>311</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>说明;设置开始抓和结束抓的日期,当前日期会自动更新</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label">
+    <property name="geometry">
+     <rect>
+      <x>70</x>
+      <y>10</y>
+      <width>371</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="styleSheet">
+     <string notr="true">font: 18pt &quot;Algerian&quot;;</string>
+    </property>
+    <property name="text">
+     <string>新闻电讯报纸PDF批量下载工具</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="lb_version">
+    <property name="geometry">
+     <rect>
+      <x>193</x>
+      <y>42</y>
+      <width>71</width>
+      <height>20</height>
+     </rect>
+    </property>
+    <property name="styleSheet">
+     <string notr="true">font: 12pt &quot;Arial&quot;;
+color: rgb(255, 0, 0);</string>
+    </property>
+    <property name="text">
+     <string>v1.0.1</string>
+    </property>
+   </widget>
+   <widget class="QWidget" name="">
+    <property name="geometry">
+     <rect>
+      <x>160</x>
+      <y>100</y>
+      <width>201</width>
+      <height>74</height>
+     </rect>
+    </property>
+    <layout class="QVBoxLayout" name="verticalLayout">
+     <item>
+      <widget class="QLineEdit" name="edt_start"/>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="edt_end"/>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="edt_current"/>
+     </item>
+    </layout>
+   </widget>
+   <widget class="QWidget" name="">
+    <property name="geometry">
+     <rect>
+      <x>100</x>
+      <y>100</y>
+      <width>56</width>
+      <height>71</height>
+     </rect>
+    </property>
+    <layout class="QVBoxLayout" name="verticalLayout_2">
+     <item>
+      <widget class="QLabel" name="lb_start">
+       <property name="text">
+        <string>开始日期</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="lb_end">
+       <property name="text">
+        <string>结束日期</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="lb_current">
+       <property name="text">
+        <string>当前日期</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>463</width>
+     <height>21</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+ </widget>
+ <resources>
+  <include location="resources.qrc"/>
+ </resources>
+ <connections/>
+</ui>

+ 5 - 0
resources.qrc

@@ -0,0 +1,5 @@
+<RCC>
+  <qresource prefix="newPrefix">
+    <file>C:/Users/liuyuqi/Desktop/506.png</file>
+  </qresource>
+</RCC>