Skip to content

Commit

Permalink
Misc fix --autopull
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed Aug 3, 2018
1 parent b4faeb4 commit b372c37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion findspam.py
Expand Up @@ -1624,7 +1624,7 @@ def test_post(post):
if not post.body_is_summary or rule['body_summary']:
matched_body, why_body = rule['method'](body_to_check, post.post_site)
if matched_body and rule['body']:
why["body"].append(u"Post - {}".format(why_body))
why["body"].append(u"Body - {}".format(why_body))
if matched_title and rule['title']:
why["title"].append(FindSpam.generate_why(compiled_regex, title_to_check, u"Title", is_regex_check))
result.append(rule['reason'].replace("{}", "title"))
Expand Down
11 changes: 6 additions & 5 deletions gitmanager.py
Expand Up @@ -67,9 +67,10 @@ def add_to_blacklist(cls, blacklist='', item_to_blacklist='', username='', chat_
if not status:
return (False, message)

now = str(int(time.time()))

if blacklist_type in [Blacklist.WATCHED_KEYWORDS]:
op = 'watch'
now = datetime.now().strftime('%s')
item = item_to_blacklist
item_to_blacklist = "\t".join([now, username, item])
else:
Expand All @@ -89,7 +90,7 @@ def add_to_blacklist(cls, blacklist='', item_to_blacklist='', username='', chat_

blacklister.add(item_to_blacklist)

branch = "auto-blacklist-{0}".format(str(time.time()))
branch = "auto-blacklist-{0}".format(now)
git.checkout("-b", branch)

git.reset("HEAD")
Expand All @@ -113,11 +114,11 @@ def add_to_blacklist(cls, blacklist='', item_to_blacklist='', username='', chat_
if GlobalVars.github_username is None or GlobalVars.github_password is None:
return (False, "Tell someone to set a GH password")

payload = {"title": u"{0}: {1} {2}".format(username, op.title(), item),
"body": u"[{0}]({1}) requests the {2} of the {3} `{4}`. See the MS search [here]"
payload = {"title": "{0}: {1} {2}".format(username, op.title(), item),
"body": "[{0}]({1}) requests the {2} of the {3} `{4}`. See the MS search [here]"
"(https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93{5}{6}) and the "
"Stack Exchange search [here](https://stackexchange.com/search?q=%22{7}%22).\n"
u"<!-- METASMOKE-BLACKLIST-{8} {4} -->".format(
"<!-- METASMOKE-BLACKLIST-{8} {4} -->".format(
username, chat_profile_link, op, blacklist, # 0 1 2 3
item, ms_search_option, # 4 5
quote_plus(item), # 6
Expand Down

0 comments on commit b372c37

Please sign in to comment.