Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Cecylia Bocovich
gettor
Commits
5e08ab00
Commit
5e08ab00
authored
Oct 15, 2019
by
Hiro
🏄
Browse files
Fix load settings
parent
d52c0115
Changes
1
Show whitespace changes
Inline
Side-by-side
gettor/utils/settings.py
View file @
5e08ab00
...
@@ -25,13 +25,15 @@ class Settings(object):
...
@@ -25,13 +25,15 @@ class Settings(object):
"""
"""
def
__init__
(
self
,
config
=
False
):
def
__init__
(
self
,
config
=
False
):
# Default config
self
.
filename
=
self
.
build_filename
()
# If a readable config file was provided, use that instead
# If a readable config file was provided, use that instead
if
config
:
if
config
:
if
os
.
path
.
isfile
(
config
):
if
os
.
path
.
isfile
(
config
):
self
.
filename
=
config
self
.
filename
=
config
# Default config
self
.
filename
=
self
.
build_filename
()
# Dictionary of available languages,
# Dictionary of available languages,
# mapped to the language name, in that language
# mapped to the language name, in that language
self
.
_available_locales
=
strings
.
get_locales
()
self
.
_available_locales
=
strings
.
get_locales
()
...
@@ -62,7 +64,9 @@ class Settings(object):
...
@@ -62,7 +64,9 @@ class Settings(object):
"dbname"
:
"/srv/gettor.torproject.org/home/gettor/gettor.db"
,
"dbname"
:
"/srv/gettor.torproject.org/home/gettor/gettor.db"
,
"email_parser_logfile"
:
"/srv/gettor.torproject.org/home/gettor/log/email_parser.log"
,
"email_parser_logfile"
:
"/srv/gettor.torproject.org/home/gettor/log/email_parser.log"
,
"email_requests_limit"
:
30
,
"email_requests_limit"
:
30
,
"twitter_requests_limit"
:
1
,
"sendmail_interval"
:
10
,
"sendmail_interval"
:
10
,
"twitter_interval"
:
10
,
"sendmail_addr"
:
"gettor@torproject.org"
,
"sendmail_addr"
:
"gettor@torproject.org"
,
"sendmail_host"
:
"localhost"
,
"sendmail_host"
:
"localhost"
,
"sendmail_port"
:
587
,
"sendmail_port"
:
587
,
...
@@ -70,7 +74,10 @@ class Settings(object):
...
@@ -70,7 +74,10 @@ class Settings(object):
"consumer_secret"
:
""
,
"consumer_secret"
:
""
,
"access_key"
:
""
,
"access_key"
:
""
,
"access_secret"
:
""
,
"access_secret"
:
""
,
"twitter_handle"
:
"get_tor"
"test_hid"
:
""
,
"twitter_handle"
:
"get_tor"
,
"twitter_messages_endpoint"
:
"https://api.twitter.com/1.1/direct_messages/events/list.json"
,
"twitter_new_message_endpoint"
:
"https://api.twitter.com/1.1/direct_messages/events/new.json"
}
}
def
get
(
self
,
key
):
def
get
(
self
,
key
):
...
...
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