mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Updated Polish translation, moved logging config from the script to config file
This commit is contained in:
parent
f949d246ed
commit
28a9db95d4
Binary file not shown.
File diff suppressed because it is too large
Load diff
444
rcgcdw.pot
444
rcgcdw.pot
File diff suppressed because it is too large
Load diff
36
rcgcdw.py
36
rcgcdw.py
|
@ -47,36 +47,7 @@ logging.debug("Current settings: {settings}".format(settings=settings))
|
||||||
|
|
||||||
# Prepare logging
|
# Prepare logging
|
||||||
|
|
||||||
logging_config = {'version': 1,
|
logging.config.dictConfig(settings["logging"])
|
||||||
'disable_existing_loggers': False,
|
|
||||||
'formatters': {
|
|
||||||
'standard': {
|
|
||||||
'format': '%(name)s - %(levelname)s: %(message)s'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'handlers': {
|
|
||||||
'default': {
|
|
||||||
'level': 0,
|
|
||||||
'formatter': 'standard',
|
|
||||||
'class': 'logging.StreamHandler',
|
|
||||||
'stream': 'ext://sys.stdout'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'loggers': {
|
|
||||||
'': {
|
|
||||||
'level': 0,
|
|
||||||
'handlers': ['default']
|
|
||||||
},
|
|
||||||
'rcgcdw': {
|
|
||||||
'level': 0
|
|
||||||
},
|
|
||||||
'rcgcdw.misc': {
|
|
||||||
'level': 0
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
logging.config.dictConfig(logging_config)
|
|
||||||
logger = logging.getLogger("rcgcdw")
|
logger = logging.getLogger("rcgcdw")
|
||||||
|
|
||||||
|
|
||||||
|
@ -488,6 +459,7 @@ def compact_formatter(action, change, parsed_comment, categories):
|
||||||
content = _("An action has been hidden by administration.")
|
content = _("An action has been hidden by administration.")
|
||||||
send_to_discord({'content': content})
|
send_to_discord({'content': content})
|
||||||
|
|
||||||
|
|
||||||
def embed_formatter(action, change, parsed_comment, categories):
|
def embed_formatter(action, change, parsed_comment, categories):
|
||||||
data = {"embeds": []}
|
data = {"embeds": []}
|
||||||
embed = defaultdict(dict)
|
embed = defaultdict(dict)
|
||||||
|
@ -509,11 +481,11 @@ def embed_formatter(action, change, parsed_comment, categories):
|
||||||
change["user"] = change["user"] + "(?)"
|
change["user"] = change["user"] + "(?)"
|
||||||
else:
|
else:
|
||||||
recent_changes.map_ips[change["user"]] = len(contibs)
|
recent_changes.map_ips[change["user"]] = len(contibs)
|
||||||
logger.debug("1Current params user {} and state of map_ips {}".format(change["user"], recent_changes.map_ips))
|
logger.debug("Current params user {} and state of map_ips {}".format(change["user"], recent_changes.map_ips))
|
||||||
change["user"] = "{author} ({contribs})".format(author=change["user"], contribs=len(contibs))
|
change["user"] = "{author} ({contribs})".format(author=change["user"], contribs=len(contibs))
|
||||||
else:
|
else:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"2Current params user {} and state of map_ips {}".format(change["user"], recent_changes.map_ips))
|
"Current params user {} and state of map_ips {}".format(change["user"], recent_changes.map_ips))
|
||||||
if action in ("edit", "new"):
|
if action in ("edit", "new"):
|
||||||
recent_changes.map_ips[change["user"]] += 1
|
recent_changes.map_ips[change["user"]] += 1
|
||||||
change["user"] = "{author} ({amount})".format(author=change["user"],
|
change["user"] = "{author} ({amount})".format(author=change["user"],
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
"embed": ""
|
"embed": ""
|
||||||
},
|
},
|
||||||
"ignored": ["external"],
|
"ignored": ["external"],
|
||||||
"verbose_level": 0,
|
|
||||||
"show_updown_messages": true,
|
"show_updown_messages": true,
|
||||||
"overview": false,
|
"overview": false,
|
||||||
"overview_time": "00:00",
|
"overview_time": "00:00",
|
||||||
|
@ -27,6 +26,32 @@
|
||||||
"wiki_bot_login": "",
|
"wiki_bot_login": "",
|
||||||
"wiki_bot_password": "",
|
"wiki_bot_password": "",
|
||||||
"show_added_categories": true,
|
"show_added_categories": true,
|
||||||
|
"logging": {
|
||||||
|
"version": 1,
|
||||||
|
"disable_existing_loggers": false,
|
||||||
|
"formatters": {
|
||||||
|
"standard": {
|
||||||
|
"format": "%(name)s - %(levelname)s: %(message)s"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"handlers": {
|
||||||
|
"default": {
|
||||||
|
"formatter": "standard",
|
||||||
|
"class": "logging.StreamHandler",
|
||||||
|
"stream": "ext://sys.stdout"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"loggers": {
|
||||||
|
"": {
|
||||||
|
"level": 0,
|
||||||
|
"handlers": ["default"]
|
||||||
|
},
|
||||||
|
"rcgcdw": {
|
||||||
|
},
|
||||||
|
"rcgcdw.misc": {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"appearance":{
|
"appearance":{
|
||||||
"mode": "embed",
|
"mode": "embed",
|
||||||
"embed": {
|
"embed": {
|
||||||
|
|
Loading…
Reference in a new issue