Skip to content

Commit

Permalink
Revert "Merge pull request #822 from j-f1/patch-1"
Browse files Browse the repository at this point in the history
This reverts commit 57518ac, reversing
changes made to 8e8e5f7.
  • Loading branch information
ArtOfCode- committed Jun 9, 2017
1 parent 9ac9935 commit 75dad4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
12 changes: 4 additions & 8 deletions chatcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def command_blacklist_help(*args, **kwargs):


# noinspection PyIncorrectDocstring,PyUnusedLocal
def command_blacklist_website(message_parts, ev_user_name, ev_room, ev_user_id, wrap2, message_id, *args, **kwargs):
def command_blacklist_website(message_parts, ev_user_name, ev_room, ev_user_id, wrap2, *args, **kwargs):
"""
Adds a string to the website blacklist and commits/pushes to GitHub
:param message_parts:
Expand All @@ -315,14 +315,13 @@ def command_blacklist_website(message_parts, ev_user_name, ev_room, ev_user_id,
item_to_blacklist=website_pattern,
username=ev_user_name,
chat_profile_link=chat_user_profile_link,
message_id=message_id,
code_permissions=datahandling.is_code_privileged(ev_room, ev_user_id, wrap2)
)
return Response(command_status=result[0], message=result[1])


# noinspection PyIncorrectDocstring,PyUnusedLocal
def command_blacklist_keyword(message_parts, ev_user_name, ev_room, ev_user_id, wrap2, message_id, *args, **kwargs):
def command_blacklist_keyword(message_parts, ev_user_name, ev_room, ev_user_id, wrap2, *args, **kwargs):
"""
Adds a string to the keyword blacklist and commits/pushes to GitHub
:param message_parts:
Expand All @@ -344,14 +343,13 @@ def command_blacklist_keyword(message_parts, ev_user_name, ev_room, ev_user_id,
item_to_blacklist=keyword_pattern,
username=ev_user_name,
chat_profile_link=chat_user_profile_link,
message_id=message_id,
code_permissions=datahandling.is_code_privileged(ev_room, ev_user_id, wrap2)
)
return Response(command_status=result[0], message=result[1])


# noinspection PyIncorrectDocstring,PyUnusedLocal
def command_watch_keyword(message_parts, ev_user_name, ev_room, ev_user_id, wrap2, message_id, *args, **kwargs):
def command_watch_keyword(message_parts, ev_user_name, ev_room, ev_user_id, wrap2, *args, **kwargs):
"""
Adds a string to the watched keywords list and commits/pushes to GitHub
:param message_parts:
Expand All @@ -375,14 +373,13 @@ def command_watch_keyword(message_parts, ev_user_name, ev_room, ev_user_id, wrap
item_to_blacklist=watchlist_entry,
username=ev_user_name,
chat_profile_link=chat_user_profile_link,
message_id=message_id,
code_permissions=datahandling.is_code_privileged(ev_room, ev_user_id, wrap2)
)
return Response(command_status=result[0], message=result[1])


# noinspection PyIncorrectDocstring,PyUnusedLocal
def command_blacklist_username(message_parts, ev_user_name, ev_room, ev_user_id, wrap2, message_id, *args, **kwargs):
def command_blacklist_username(message_parts, ev_user_name, ev_room, ev_user_id, wrap2, *args, **kwargs):
"""
Adds a string to the username blacklist and commits/pushes to GitHub
:param message_parts:
Expand All @@ -404,7 +401,6 @@ def command_blacklist_username(message_parts, ev_user_name, ev_room, ev_user_id,
item_to_blacklist=username_pattern,
username=ev_user_name,
chat_profile_link=chat_user_profile_link,
message_id=message_id,
code_permissions=datahandling.is_code_privileged(ev_room, ev_user_id, wrap2)
)
return Response(command_status=result[0], message=result[1])
Expand Down
15 changes: 2 additions & 13 deletions gitmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def add_to_blacklist(cls, **kwargs):
blacklist = kwargs.get("blacklist", "")
item_to_blacklist = kwargs.get("item_to_blacklist", "")
username = kwargs.get("username", "")
message_id = kwargs.get("message_id", "<unknown>")
chat_profile_link = kwargs.get("chat_profile_link", "http://chat.stackexchange.com/users")
code_permissions = kwargs.get("code_permissions", False)

Expand Down Expand Up @@ -138,9 +137,7 @@ def add_to_blacklist(cls, **kwargs):
git.add('watched_keywords.txt')

git.commit("--author='SmokeDetector <smokey@erwaysoftware.com>'",
"-m", u"Auto {0} of {1} by {2} --autopull".format(op, item, username),
"-m", u"Request: https://chat.stackexchange.com/transcript/message/{0}#{0}".format(message_id))
commit_sha = git('rev-parse', 'HEAD')
"-m", u"Auto {0} of {1} by {2} --autopull".format(op, item, username))

if code_permissions:
git.checkout("master")
Expand Down Expand Up @@ -196,15 +193,7 @@ def add_to_blacklist(cls, **kwargs):
finally:
cls.gitmanager_lock.release()

return (
True,
"{0}ed {1}: [`{2}`](https://github.com/Charcoal-SE/SmokeDetector/commit/{3})".format(
op.title(),
item,
commit_sha[:7],
commit_sha
)
)
return (True, "{0}ed {1}".format(op.title(), item))

@staticmethod
def current_git_status():
Expand Down

0 comments on commit 75dad4e

Please sign in to comment.