mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Merge branch 'testing' into 'master'
1.7.3 See merge request piotrex43/RcGcDw!57
This commit is contained in:
commit
3ce3a3f086
|
@ -5,7 +5,8 @@ test:
|
||||||
script:
|
script:
|
||||||
- apk add libxml2-dev libxslt-dev libxml2 gcc musl-dev linux-headers
|
- apk add libxml2-dev libxslt-dev libxml2 gcc musl-dev linux-headers
|
||||||
- pip3.6 install -r requirements.txt
|
- pip3.6 install -r requirements.txt
|
||||||
- sed -i -e "s/https:\/\/discordapp.com\/api\/webhooks\/111111111111111111\/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/$DISCORD/g" settings.json.example
|
- sed -i -e "s/111111111111111111/$DISCORD1/g" settings.json.example
|
||||||
|
- sed -i -e "s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/$DISCORD2/g" settings.json.example
|
||||||
- mv settings.json.example settings.json
|
- mv settings.json.example settings.json
|
||||||
- python3.6 rcgcdw.py --test
|
- python3.6 rcgcdw.py --test
|
||||||
only:
|
only:
|
||||||
|
|
|
@ -6,7 +6,7 @@ try: # load settings
|
||||||
if settings["limitrefetch"] < settings["limit"] and settings["limitrefetch"] != -1:
|
if settings["limitrefetch"] < settings["limit"] and settings["limitrefetch"] != -1:
|
||||||
settings["limitrefetch"] = settings["limit"]
|
settings["limitrefetch"] = settings["limit"]
|
||||||
if "user-agent" in settings["header"]:
|
if "user-agent" in settings["header"]:
|
||||||
settings["header"]["user-agent"] = settings["header"]["user-agent"].format(version="1.7.2") # set the version in the useragent
|
settings["header"]["user-agent"] = settings["header"]["user-agent"].format(version="1.7.3") # set the version in the useragent
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
logging.critical("No config file could be found. Please make sure settings.json is in the directory.")
|
logging.critical("No config file could be found. Please make sure settings.json is in the directory.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
4
misc.py
4
misc.py
|
@ -75,7 +75,7 @@ def weighted_average(value, weight, new_value):
|
||||||
|
|
||||||
def link_formatter(link):
|
def link_formatter(link):
|
||||||
"""Formats a link to not embed it"""
|
"""Formats a link to not embed it"""
|
||||||
return "<" + re.sub(r"([ \)])", "\\\\\\1", link) + ">"
|
return "<" + re.sub(r"([ )])", "\\\\\\1", link) + ">"
|
||||||
|
|
||||||
|
|
||||||
class ContentParser(HTMLParser):
|
class ContentParser(HTMLParser):
|
||||||
|
@ -98,7 +98,7 @@ class ContentParser(HTMLParser):
|
||||||
self.added = True
|
self.added = True
|
||||||
|
|
||||||
def handle_data(self, data):
|
def handle_data(self, data):
|
||||||
data = re.sub(r"(`|_|\*|~|<|>|{|}|@|/|\|)", "\\\\\\1", data, 0)
|
data = re.sub(r"([`_*~<>{}@/|\\])", "\\\\\\1", data, 0)
|
||||||
if self.current_tag == "ins" and self.ins_length <= 1000:
|
if self.current_tag == "ins" and self.ins_length <= 1000:
|
||||||
self.ins_length += len("**" + data + '**')
|
self.ins_length += len("**" + data + '**')
|
||||||
if self.ins_length <= 1000:
|
if self.ins_length <= 1000:
|
||||||
|
|
|
@ -131,7 +131,7 @@ def pull_comment(comment_id):
|
||||||
logger.debug("Got the following comment from the API: {}".format(comment))
|
logger.debug("Got the following comment from the API: {}".format(comment))
|
||||||
except MWError:
|
except MWError:
|
||||||
pass
|
pass
|
||||||
except TypeError:
|
except (TypeError, AttributeError):
|
||||||
logger.exception("Could not resolve the comment text.")
|
logger.exception("Could not resolve the comment text.")
|
||||||
except KeyError:
|
except KeyError:
|
||||||
logger.exception("CurseProfile extension API did not respond with a valid comment content.")
|
logger.exception("CurseProfile extension API did not respond with a valid comment content.")
|
||||||
|
|
|
@ -149,6 +149,10 @@
|
||||||
"icon":"",
|
"icon":"",
|
||||||
"color":null
|
"color":null
|
||||||
},
|
},
|
||||||
|
"rights/autopromote": {
|
||||||
|
"icon":"",
|
||||||
|
"color":null
|
||||||
|
},
|
||||||
"abusefilter/abusefilter":{
|
"abusefilter/abusefilter":{
|
||||||
"icon":"https://i.imgur.com/Sn2NzRJ.png",
|
"icon":"https://i.imgur.com/Sn2NzRJ.png",
|
||||||
"color":null
|
"color":null
|
||||||
|
|
Loading…
Reference in a new issue