Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
O
oie-year-report-analyse
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
齐昊宇
oie-year-report-analyse
Commits
4b52c849
Commit
4b52c849
authored
Sep 30, 2019
by
齐昊宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表5数据完成
parent
bf6b0f0f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
552 additions
and
461 deletions
+552
-461
vcs.xml
.idea/vcs.xml
+6
-0
workspace.xml
.idea/workspace.xml
+94
-80
utils.py
postgre/utils.py
+32
-0
test.py
test.py
+420
-381
No files found.
.idea/vcs.xml
0 → 100644
View file @
4b52c849
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
.idea/workspace.xml
View file @
4b52c849
...
...
@@ -4,7 +4,11 @@
<bookmark
url=
"file://$PROJECT_DIR$/yearly_report_analysis.py"
line=
"157"
mnemonic=
"9"
/>
</component>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"5bfc29c1-469c-4de2-8833-97586daff38c"
name=
"Default Changelist"
comment=
""
/>
<list
default=
"true"
id=
"5bfc29c1-469c-4de2-8833-97586daff38c"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/postgre/utils.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/postgre/utils.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/test.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/test.py"
afterDir=
"false"
/>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
...
@@ -46,19 +50,21 @@
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/test.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
191
"
>
<caret
line=
"2
28"
lean-forward=
"true"
selection-start-line=
"228"
selection-end-line=
"228
"
/>
<state
relative-caret-position=
"
307
"
>
<caret
line=
"2
85"
lean-forward=
"true"
selection-start-line=
"285"
selection-end-line=
"285
"
/>
<folding>
<element
signature=
"e#289#1001#0"
/>
<element
signature=
"e#1037#1269#0"
/>
<element
signature=
"e#1297#1808#0"
/>
<element
signature=
"e#4657#4722#0"
/>
<element
signature=
"e#5614#5886#0"
/>
<element
signature=
"e#6594#7779#0"
/>
<element
signature=
"e#7403#7830#0"
/>
<element
signature=
"e#11396#11553#0"
/>
<element
signature=
"e#11612#11748#0"
/>
<element
signature=
"e#12669#12816#0"
/>
<element
signature=
"e#1297#1863#0"
/>
<element
signature=
"e#1726#2161#0"
/>
<element
signature=
"e#5308#5373#0"
/>
<element
signature=
"e#5419#6227#0"
/>
<element
signature=
"e#6276#6548#0"
/>
<element
signature=
"e#6594#7591#0"
/>
<element
signature=
"e#7640#8067#0"
/>
<element
signature=
"e#7780#8528#0"
/>
<element
signature=
"e#8910#9403#0"
/>
<element
signature=
"e#7800#8175#0"
/>
</folding>
</state>
</provider>
...
...
@@ -67,7 +73,7 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/main.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
311
"
>
<state
relative-caret-position=
"
4446
"
>
<caret
line=
"141"
column=
"24"
selection-start-line=
"141"
selection-start-column=
"24"
selection-end-line=
"141"
selection-end-column=
"24"
/>
<folding>
<element
signature=
"e#0#39#0"
expanded=
"true"
/>
...
...
@@ -86,8 +92,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/postgre/utils.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
1464
"
>
<caret
line=
"
77"
column=
"21"
lean-forward=
"true"
selection-start-line=
"77"
selection-start-column=
"21"
selection-end-line=
"77"
selection-end-column=
"21
"
/>
<state
relative-caret-position=
"
261
"
>
<caret
line=
"
109"
column=
"14"
selection-start-line=
"109"
selection-start-column=
"14"
selection-end-line=
"109"
selection-end-column=
"14
"
/>
<folding>
<element
signature=
"e#14#29#0"
expanded=
"true"
/>
</folding>
...
...
@@ -98,7 +104,7 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/have_7.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
42
0"
>
<state
relative-caret-position=
"
86580
0"
>
<caret
line=
"22200"
selection-start-line=
"22200"
selection-end-line=
"22200"
/>
</state>
</provider>
...
...
@@ -107,7 +113,7 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/yearly_report_analysis.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
1336
"
>
<state
relative-caret-position=
"
4212
"
>
<caret
line=
"109"
selection-start-line=
"109"
selection-end-line=
"109"
/>
<folding>
<element
signature=
"e#0#29#0"
expanded=
"true"
/>
...
...
@@ -119,7 +125,7 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://D:/Program/python/Lib/site-packages/bs4/element.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state>
<state
relative-caret-position=
"50817"
>
<caret
line=
"1305"
column=
"8"
selection-start-line=
"1305"
selection-start-column=
"8"
selection-end-line=
"1305"
selection-end-column=
"8"
/>
</state>
</provider>
...
...
@@ -167,7 +173,6 @@
<find>
nos
</find>
<find>
titles
</find>
<find>
psqlUtil
</find>
<find>
print
</find>
<find>
i.find
</find>
<find>
start
</find>
<find>
summary_col_dict
</find>
...
...
@@ -176,11 +181,15 @@
<find>
disease_name
</find>
<find>
is_exist
</find>
<find>
standard
</find>
<find>
print
</find>
</findStrings>
<replaceStrings>
<replace>
analysis_title_is_td
</replace>
</replaceStrings>
</component>
<component
name=
"Git.Settings"
>
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
</component>
<component
name=
"IdeDocumentHistory"
>
<option
name=
"CHANGED_PATHS"
>
<list>
...
...
@@ -196,16 +205,17 @@
<option
value=
"$PROJECT_DIR$/yearly_report_analysis.py"
/>
<option
value=
"$APPLICATION_CONFIG_DIR$/pycharm64.exe.vmoptions"
/>
<option
value=
"$PROJECT_DIR$/main.py"
/>
<option
value=
"$PROJECT_DIR$/postgre/utils.py"
/>
<option
value=
"$PROJECT_DIR$/test.py"
/>
<option
value=
"$PROJECT_DIR$/postgre/utils.py"
/>
</list>
</option>
</component>
<component
name=
"ProjectFrameBounds"
>
<option
name=
"x"
value=
"95
8
"
/>
<component
name=
"ProjectFrameBounds"
extendedState=
"7"
>
<option
name=
"x"
value=
"95
3
"
/>
<option
name=
"width"
value=
"974"
/>
<option
name=
"height"
value=
"1047"
/>
</component>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"true"
/>
<component
name=
"ProjectView"
>
<navigator
proportions=
""
version=
"1"
>
<foldersAlwaysOnTop
value=
"true"
/>
...
...
@@ -233,6 +243,7 @@
<component
name=
"PropertiesComponent"
>
<property
name=
"DatabaseDriversLRU"
value=
"postgresql"
/>
<property
name=
"DefaultHtmlFileTemplate"
value=
"HTML File"
/>
<property
name=
"SHARE_PROJECT_CONFIGURATION_FILES"
value=
"true"
/>
<property
name=
"WebServerToolWindowFactoryState"
value=
"false"
/>
<property
name=
"database.console.LAST_STATE"
value=
"false"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$/../oie_spider"
/>
...
...
@@ -408,12 +419,13 @@
<workItem
from=
"1569221253783"
duration=
"8913000"
/>
<workItem
from=
"1569460611893"
duration=
"3132000"
/>
<workItem
from=
"1569548853086"
duration=
"18519000"
/>
<workItem
from=
"1569719220349"
duration=
"10656000"
/>
<workItem
from=
"1569719220349"
duration=
"11212000"
/>
<workItem
from=
"1569805107950"
duration=
"8667000"
/>
</task>
<servers
/>
</component>
<component
name=
"TimeTrackingManager"
>
<option
name=
"totallyTimeSpent"
value=
"1
87220
000"
/>
<option
name=
"totallyTimeSpent"
value=
"1
96443
000"
/>
</component>
<component
name=
"TodoView"
>
<todo-panel
id=
"selected-file"
>
...
...
@@ -425,7 +437,7 @@
</todo-panel>
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"
958"
y=
"0"
width=
"974"
height=
"1047"
extended-state=
"0
"
/>
<frame
x=
"
-8"
y=
"-8"
width=
"1936"
height=
"1056"
extended-state=
"7
"
/>
<editor
active=
"true"
/>
<layout>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
weight=
"0.27789935"
/>
...
...
@@ -434,7 +446,7 @@
<window_info
anchor=
"bottom"
id=
"Message"
order=
"0"
/>
<window_info
anchor=
"bottom"
id=
"Find"
order=
"1"
/>
<window_info
anchor=
"bottom"
id=
"Run"
order=
"2"
weight=
"0.33482143"
/>
<window_info
active=
"true"
anchor=
"bottom"
id=
"Debug"
order=
"3"
visible=
"true"
weight=
"0.37767756
"
/>
<window_info
active=
"true"
anchor=
"bottom"
id=
"Debug"
order=
"3"
sideWeight=
"0.49946696"
visible=
"true"
weight=
"0.37723213
"
/>
<window_info
anchor=
"bottom"
id=
"Cvs"
order=
"4"
weight=
"0.25"
/>
<window_info
anchor=
"bottom"
id=
"Inspection"
order=
"5"
weight=
"0.4"
/>
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"6"
weight=
"0.32924107"
/>
...
...
@@ -442,8 +454,8 @@
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"8"
/>
<window_info
anchor=
"bottom"
id=
"Pylint"
order=
"9"
/>
<window_info
anchor=
"bottom"
id=
"Database Changes"
order=
"10"
weight=
"0.32924107"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"11"
weight=
"0.32
92410
7"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"12"
side
_tool=
"true
"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"11"
weight=
"0.32
58928
7"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"12"
side
Weight=
"0.50053304"
side_tool=
"true"
visible=
"true"
weight=
"0.37723213
"
/>
<window_info
anchor=
"bottom"
id=
"Database Console"
order=
"13"
weight=
"0.32924107"
/>
<window_info
anchor=
"bottom"
id=
"Python Console"
order=
"14"
weight=
"0.32924107"
/>
<window_info
anchor=
"right"
id=
"Commander"
internal_type=
"SLIDING"
order=
"0"
type=
"SLIDING"
weight=
"0.4"
/>
...
...
@@ -461,18 +473,18 @@
<breakpoints>
<line-breakpoint
enabled=
"true"
suspend=
"THREAD"
type=
"python-line"
>
<url>
file://$PROJECT_DIR$/test.py
</url>
<line>
95
</line>
<option
name=
"timeStamp"
value=
"1
1
1"
/>
<line>
121
</line>
<option
name=
"timeStamp"
value=
"1
3
1"
/>
</line-breakpoint>
<line-breakpoint
enabled=
"true"
suspend=
"THREAD"
type=
"python-line"
>
<url>
file://$PROJECT_DIR$/test.py
</url>
<line>
211
</line>
<option
name=
"timeStamp"
value=
"1
25
"
/>
<line>
119
</line>
<option
name=
"timeStamp"
value=
"1
34
"
/>
</line-breakpoint>
<line-breakpoint
enabled=
"true"
suspend=
"THREAD"
type=
"python-line"
>
<url>
file://$PROJECT_DIR$/test.py
</url>
<line>
2
27
</line>
<option
name=
"timeStamp"
value=
"1
2
6"
/>
<line>
2
84
</line>
<option
name=
"timeStamp"
value=
"1
3
6"
/>
</line-breakpoint>
</breakpoints>
<default-breakpoints>
...
...
@@ -490,7 +502,7 @@
</watches-manager>
</component>
<component
name=
"com.intellij.coverage.CoverageDataManagerImpl"
>
<SUITE
FILE_PATH=
"coverage/oie_yearly_report$test.coverage"
NAME=
"test Coverage Results"
MODIFIED=
"1569
737087047
"
SOURCE_PROVIDER=
"com.intellij.coverage.DefaultCoverageFileProvider"
RUNNER=
"coverage.py"
COVERAGE_BY_TEST_ENABLED=
"true"
COVERAGE_TRACING_ENABLED=
"false"
WORKING_DIRECTORY=
"$PROJECT_DIR$"
/>
<SUITE
FILE_PATH=
"coverage/oie_yearly_report$test.coverage"
NAME=
"test Coverage Results"
MODIFIED=
"1569
815488130
"
SOURCE_PROVIDER=
"com.intellij.coverage.DefaultCoverageFileProvider"
RUNNER=
"coverage.py"
COVERAGE_BY_TEST_ENABLED=
"true"
COVERAGE_TRACING_ENABLED=
"false"
WORKING_DIRECTORY=
"$PROJECT_DIR$"
/>
<SUITE
FILE_PATH=
"coverage/oie_yearly_report$get_diseases.coverage"
NAME=
"get_diseases Coverage Results"
MODIFIED=
"1567647885597"
SOURCE_PROVIDER=
"com.intellij.coverage.DefaultCoverageFileProvider"
RUNNER=
"coverage.py"
COVERAGE_BY_TEST_ENABLED=
"true"
COVERAGE_TRACING_ENABLED=
"false"
WORKING_DIRECTORY=
"$PROJECT_DIR$"
/>
<SUITE
FILE_PATH=
"coverage/oie_yearly_report$yearly_report_analysis.coverage"
NAME=
"yearly_report_analysis Coverage Results"
MODIFIED=
"1567648131251"
SOURCE_PROVIDER=
"com.intellij.coverage.DefaultCoverageFileProvider"
RUNNER=
"coverage.py"
COVERAGE_BY_TEST_ENABLED=
"true"
COVERAGE_TRACING_ENABLED=
"false"
WORKING_DIRECTORY=
"$PROJECT_DIR$"
/>
<SUITE
FILE_PATH=
"coverage/oie_yearly_report$main.coverage"
NAME=
"main Coverage Results"
MODIFIED=
"1568624861732"
SOURCE_PROVIDER=
"com.intellij.coverage.DefaultCoverageFileProvider"
RUNNER=
"coverage.py"
COVERAGE_BY_TEST_ENABLED=
"true"
COVERAGE_TRACING_ENABLED=
"false"
WORKING_DIRECTORY=
"$PROJECT_DIR$"
/>
...
...
@@ -498,47 +510,47 @@
<component
name=
"debuggerHistoryManager"
>
<expressions
id=
"evaluateExpression"
>
<expression>
<expression-string>
len(i)
</expression-string>
<expression-string>
self.year
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
<expression>
<expression-string>
i[j]
</expression-string>
<expression-string>
self.type
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
<expression>
<expression-string>
len(td)
</expression-string>
<expression-string>
self.country
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
<expression>
<expression-string>
i[]
</expression-string>
<expression-string>
len(i)
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
<expression>
<expression-string>
j
</expression-string>
<expression-string>
i[j]
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
<expression>
<expression-string>
re.sub('\s{2,}', '', j
)
</expression-string>
<expression-string>
len(td
)
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
<expression>
<expression-string>
k.text.replace('\n', '')
</expression-string>
<expression-string>
i[]
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
<expression>
<expression-string>
i.find('tr').next_sibling.next_sibling
</expression-string>
<expression-string>
j
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
<expression>
<expression-string>
i.find('tr').next_sibing.next_sibling
</expression-string>
<expression-string>
re.sub('\s{2,}', '', j)
</expression-string>
<language-id>
Python
</language-id>
<evaluation-mode>
EXPRESSION
</evaluation-mode>
</expression>
...
...
@@ -596,56 +608,56 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/postgre/__init__.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://D:/Program/python/Lib/site-packages/bs4/element.py"
>
<entry
file=
"file://$PROJECT_DIR$/main.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state>
<caret
line=
"1305"
column=
"8"
selection-start-line=
"1305"
selection-start-column=
"8"
selection-end-line=
"1305"
selection-end-column=
"8"
/>
<state
relative-caret-position=
"4446"
>
<caret
line=
"141"
column=
"24"
selection-start-line=
"141"
selection-start-column=
"24"
selection-end-line=
"141"
selection-end-column=
"24"
/>
<folding>
<element
signature=
"e#0#39#0"
expanded=
"true"
/>
<element
signature=
"e#895#2041#0"
/>
<element
signature=
"e#4687#4811#0"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/YEAR.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"749190"
>
<caret
line=
"19210"
column=
"12"
selection-start-line=
"19210"
selection-start-column=
"12"
selection-end-line=
"19210"
selection-end-column=
"12"
/>
</state>
</provider>
<entry
file=
"file://$PROJECT_DIR$/postgre/__init__.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/have_7.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
42
0"
>
<state
relative-caret-position=
"
86580
0"
>
<caret
line=
"22200"
selection-start-line=
"22200"
selection-end-line=
"22200"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
main
.py"
>
<entry
file=
"file://$PROJECT_DIR$/
yearly_report_analysis
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
311
"
>
<caret
line=
"1
41"
column=
"24"
selection-start-line=
"141"
selection-start-column=
"24"
selection-end-line=
"141"
selection-end-column=
"24
"
/>
<state
relative-caret-position=
"
4212
"
>
<caret
line=
"1
09"
selection-start-line=
"109"
selection-end-line=
"109
"
/>
<folding>
<element
signature=
"e#0#39#0"
expanded=
"true"
/>
<element
signature=
"e#895#2041#0"
/>
<element
signature=
"e#4687#4811#0"
/>
<element
signature=
"e#0#29#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://
$PROJECT_DIR$/yearly_report_analysis
.py"
>
<entry
file=
"file://
D:/Program/python/Lib/site-packages/bs4/element
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"1336"
>
<caret
line=
"109"
selection-start-line=
"109"
selection-end-line=
"109"
/>
<folding>
<element
signature=
"e#0#29#0"
expanded=
"true"
/>
</folding>
<state
relative-caret-position=
"50817"
>
<caret
line=
"1305"
column=
"8"
selection-start-line=
"1305"
selection-start-column=
"8"
selection-end-line=
"1305"
selection-end-column=
"8"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/YEAR.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"749190"
>
<caret
line=
"19210"
column=
"12"
selection-start-line=
"19210"
selection-start-column=
"12"
selection-end-line=
"19210"
selection-end-column=
"12"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/postgre/utils.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
1464
"
>
<caret
line=
"
77"
column=
"21"
lean-forward=
"true"
selection-start-line=
"77"
selection-start-column=
"21"
selection-end-line=
"77"
selection-end-column=
"21
"
/>
<state
relative-caret-position=
"
261
"
>
<caret
line=
"
109"
column=
"14"
selection-start-line=
"109"
selection-start-column=
"14"
selection-end-line=
"109"
selection-end-column=
"14
"
/>
<folding>
<element
signature=
"e#14#29#0"
expanded=
"true"
/>
</folding>
...
...
@@ -654,19 +666,21 @@
</entry>
<entry
file=
"file://$PROJECT_DIR$/test.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
191
"
>
<caret
line=
"2
28"
lean-forward=
"true"
selection-start-line=
"228"
selection-end-line=
"228
"
/>
<state
relative-caret-position=
"
307
"
>
<caret
line=
"2
85"
lean-forward=
"true"
selection-start-line=
"285"
selection-end-line=
"285
"
/>
<folding>
<element
signature=
"e#289#1001#0"
/>
<element
signature=
"e#1037#1269#0"
/>
<element
signature=
"e#1297#1808#0"
/>
<element
signature=
"e#4657#4722#0"
/>
<element
signature=
"e#5614#5886#0"
/>
<element
signature=
"e#6594#7779#0"
/>
<element
signature=
"e#7403#7830#0"
/>
<element
signature=
"e#11396#11553#0"
/>
<element
signature=
"e#11612#11748#0"
/>
<element
signature=
"e#12669#12816#0"
/>
<element
signature=
"e#1297#1863#0"
/>
<element
signature=
"e#1726#2161#0"
/>
<element
signature=
"e#5308#5373#0"
/>
<element
signature=
"e#5419#6227#0"
/>
<element
signature=
"e#6276#6548#0"
/>
<element
signature=
"e#6594#7591#0"
/>
<element
signature=
"e#7640#8067#0"
/>
<element
signature=
"e#7780#8528#0"
/>
<element
signature=
"e#8910#9403#0"
/>
<element
signature=
"e#7800#8175#0"
/>
</folding>
</state>
</provider>
...
...
postgre/utils.py
View file @
4b52c849
...
...
@@ -76,6 +76,38 @@ tableInfos = {
'year_report_id'
:
'int'
,
'month'
:
'string'
,
'state'
:
'string'
},
"oie_year_report_unreported"
:
{
'disease'
:
'string'
,
'disease_id'
:
'int'
,
'country_code'
:
'string'
,
'year'
:
'int'
,
'type'
:
'string'
,
'animal'
:
'string'
,
'year_report_id'
:
'int'
,
'id'
:
'int'
},
"oie_year_report_summary_non"
:
{
"non_oie_listed_disease"
:
"string"
,
"occurrence"
:
"string"
,
"serotype"
:
"string"
,
"new_outbreaks"
:
'string'
,
"total_outbreaks"
:
"string"
,
"species"
:
"string"
,
"control_measures"
:
"string"
,
"official_vaccination"
:
"string"
,
"measuring_units"
:
"string"
,
"susceptible"
:
"string"
,
"cases"
:
"string"
,
"deaths"
:
'string'
,
"killed_and_disposed_of"
:
"string"
,
"slaughtered"
:
"string"
,
"vaccination_in_response_to_the_outbreak"
:
"string"
,
"country_code"
:
"string"
,
"year"
:
"int"
,
"type"
:
"string"
,
"year_report_id"
:
"int"
,
"id"
:
"int"
}
}
...
...
test.py
View file @
4b52c849
...
...
@@ -6,7 +6,7 @@ class Database():
html
=
''
res
=
''
count
=
10
start
=
76
start
=
1
year
=
''
country
=
''
type
=
''
...
...
@@ -54,6 +54,23 @@ class Database():
'Slaughtered'
:
"slaughtered"
,
'Vaccination in response to the outbreak(s)'
:
'vaccination_in_response_to_the_outbreak'
}
# 3
summary_non_col_dict
=
{
"NON OIE-Listed disease"
:
"non_oie_listed_disease"
,
"occurrence"
:
"occurrence"
,
"Serotype(s)"
:
"serotype"
,
"New outbreaks"
:
"new_outbreaks"
,
"Total outbreaks"
:
"total_outbreaks"
,
"Species"
:
"species"
,
"Control Measures"
:
"control_measures"
,
"Official vaccination"
:
"official_vaccination"
,
"Measuring units"
:
"measuring_units"
,
"Susceptible"
:
"susceptible"
,
"Cases"
:
"cases"
,
"Deaths"
:
'deaths'
,
"Killed and disposed of"
:
"killed_and_disposed_of"
,
"Slaughtered"
:
"slaughtered"
,
"Vaccination in response to the outbreak(s)"
:
"vaccination_in_response_to_the_outbreak"
}
def
__init__
(
self
):
self
.
get_disease_list
()
...
...
@@ -93,13 +110,16 @@ class Database():
# print(table_2)
elif
i
[
j
][
'no'
]
==
3
:
# detail
table_3
=
self
.
handle_a_table_3
(
i
[
j
][
'tables'
])
self
.
insert_into_3
(
table_3
)
#
self.insert_into_3(table_3)
# print(table_3)
elif
i
[
j
][
'no'
]
==
4
:
table_4
=
self
.
handle_a_table_4
(
i
[
j
][
'tables'
])
# self.insert_into_4(table_4)
# print(table_4)
elif
i
[
j
][
'no'
]
==
5
:
table_5
=
self
.
handle_a_table_5
(
i
[
j
])
if
table_5
:
self
.
insert_into_5
(
table_5
)
# print(table_5)
elif
i
[
j
][
'no'
]
==
6
:
table_6
=
self
.
handle_a_table_6
(
i
[
j
])
...
...
@@ -146,10 +166,6 @@ class Database():
ths
.
append
(
self
.
summary_col_dict
[
i
])
for
i
in
table
[
'td'
]:
tmp
=
{}
tmp
[
'year_report_id'
]
=
self
.
id
tmp
[
'country_code'
]
=
self
.
country
tmp
[
'year'
]
=
self
.
year
tmp
[
'type'
]
=
self
.
type
disease
=
i
[
0
]
disease
=
disease
.
replace
(
' (Domestic and Wild)'
,
''
)
disease
=
disease
.
replace
(
' (Domestic)'
,
''
)
...
...
@@ -187,11 +203,7 @@ class Database():
tmp_1
=
tmp_1
.
replace
(
' (Wild)'
,
''
)
tmp
[
ths
[
td_no
]]
=
tmp_1
tmp
[
'animal'
]
=
animal
tmp
[
'country_code'
]
=
self
.
country
tmp
[
'year'
]
=
self
.
year
tmp
[
'type'
]
=
self
.
type
tmp
[
'disease_id'
]
=
self
.
get_disease_standard_id
(
disease
)
tmp
[
'year_report_id'
]
=
self
.
id
self
.
insert_to_table
(
tmp
,
'oie_year_report_never_report'
,
'表2数据已存在'
)
def
handle_a_table_3
(
self
,
table
):
...
...
@@ -218,7 +230,7 @@ class Database():
tmp
[
'year'
]
=
self
.
year
tmp
[
'year_report_id'
]
=
self
.
id
tmp
[
'disease'
]
=
disease_name
tmp
[
'
type'
]
=
a_table
[
'type'
]
tmp
[
'animal_
type'
]
=
a_table
[
'type'
]
th
=
a_table
[
'th'
]
for
a_th
in
th
:
ths
.
append
(
self
.
detail_col_dict
[
a_th
])
...
...
@@ -241,11 +253,38 @@ class Database():
ok_table
.
append
({
key
:
diseases
})
return
ok_table
def
insert_into_4
(
self
,
table
):
for
a_table
in
table
:
key
=
self
.
dict_key
(
a_table
)
value
=
a_table
[
key
]
for
a_disease
in
value
:
disease_id
=
self
.
get_disease_standard_id
(
self
.
get_standard_disease_name
(
a_disease
))
tmp
=
{
"disease_id"
:
disease_id
,
"disease"
:
a_disease
,
"animal"
:
key
}
self
.
insert_to_table
(
tmp
,
"oie_year_report_unreported"
,
"表4已存在"
)
def
handle_a_table_5
(
self
,
table
):
auto
=
[
0
,
1
,
2
]
if
table
[
'type'
]
==
'table'
:
return
self
.
ana_table_to_ok
(
table
,
auto
)
def
insert_into_5
(
self
,
table
):
th
=
table
[
'th'
]
td
=
table
[
'td'
]
ths
=
[]
for
i
in
th
:
ths
.
append
(
self
.
summary_non_col_dict
[
i
])
for
a_tr
in
td
:
tmp
=
{}
for
key
,
val
in
enumerate
(
a_tr
):
tmp
[
ths
[
key
]]
=
val
self
.
insert_to_table
(
tmp
,
"oie_year_report_summary_non"
,
'表5数据已存在'
)
def
handle_a_table_6
(
self
,
table
):
if
table
[
'tables'
]:
ok_table
=
[]
...
...
@@ -253,7 +292,6 @@ class Database():
for
type
,
item
in
i
.
items
():
a_ok_table
=
self
.
ana_table_to_ok
(
item
)
ok_table
.
append
({
type
:
a_ok_table
})
print
(
ok_table
)
def
handle_a_table_7
(
self
,
table
):
auto
=
[
0
]
...
...
@@ -282,15 +320,12 @@ class Database():
res
=
self
.
ana_table_to_ok
(
table
,
auto
)
def
handle_a_table_11
(
self
,
table
):
print
(
table
)
tables
=
[]
print
(
table
[
'tables'
])
if
len
(
table
[
'tables'
])
!=
0
:
for
i
in
table
[
'tables'
]:
for
key
,
item
in
i
.
items
():
table
=
self
.
ana_table_to_ok
(
item
)
tables
.
append
({
key
:
table
})
print
(
tables
)
def
handle_a_table_12
(
self
,
table
):
res
=
self
.
ana_table_to_ok
(
table
)
...
...
@@ -349,6 +384,10 @@ class Database():
return
False
def
insert_to_table
(
self
,
data
,
table_name
,
msg
):
data
[
'country_code'
]
=
self
.
country
data
[
'year'
]
=
self
.
year
data
[
'year_report_id'
]
=
self
.
id
data
[
'type'
]
=
self
.
type
if
self
.
is_exist
(
table_name
,
data
):
print
(
msg
+
str
(
data
))
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment