Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tesi
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
Container 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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marco Aceti
Tesi
Commits
4a830707
Verified
Commit
4a830707
authored
Apr 2, 2023
by
Marco Aceti
Browse files
Options
Downloads
Patches
Plain Diff
Remove 'locale.setlocale' instruction
Changing the locale negatively affects the scraper API calls.
parent
0552d3bd
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#2784
passed
Apr 2, 2023
Stage: test
Stage: lint
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/const.py
+8
-22
8 additions, 22 deletions
src/const.py
with
8 additions
and
22 deletions
src/const.py
+
8
−
22
View file @
4a830707
import
locale
import
logging
from
enum
import
Enum
from
dateutil
import
tz
...
...
@@ -12,28 +10,16 @@ INTRADAY_SPLIT_HOUR: int = 4
# Pandas locale
LOCALE
:
str
=
"
it_IT.utf-8
"
try
:
locale
.
setlocale
(
locale
.
LC_ALL
,
LOCALE
)
except
locale
.
Error
:
logging
.
warning
(
f
"
Can
'
t set locale
{
LOCALE
}
.
"
f
"
Using the default one:
{
locale
.
getdefaultlocale
()[
0
]
}
"
)
# Weekdays
def
_w
(
weekday_number
:
int
)
->
str
:
return
locale
.
nl_langinfo
(
getattr
(
locale
,
f
"
DAY_
{
weekday_number
}
"
)).
title
()
# Italian weekdays - see 'LOCALE'
WEEKDAYS
=
{
_w
(
2
)
:
1
,
# Monday
_w
(
3
)
:
2
,
# Tuesday
_w
(
4
)
:
3
,
# Wednesday
_w
(
5
)
:
4
,
# Thursday
_w
(
6
)
:
5
,
# Friday
_w
(
7
)
:
6
,
# Saturday
_w
(
1
)
:
7
,
# Sunday
"
Lunedì
"
:
1
,
# Monday
"
Martedì
"
:
2
,
# Tuesday
"
Mercoledì
"
:
3
,
# Wednesday
"
Giovedì
"
:
4
,
# Thursday
"
Venerdì
"
:
5
,
# Friday
"
Sabato
"
:
6
,
# Saturday
"
Domenica
"
:
7
,
# Sunday
}
...
...
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