Merge branch 'testing' into 'master'

1.7.3

See merge request piotrex43/RcGcDw!57
This commit is contained in:
Frisk 2019-10-26 09:31:13 +00:00
commit 3ce3a3f086
5 changed files with 10 additions and 5 deletions

View file

@ -5,7 +5,8 @@ test:
script:
- apk add libxml2-dev libxslt-dev libxml2 gcc musl-dev linux-headers
- 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
- python3.6 rcgcdw.py --test
only:

View file

@ -6,7 +6,7 @@ try: # load settings
if settings["limitrefetch"] < settings["limit"] and settings["limitrefetch"] != -1:
settings["limitrefetch"] = settings["limit"]
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:
logging.critical("No config file could be found. Please make sure settings.json is in the directory.")
sys.exit(1)

View file

@ -75,7 +75,7 @@ def weighted_average(value, weight, new_value):
def link_formatter(link):
"""Formats a link to not embed it"""
return "<" + re.sub(r"([ \)])", "\\\\\\1", link) + ">"
return "<" + re.sub(r"([ )])", "\\\\\\1", link) + ">"
class ContentParser(HTMLParser):
@ -98,7 +98,7 @@ class ContentParser(HTMLParser):
self.added = True
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:
self.ins_length += len("**" + data + '**')
if self.ins_length <= 1000:

View file

@ -131,7 +131,7 @@ def pull_comment(comment_id):
logger.debug("Got the following comment from the API: {}".format(comment))
except MWError:
pass
except TypeError:
except (TypeError, AttributeError):
logger.exception("Could not resolve the comment text.")
except KeyError:
logger.exception("CurseProfile extension API did not respond with a valid comment content.")

View file

@ -149,6 +149,10 @@
"icon":"",
"color":null
},
"rights/autopromote": {
"icon":"",
"color":null
},
"abusefilter/abusefilter":{
"icon":"https://i.imgur.com/Sn2NzRJ.png",
"color":null