diff --git a/pyborg/pyborg/mod/mod_discord.py b/pyborg/pyborg/mod/mod_discord.py index e0b5754..1d604dd 100644 --- a/pyborg/pyborg/mod/mod_discord.py +++ b/pyborg/pyborg/mod/mod_discord.py @@ -74,7 +74,8 @@ def _extract_emoji(self, msg: str, server_emojis:List[str]) -> str: logger.info(incoming_message) return incoming_message else: - logger.info("someone did a fucky wucky") + logger.info("_extract_emoji:someone did a fucky wucky") + logger.debug("_extract_emoji:OOPSIE WOOPSIE!! Uwu We made a fucky wucky!! A wittle fucko boingo! The code monkeys at our headquarters are working VEWY HAWD to fix this!") return msg async def on_message(self, message: discord.Message) -> None: diff --git a/pyborg/pyborg/pyborg.py b/pyborg/pyborg/pyborg.py index cb0945f..8bbeeee 100644 --- a/pyborg/pyborg/pyborg.py +++ b/pyborg/pyborg/pyborg.py @@ -538,7 +538,7 @@ def do_commands(self, io_module, body, args, owner): else: num_cpw = 0.0 msg = "I know %d words (%d contexts, %.2f per word), %d lines." % (num_w, num_c, num_cpw, num_l) - + # Do i know this word elif command_list[0] == "!known": if len(command_list) == 2: @@ -998,7 +998,6 @@ def reply(self, body): # if w in self.words: # logger.debug(self.words[w]) # k = len(self.words[w]) - # d[w] = k # logger.debug("find_known_words: %s", d) # idx = [x for x,y in d.items() if y > 3] diff --git a/pyborg/setup.py b/pyborg/setup.py index a00ea5e..9c48541 100644 --- a/pyborg/setup.py +++ b/pyborg/setup.py @@ -6,30 +6,46 @@ from pyborg import __version__ -requires = ["irc>=15.1.1", "toml", - "arrow==0.10.0", "PyTumblr==0.0.6", "requests", "bottle", - "venusian", "click", "humanize", "praw", "Mastodon.py", - "lxml", "attrs", "statsd", "prompt_toolkit"] +requires = [ + "irc>=15.1.1", + "toml", + "arrow==0.10.0", + "PyTumblr==0.0.6", + "requests", + "bottle", + "venusian", + "click", + "humanize", + "praw", + "Mastodon.py", + "lxml", + "attrs", + "statsd", + "prompt_toolkit", +] if sys.version_info >= (3,): requires.extend(["discord.py", "aeidon"]) -setup(name="pyborg", - version=__version__, - packages=["pyborg", "pyborg.util", "pyborg.mod"], - scripts=['pyborg-irc.py', - 'pyborg_experimental.py'], - author="Jack Laxson", - author_email="jackjrabbit@gmail.com", - description="Markov chain bot for irc which generates replies to messages", - license="GPL v3 or later", - install_requires=requires, - entry_points=''' +setup( + name="pyborg", + version=__version__, + packages=["pyborg", "pyborg.util", "pyborg.mod"], + scripts=['pyborg-irc.py', 'pyborg_experimental.py'], + author="Jack Laxson", + author_email="jackjrabbit@gmail.com", + description="Markov chain bot for irc which generates replies to messages", + license="GPL v3 or later", + install_requires=requires, + entry_points=''' [console_scripts] pyborg=pyborg_experimental:cli_base ''', - url="https://github.com/jrabbit/pyborg-1up/", - classifiers=["License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", - "Topic :: Communications :: Chat :: Internet Relay Chat", - "Topic :: Games/Entertainment", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6",]) + url="https://github.com/jrabbit/pyborg-1up/", + classifiers=[ + "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", + "Topic :: Communications :: Chat :: Internet Relay Chat", + "Topic :: Games/Entertainment", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + ], +) diff --git a/pyborg/test/test_tumblr.py b/pyborg/test/test_tumblr.py index 90b3ea1..3158e3f 100644 --- a/pyborg/test/test_tumblr.py +++ b/pyborg/test/test_tumblr.py @@ -7,20 +7,25 @@ if sys.version_info < (3,): import mock import pyborg - class TestBot(unittest.TestCase): - settings = {'auth': {'consumer_key': 'KEY', - 'consumer_secret': 'SECRET', - 'oauth_secret': 'TOKEN', - 'oauth_token': 'TOKEN'}, - 'pyborg': {'multiplex': False}, - 'tumblr': {'blog': 'billoreilly.tumblr.com', - 'cooldown': 20, - 'ignore': [], - 'last_look': datetime.datetime(2016, 8, 18, 7, 25, 30, 164769), - 'learning': False, - 'tags': ['hello bill']}} + settings = { + 'auth': { + 'consumer_key': 'KEY', + 'consumer_secret': 'SECRET', + 'oauth_secret': 'TOKEN', + 'oauth_token': 'TOKEN', + }, + 'pyborg': {'multiplex': False}, + 'tumblr': { + 'blog': 'billoreilly.tumblr.com', + 'cooldown': 20, + 'ignore': [], + 'last_look': datetime.datetime(2016, 8, 18, 7, 25, 30, 164769), + 'learning': False, + 'tags': ['hello bill'], + }, + } with open("pyborg/test/fixtures/tumblr_posts.json") as fixture_f: posts = json.load(fixture_f) @@ -28,7 +33,9 @@ class TestBot(unittest.TestCase): @mock.patch('pyborg.mod.mod_tumblr.logger.info') @mock.patch('pyborg.pyborg.pyborg.reply') @mock.patch('toml.load') - def test_handle_post(self, patched_load, patched_pyborg, patched_info, pybpybpyb): + def test_handle_post( + self, patched_load, patched_pyborg, patched_info, pybpybpyb + ): patched_load.return_value = self.settings mod = pyborg.mod.mod_tumblr.PyborgTumblr("bogus.toml") @@ -38,7 +45,8 @@ def test_handle_post(self, patched_load, patched_pyborg, patched_info, pybpybpyb patched_load.assert_called_once_with("bogus.toml") patched_pyborg.return_value = "fuck it do it live" patched_info.assert_any_call("found post: \n%s", self.posts[0]['summary']) - # print(patched_info.mock_calls) + + # print(patched_info.mock_calls) @mock.patch('pytumblr.TumblrRestClient.tagged') @mock.patch('pyborg.pyborg.pyborg') @@ -49,7 +57,8 @@ def test_load_new(self, patched_load, pybpybpyb, patched_tagged): mod = pyborg.mod.mod_tumblr.PyborgTumblr("bogus.toml") ret = mod.load_new_from_tag("hello bill") patched_tagged.assert_called_once_with("hello bill") - # self.assertEqual(ret, ) + + # self.assertEqual(ret, ) @mock.patch('time.sleep') @mock.patch('pyborg.mod.mod_tumblr.PyborgTumblr.load_new_from_tag')