Commit Graph

1179 Commits

Author SHA1 Message Date
Brian S. Stephan e52f4c915f prospector - 'log' okay name, analyze docstrings 2016-03-02 21:43:21 -06:00
Brian S. Stephan 91c4a44526 .gitlab-ci.yml: don't fail on prospector messages 2016-03-02 21:01:43 -06:00
Brian S. Stephan 7386efa2ee messing around with a gitlab CI config 2016-03-02 20:32:22 -06:00
Brian S. Stephan 2cee918fd9 twitter: reverse the mentions list before printing 2016-01-26 23:29:26 -06:00
Brian S. Stephan 21941b3392 Merge branch 'twitterbot' into 'master'
Twitter: poll the bot's mentions feed, print to channel

This uses the Twitter client's method for checking the mentions timeline
in a new thread (which can be started/stopped via IRC) to print mentions
to a specified IRC channel.

See merge request !5
2016-01-26 23:22:13 -06:00
Brian S. Stephan 9d5b9e070b twitter: start/stop mention poll thread via irc
includes a migration for a new permission for this, naturally. with
this, the poll thread can be started and actually do stuff
2016-01-26 23:14:42 -06:00
Brian S. Stephan 3b78e9b894 twitter: method for polling mentions timeline
not stitched together in this commit, so it'll work but it won't be
started
2016-01-26 00:39:51 -06:00
Brian S. Stephan 6cbf5f3d96 twitter: pull the tweet reply method into two
_return_tweet_or_retweet_text used to both determine the proper tweet
text and bot.reply() with it to the provided event. if we're not
reacting to an irc event, this obviously won't work, so this pulls the
method into two things so that we can use the string formatting code
without necessary needing an event
2016-01-26 00:08:46 -06:00
Brian S. Stephan e8e42cc580 twitter: replace since_id with mentions_since_id
we'll want to treat the since_ids for mentions and (theoretical)
timelines differently, i think, so might as well just set up the split
out field now
2016-01-24 18:46:06 -06:00
Brian S. Stephan 352ce81bc9 twitter: add field for mentions output channel
this removes an old, general field, which was once used for multiple
things, but we should break apart its functional usage and also just
refer to our IrcChannel object anyway

this is the easy half of issue #3
2016-01-24 17:50:46 -06:00
Brian S. Stephan e25b3aca9d twitter: don't append colon to nick when replying
just a style thing, nbd
2016-01-17 12:37:23 -06:00
Brian S. Stephan 3718db5086 Merge branch 'py3' into 'master'
Py3 - Format exceptions properly

Exceptions need to be explicitly cast as strings before being fed to
format() now

See merge request !4
2016-01-17 12:13:50 -06:00
Brian S. Stephan 57588afbe6 dispatch: wrap exceptions in str() before format() 2016-01-17 12:11:00 -06:00
Brian S. Stephan b09c20e910 twitter: wrap exceptions in str() before format()
this might also do something about #1, considering i'm also just doing
blanket except Exception:s now. fingers crossed
2016-01-17 12:04:34 -06:00
Brian S. Stephan 124cf0bdb0 removing BUGS file
i couldn't confirm the only thing in it, and gitlab seems like a way
better idea anyway, now that i'm using it
2016-01-17 11:51:19 -06:00
Brian S. Stephan 702a2de4c6 Merge branch 'py3' into 'master'
Py3 - Remove a couple unnecessary UTF8 encodes



See merge request !3
2016-01-17 11:44:27 -06:00
Brian S. Stephan 7a1c024d69 dispatch: write message to file properly in py3 2016-01-17 11:39:43 -06:00
Brian S. Stephan 007f9bdbc7 twitter: don't re-encode replyee name
this appears to have been whan was causing replying via twitter to fail.
let's test something while we're here:

fixes #2
2016-01-17 11:36:10 -06:00
Brian S. Stephan 164f2c61bf Merge branch 'better-plugin-support' into 'master'
Better plugin (un)loading --- more logging, !reload plugin with option
of reloading entire package

In addition to a variety of logging and internal changes, this
also adds a !reload [plugin] command, which, where 'plugin' is
'package.ircplugin', just does a simple unload/load on the
plugin, but where 'plugin' is 'package.', reloads all modules
in the specified package (assuming it is still a plugin's
package), which allows for making more code changes and applying
them without having to restart the bot.

Like all things this internal to the bot, this probably needs
the tires kicked a bit more, but initial testing has succeeded.

See merge request !2
2016-01-17 11:12:32 -06:00
Brian S. Stephan 6fe6797281 ircbot: implement !reload for plugins
in addition to being a convenient unload plugin, load plugin, this also
uses importlib.reload() to kick the interpreter to reload changed code
inside the plugin's package, if the user requests to reload the entire
package. this seems safe so far

(famous last words)
2016-01-17 10:56:39 -06:00
Brian S. Stephan 0ba889bf75 ircbot: _unload_plugin doesn't need connection 2016-01-17 10:52:25 -06:00
Brian S. Stephan 97c18a2459 ircbot: provide feedback option to _plugin_unload 2016-01-17 09:49:55 -06:00
Brian S. Stephan 10071f9094 ircbot: add load/unload plugin documentation 2016-01-17 09:49:30 -06:00
Brian S. Stephan 676f479d52 ircbot: add some debug logging in plugin (un)load 2016-01-17 09:21:29 -06:00
Brian S. Stephan 4c949ee6f3 ircbot: don't unload just one plugin of path
if we somehow got multiple plugins of the same path loaded, unload them
all when unloading, not just the first one we find
2016-01-17 09:20:06 -06:00
Brian S. Stephan 310c2aa28d markov: fake a __stop if a k1,k2 has no v
this shouldn't have happened, but i'm guessing some previous crash put
some buggy data into my database, so let's just be careful and do this.
a k1,k2 could have had any value for v, but not knowing what else to do
in this corner case, we'll just use a stop and let the caller decide
if they want to keep going
2016-01-16 23:41:46 -06:00
Brian S. Stephan a243b65d1d ircbot: new auto-migration, either django or py3 2016-01-16 19:57:11 -06:00
Brian S. Stephan b14152d8d5 dispatch: new auto-migration, either django or py3 2016-01-16 19:56:14 -06:00
Brian S. Stephan f66aea6c2d Merge branch 'py3' into 'master'
Upgrade dr.botzo to Python 3

The py3 branch brings dr.botzo to the point that it's able to run in a Python 3.4 environment. All IRC plugins have been tested on an actual network.

Due to 2to3's behavior with unicode_literals, this should *not* be run in a Python 2 environment, as the once-unicode-safe literals might be mistreated again.

See merge request !1
2016-01-16 19:47:01 -06:00
Brian S. Stephan 0051f006d9 requirements.txt: py3 related (?) version bumps
this has been tested in a python 3.4 environment. i'm not sure if all of
these changes were necessary to make this py3 compatible, but it works,
so i'm committing it
2016-01-16 19:40:18 -06:00
Brian S. Stephan a314809671 weather: use requests library over urllib/json 2016-01-16 19:39:33 -06:00
Brian S. Stephan 90d20dfe75 transform: use new py3 base64 API 2016-01-16 19:37:24 -06:00
Brian S. Stephan 59c593f60b transform: use codecs library for rot13 2016-01-16 19:36:51 -06:00
Brian S. Stephan c3c54b9f10 ircbot: use % formatting in some debugging 2016-01-16 19:36:10 -06:00
Brian S. Stephan cdde966733 ircbot: properly output exception msg to string 2016-01-16 19:34:06 -06:00
Brian S. Stephan 570a4e1962 twitter: don't re-encode response as utf-8 2016-01-16 19:33:03 -06:00
Brian S. Stephan 47a1352a0a change __unicode__()s to __str__()s 2016-01-16 18:21:46 -06:00
Brian S. Stephan 9112ad0ae7 convert the project via 2to3 2016-01-16 18:02:17 -06:00
Brian S. Stephan f513b241d2 ircbot: force lowercase IrcChannel channel name 2015-09-17 22:55:25 -05:00
Brian S. Stephan d9c39d3db9 markov: better context/target creation ex handling 2015-09-17 22:35:23 -05:00
Brian S. Stephan 4f17234a0a markov: force the target/context to lowercase 2015-09-17 22:35:04 -05:00
Brian S. Stephan e8d57b29b2 irclib.bot: don't del sys.modules[badname]
this makes no sense to do on ImportError since that's probably why we
got here. testing, not 100% sure this is right
2015-09-17 22:23:36 -05:00
Brian S. Stephan 91594117bc remove deprecated TEMPLATE_DIRS setting 2015-09-17 22:23:14 -05:00
Brian S. Stephan 505dc8799c markov: configure what channels to learn from 2015-09-17 22:22:59 -05:00
Brian S. Stephan 75dc2ae2cb bump django dep 2015-09-17 21:58:54 -05:00
Brian S. Stephan 91bbabec67 facts: get rid of the soap stuff
interesting, but i don't really care to use it ever, so deleted
2015-09-17 21:56:52 -05:00
Brian S. Stephan efc2b2675f Merge branch 'master' of git.incorporeal.org:dr.botzo 2015-09-17 21:35:36 -05:00
Brian S. Stephan 8504a2556d facts: trivial comment cleanups 2015-09-16 16:57:12 -05:00
Brian S. Stephan a7a54c75b7 pysimplesoap dependency 2015-08-16 17:15:08 -05:00
Brian S. Stephan b9b626d2ef remove useless import 2015-08-14 16:55:02 -05:00