Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flask-covid19
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Wöhlke
flask-covid19
Commits
76235ba0
Commit
76235ba0
authored
4 years ago
by
thomaswoehlke
Browse files
Options
Downloads
Patches
Plain Diff
work
parent
973e3b8c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
database.py
+0
-9
0 additions, 9 deletions
database.py
org/woehlke/covid19/europe/europe_service_update.py
+14
-3
14 additions, 3 deletions
org/woehlke/covid19/europe/europe_service_update.py
with
14 additions
and
12 deletions
database.py
+
0
−
9
View file @
76235ba0
...
@@ -33,15 +33,6 @@ my_logging_config = {
...
@@ -33,15 +33,6 @@ my_logging_config = {
run_run_with_debug
=
app
.
config
[
'
APP_DEBUGGER_ACTIVE
'
]
run_run_with_debug
=
app
.
config
[
'
APP_DEBUGGER_ACTIVE
'
]
def
transform_datum_europe
(
my_date
):
my_date_reported
=
my_date
.
split
(
'
/
'
)
my_year
=
int
(
my_date_reported
[
2
])
my_month
=
int
(
my_date_reported
[
1
])
my_day
=
int
(
my_date_reported
[
0
])
my_datum
=
date
(
year
=
my_year
,
month
=
my_month
,
day
=
my_day
)
return
my_datum
def
transform_datum
(
my_date_reported
):
def
transform_datum
(
my_date_reported
):
my_date_reported
=
my_date_reported
.
split
(
"
-
"
)
my_date_reported
=
my_date_reported
.
split
(
"
-
"
)
my_year
=
int
(
my_date_reported
[
0
])
my_year
=
int
(
my_date_reported
[
0
])
...
...
This diff is collapsed.
Click to expand it.
org/woehlke/covid19/europe/europe_service_update.py
+
14
−
3
View file @
76235ba0
import
os
import
os
from
database
import
db
,
app
,
transform_datum_europe
from
datetime
import
date
from
database
import
db
,
app
from
org.woehlke.covid19.europe.europe_model
import
EuropeDataImportTable
,
\
from
org.woehlke.covid19.europe.europe_model
import
EuropeDataImportTable
,
\
EuropeDateReported
,
EuropeContinent
,
EuropeCountry
,
EuropeData
EuropeDateReported
,
EuropeContinent
,
EuropeCountry
,
EuropeData
...
@@ -18,18 +19,28 @@ class EuropeServiceUpdate:
...
@@ -18,18 +19,28 @@ class EuropeServiceUpdate:
app
.
logger
.
info
(
"
------------------------------------------------------------
"
)
app
.
logger
.
info
(
"
------------------------------------------------------------
"
)
app
.
logger
.
info
(
"
Europe Service Update [ready]
"
)
app
.
logger
.
info
(
"
Europe Service Update [ready]
"
)
def
__transform_datum
(
my_date
):
my_date_reported
=
my_date
.
split
(
'
/
'
)
my_year
=
int
(
my_date_reported
[
2
])
my_month
=
int
(
my_date_reported
[
1
])
my_day
=
int
(
my_date_reported
[
0
])
my_datum
=
date
(
year
=
my_year
,
month
=
my_month
,
day
=
my_day
)
return
my_datum
def
__update_date_reported
(
self
):
def
__update_date_reported
(
self
):
app
.
logger
.
info
(
"
__update_date_reported [begin]
"
)
app
.
logger
.
info
(
"
__update_date_reported [begin]
"
)
app
.
logger
.
info
(
"
------------------------------------------------------------
"
)
app
.
logger
.
info
(
"
------------------------------------------------------------
"
)
result_date_rep
=
EuropeDataImportTable
.
get_date_rep
()
result_date_rep
=
EuropeDataImportTable
.
get_date_rep
()
k
=
0
for
result_item
in
result_date_rep
:
for
result_item
in
result_date_rep
:
k
+=
1
my_date_rep
=
result_item
[
'
date_rep
'
]
my_date_rep
=
result_item
[
'
date_rep
'
]
my_year_week
=
result_item
[
'
year_week
'
]
my_year_week
=
result_item
[
'
year_week
'
]
app
.
logger
.
info
(
"
|
"
+
my_date_rep
+
"
|
"
+
my_year_week
+
"
|
"
)
app
.
logger
.
info
(
"
|
"
+
my_date_rep
+
"
|
"
+
my_year_week
+
"
|
(
"
+
k
+
"
)
"
)
o
=
EuropeDateReported
(
o
=
EuropeDateReported
(
date_rep
=
my_date_rep
,
date_rep
=
my_date_rep
,
year_week
=
my_year_week
,
year_week
=
my_year_week
,
datum
=
transform_datum
_europe
(
my_date_rep
)
datum
=
self
.
__
transform_datum
(
my_date_rep
)
)
)
db
.
session
.
add
(
o
)
db
.
session
.
add
(
o
)
db
.
session
.
commit
()
db
.
session
.
commit
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment