bots/fortunebot.git
2 weeks agoAdded tests for bot.py master
Vincent Wong [Sun, 16 Aug 2015 23:10:13 +0000 (16:10 -0700)]
Added tests for bot.py

2 weeks agoAdded nose as package dependency, fixed minor bug
Vincent Wong [Sun, 16 Aug 2015 22:38:36 +0000 (15:38 -0700)]
Added nose as package dependency, fixed minor bug

Minor bug: send_msg was not stripping DEL character

2 weeks agoChanged fortunebot.FortuneBot to fortunebot.Fortunebot
Vincent Wong [Sun, 16 Aug 2015 21:19:55 +0000 (14:19 -0700)]
Changed fortunebot.FortuneBot to fortunebot.Fortunebot

2 weeks agoAdded mock as dependency, a few more botrunner tests
Vincent Wong [Sun, 16 Aug 2015 21:09:11 +0000 (14:09 -0700)]
Added mock as dependency, a few more botrunner tests

4 weeks agoReorganized FortunebotRunner, added a test
Vincent Wong [Sun, 2 Aug 2015 09:04:50 +0000 (02:04 -0700)]
Reorganized FortunebotRunner, added a test

2 months agoAdded basic unit test for command line args
Vincent Wong [Mon, 22 Jun 2015 08:01:45 +0000 (01:01 -0700)]
Added basic unit test for command line args

2 months agoFixed README to note 3.4 support
Vincent Wong [Tue, 16 Jun 2015 01:39:50 +0000 (18:39 -0700)]
Fixed README to note 3.4 support

2 months agoUpped version to 1.3 v1.3
Vincent Wong [Tue, 16 Jun 2015 01:31:12 +0000 (18:31 -0700)]
Upped version to 1.3

The 3 represents support for python3!

(It's just a coincidence)

3 months agoFixed scripts/fortune for py3
Vincent Wong [Mon, 4 May 2015 08:35:10 +0000 (01:35 -0700)]
Fixed scripts/fortune for py3

In py3, subprocess communicate provides bytes data, which won't work with
string manipulation. So, simply decode into unicode first.

3 months agobot now uses unicode everywhere
Vincent Wong [Mon, 4 May 2015 08:09:22 +0000 (01:09 -0700)]
bot now uses unicode everywhere

One implication is that scripts must also deal with unicode input

3 months agoGeneralized utils/EasyConfigParser for py2/3 compatibility
Vincent Wong [Mon, 4 May 2015 06:05:13 +0000 (23:05 -0700)]
Generalized utils/EasyConfigParser for py2/3 compatibility

- Made overriden functions argument-agnostic, only caring about the relevant
  keyword (fallback, sections)
- Changed base class to ConfigParser, which is more recommended in py3

3 months agoFixed unicode issues in send_msg to work in py2/py3
Vincent Wong [Mon, 4 May 2015 02:11:06 +0000 (19:11 -0700)]
Fixed unicode issues in send_msg to work in py2/py3

FINALLY

3 months agoCleaned up utils/easyconfigparser
Vincent Wong [Mon, 4 May 2015 00:11:47 +0000 (17:11 -0700)]
Cleaned up utils/easyconfigparser

- Moved defaultable decorator out of class
- Removed old ConfigParser import

3 months agoUsed the six package in various places for py3
Vincent Wong [Sun, 3 May 2015 19:18:43 +0000 (12:18 -0700)]
Used the six package in various places for py3

3 months agoChanged scripts/weather to use requests
Vincent Wong [Sun, 3 May 2015 07:47:35 +0000 (00:47 -0700)]
Changed scripts/weather to use requests

3 months agoChanged scripts/insult to use requests
Vincent Wong [Sun, 3 May 2015 06:12:54 +0000 (23:12 -0700)]
Changed scripts/insult to use requests

3 months agoFixed bot send_msg to work correctly with unicode message
Vincent Wong [Sun, 3 May 2015 06:11:02 +0000 (23:11 -0700)]
Fixed bot send_msg to work correctly with unicode message

3 months agoFixed bot.py's clean mutating dictionary while iterating
Vincent Wong [Sun, 3 May 2015 06:07:58 +0000 (23:07 -0700)]
Fixed bot.py's clean mutating dictionary while iterating

3 months agoModernized some code according to 2to3
Vincent Wong [Sat, 2 May 2015 08:12:42 +0000 (01:12 -0700)]
Modernized some code according to 2to3

3 months agoUpdated logging to log traceback when the bot dies
Vincent Wong [Sun, 3 May 2015 05:42:35 +0000 (22:42 -0700)]
Updated logging to log traceback when the bot dies

4 months agoUpped version number to 1.2 v1.2
Vincent Wong [Fri, 1 May 2015 08:12:25 +0000 (01:12 -0700)]
Upped version number to 1.2

To celebrate the huge change in distribution method.

Also, removed the importlib requirement, since that's part of stdlib....

4 months agoUpdated a few module docstrings
Vincent Wong [Fri, 1 May 2015 05:49:09 +0000 (22:49 -0700)]
Updated a few module docstrings

For botrunner and generate_config

4 months agoUpdated README
Vincent Wong [Fri, 1 May 2015 05:45:51 +0000 (22:45 -0700)]
Updated README

4 months agoAdded a fortunebot-generate-config hook
Vincent Wong [Fri, 1 May 2015 05:12:27 +0000 (22:12 -0700)]
Added a fortunebot-generate-config hook

Creates a ~/.config/fortunebot/fortunebot.conf from the example bundled with
the Python package.

4 months agoRemoved user-specific entries from project .gitignore
Vincent Wong [Thu, 30 Apr 2015 21:39:42 +0000 (14:39 -0700)]
Removed user-specific entries from project .gitignore

Stuff like *.swp or virtualenv directory should be dealt with by a user's
global gitignore, nor per-project.

4 months agoChanged default config search path
Vincent Wong [Thu, 30 Apr 2015 21:30:29 +0000 (14:30 -0700)]
Changed default config search path

Now uses ~/.fortunebot/fortunebot.conf and ./fortunebot.conf

4 months agoCleaned up other scripts also
Vincent Wong [Thu, 30 Apr 2015 19:48:05 +0000 (12:48 -0700)]
Cleaned up other scripts also

4 months agoMade a killproc closure in scripts/fortune
Vincent Wong [Thu, 30 Apr 2015 19:31:19 +0000 (12:31 -0700)]
Made a killproc closure in scripts/fortune

Instead of an overkill instance method not used anywhere else

4 months agoRemoved unnecessary prefix underscores in functions
Vincent Wong [Thu, 30 Apr 2015 19:06:10 +0000 (12:06 -0700)]
Removed unnecessary prefix underscores in functions

They make methods pseudo-private by preventing them from being imported into
the importing namespace, but that's just being pedantic and restrictive for no
real benefit.

4 months agoReplaced install with setuptools console_script
Vincent Wong [Thu, 30 Apr 2015 08:51:15 +0000 (01:51 -0700)]
Replaced install with setuptools console_script

fortunebot no longer manually creates an /etc/fortunebot nor installs init
scripts. It *really* doesn't need to be a init service.

4 months agoChanged entrypoint to __main__.py
Vincent Wong [Thu, 30 Apr 2015 08:24:25 +0000 (01:24 -0700)]
Changed entrypoint to __main__.py

Package can now be run with `python fortunebot`

4 months agoOverhauled gitignore
Vincent Wong [Thu, 30 Apr 2015 06:06:21 +0000 (23:06 -0700)]
Overhauled gitignore

Removed useless ignores from other languages, added a venv ignore

6 months agoReplaced Weather setlimit option with zippath
Vincent Wong [Mon, 16 Feb 2015 19:33:53 +0000 (11:33 -0800)]
Replaced Weather setlimit option with zippath

zippath allows the user to specify a file to load saved zips from, i.e. which
zip is associated with which nick. New associations are automatically appended
to the file.

6 months agoCleaned up Remind tremendously
Vincent Wong [Mon, 16 Feb 2015 18:50:20 +0000 (10:50 -0800)]
Cleaned up Remind tremendously

Changes:
- Removed the ridiculous duration limit option
- Replaced its custom, inefficient system of task-keeping with a CacheDict
- Moved argument handling into a separate function

6 months agoCleaned up Replace slightly
Vincent Wong [Mon, 16 Feb 2015 18:46:16 +0000 (10:46 -0800)]
Cleaned up Replace slightly

6 months agoAdded a general insert method to CacheDict for modified time of insertion
Vincent Wong [Mon, 16 Feb 2015 18:43:40 +0000 (10:43 -0800)]
Added a general insert method to CacheDict for modified time of insertion

6 months agoFixed disagreement about CONFDIR in install/uninstall script
Vincent Wong [Sun, 15 Feb 2015 06:28:46 +0000 (22:28 -0800)]
Fixed disagreement about CONFDIR in install/uninstall script

Install script also properly renames fortunebot.conf.example so fortunebot can
be used out of the box

6 months agoAdded a global enable option
Vincent Wong [Sun, 15 Feb 2015 05:51:43 +0000 (21:51 -0800)]
Added a global enable option

Also:
- added a logger line that tells how many script successfully loaded
- enforced script names to be the same as module names

6 months agoEasyConfigParser's get functions now allow default values
Vincent Wong [Sun, 15 Feb 2015 05:41:50 +0000 (21:41 -0800)]
EasyConfigParser's get functions now allow default values

6 months agoScript __init__ now dynamically adds modules to __all__
Vincent Wong [Sun, 15 Feb 2015 03:15:41 +0000 (19:15 -0800)]
Script __init__ now dynamically adds modules to __all__

6 months agoMoved bot and scripts naming style to full underscore
Vincent Wong [Fri, 13 Feb 2015 20:31:58 +0000 (12:31 -0800)]
Moved bot and scripts naming style to full underscore

Yay!

6 months agoAdded the choose script
Vincent Wong [Fri, 13 Feb 2015 19:24:49 +0000 (11:24 -0800)]
Added the choose script

6 months agoUpdated a bunch of docs
Vincent Wong [Mon, 9 Feb 2015 07:58:16 +0000 (23:58 -0800)]
Updated a bunch of docs

README, config file descriptions, weather help message

6 months agoChanged weather.py to use CacheDict
Vincent Wong [Mon, 9 Feb 2015 07:38:46 +0000 (23:38 -0800)]
Changed weather.py to use CacheDict

6 months agoCacheDict's oldest-set pop is now O(1)
Vincent Wong [Mon, 9 Feb 2015 06:32:29 +0000 (22:32 -0800)]
CacheDict's oldest-set pop is now O(1)

6 months agoAdded CacheDict to utils
Vincent Wong [Mon, 9 Feb 2015 03:54:36 +0000 (19:54 -0800)]
Added CacheDict to utils

CacheDict is a dict-like object optimized for caching operations. It maintains
a size limit, and removes the oldest-set object upon hitting the size ceiling.
It also offers a prune function that removes all "expired" objects.

6 months agoAdded set option to weather
Vincent Wong [Mon, 9 Feb 2015 01:19:27 +0000 (17:19 -0800)]
Added set option to weather

The -s or --set option allows weather to remember a zipcode for the user,
allowing him/her to simply type !w next time to query the same zipcode.

6 months agoAdded caching to weather script
Vincent Wong [Mon, 9 Feb 2015 00:26:28 +0000 (16:26 -0800)]
Added caching to weather script

6 months agoAdded ability for weather to geolocate hostname
Vincent Wong [Sat, 7 Feb 2015 09:16:54 +0000 (01:16 -0800)]
Added ability for weather to geolocate hostname

6 months agoMade replace lines 1-indexed
Vincent Wong [Sat, 7 Feb 2015 09:16:06 +0000 (01:16 -0800)]
Made replace lines 1-indexed

6 months agobot.py now passes full irc.client.NickMask to scripts
Vincent Wong [Sat, 7 Feb 2015 08:38:20 +0000 (00:38 -0800)]
bot.py now passes full irc.client.NickMask to scripts

6 months agoConnect.channels now work without '#' prefix to channel
Vincent Wong [Tue, 3 Feb 2015 09:46:07 +0000 (01:46 -0800)]
Connect.channels now work without '#' prefix to channel

Also updated fortunebot version officially* to 1.1

* By officially, it just means in the setup.py

6 months agoFixed bot open files getting destroyed by IO redirection
Vincent Wong [Tue, 3 Feb 2015 09:23:45 +0000 (01:23 -0800)]
Fixed bot open files getting destroyed by IO redirection

Initial configurations and script initialization for bot is now done _after_ IO
redirection.

6 months agoFixed bug with bot.py searching for wrong confg name
Vincent Wong [Mon, 2 Feb 2015 04:05:11 +0000 (20:05 -0800)]
Fixed bug with bot.py searching for wrong confg name

Also added requirement in setup.py for irclib to be >=11

6 months agoUpdated README and added comments to example config
Vincent Wong [Mon, 2 Feb 2015 03:01:28 +0000 (03:01 +0000)]
Updated README and added comments to example config

6 months agoAdded fortune configs to set ping try limit and interval
Vincent Wong [Mon, 2 Feb 2015 02:32:58 +0000 (02:32 +0000)]
Added fortune configs to set ping try limit and interval

Also rewrote ping-pong mechanism to use a RepeatingThread

6 months agoAdded proper disconnection detection
Vincent Wong [Mon, 2 Feb 2015 01:32:26 +0000 (01:32 +0000)]
Added proper disconnection detection

Also renamed pollThread to poll_thread

6 months agoAdded importlib as dependency in setup.py
Vincent Wong [Mon, 2 Feb 2015 01:29:21 +0000 (01:29 +0000)]
Added importlib as dependency in setup.py

6 months agoUpdated EINTR hack to work with irclib v11
Vincent Wong [Mon, 2 Feb 2015 01:28:32 +0000 (01:28 +0000)]
Updated EINTR hack to work with irclib v11

9 months agoAdded burn script
Vincent Wong [Fri, 14 Nov 2014 09:04:29 +0000 (01:04 -0800)]
Added burn script
The burn script just returns a random choice amongst a bunch of TOLD variants
whenever someone posts public message that contains all of the magic words set
in the config file.

11 months agoFixed uninstall not remove binary, updated README
Vincent Wong [Fri, 19 Sep 2014 19:17:08 +0000 (12:17 -0700)]
Fixed uninstall not remove binary, updated README

11 months agoAdded option in markov to record new text into markov sample file
Vincent Wong [Fri, 19 Sep 2014 19:03:21 +0000 (12:03 -0700)]
Added option in markov to record new text into markov sample file

Also added a clean-up method in the bot engine that deletes all script objects,
so __del__ methods probably work.

11 months agoUpdated config file, paths, install/uninstall scripts
Vincent Wong [Thu, 18 Sep 2014 08:01:14 +0000 (01:01 -0700)]
Updated config file, paths, install/uninstall scripts

- Removed obsolete enable_help config
- Moved default config folder to /etc/fortunebot/
- Added check in bot engine for unsuccessful parsing of config files
- Added root checks in install and uninstall scripts

11 months agoIntegrated help system into bot engine, removed bothelp script
Vincent Wong [Thu, 18 Sep 2014 07:36:28 +0000 (00:36 -0700)]
Integrated help system into bot engine, removed bothelp script

Having the help system inside the engine itself allows more flexibility for
individual script to write their own help messages.

Also, the help command is active in private messages now as well.

11 months agoMore PEP-8 compliance and pylint silence
Vincent Wong [Thu, 18 Sep 2014 06:34:17 +0000 (23:34 -0700)]
More PEP-8 compliance and pylint silence

11 months agoUpdated and added documentation
Vincent Wong [Thu, 18 Sep 2014 06:04:19 +0000 (23:04 -0700)]
Updated and added documentation

11 months agoOverhauled config and script loading system
Vincent Wong [Thu, 18 Sep 2014 04:46:40 +0000 (21:46 -0700)]
Overhauled config and script loading system

Scripts are now dynamically loaded from files in the scripts subpackage using
importlib and inspect. The bot engine has zero knowledge of individual scripts
beyond interfacing attributes and methods. The scripts themselves are also
slightly modified to adapt to the new system.

The default configurations hardcoded inside the bot engine are removed, because
no matter what a config file is required. The removal of default configurations
just means that a few more settings in the config file are mandatory.

11 months agoFixed remind to work independently in each channel
Vincent Wong [Wed, 17 Sep 2014 04:20:00 +0000 (21:20 -0700)]
Fixed remind to work independently in each channel

Also slightly changed remind's arguments. Rather than a target and a message,
it now only needs a message. Also added an explicit -s option to specify time
in seconds, even though it's already the default.

Lastly, bothelp is updated to reflect the above.

11 months agoAdded multi-channel support for bot engine
Vincent Wong [Wed, 17 Sep 2014 02:08:56 +0000 (19:08 -0700)]
Added multi-channel support for bot engine

The configuration file now allows multiple names in the channels argument.

15 months agoFixed replace crashing bot due to unprintable characters
Vincent Wong [Wed, 28 May 2014 04:59:12 +0000 (21:59 -0700)]
Fixed replace crashing bot due to unprintable characters

15 months agoAdded a damn option in replace to choose line and to search backwards
Vincent Wong [Sat, 24 May 2014 06:32:23 +0000 (23:32 -0700)]
Added a damn option in replace to choose line and to search backwards

15 months agoModified replace to ignore anything after the third slash
Vincent Wong [Thu, 15 May 2014 23:36:53 +0000 (16:36 -0700)]
Modified replace to ignore anything after the third slash

17 months agoAdded replace description in README and bot.py comments
Vincent Wong [Fri, 21 Mar 2014 23:27:59 +0000 (16:27 -0700)]
Added replace description in README and bot.py comments

17 months agoFixed reconnect system
Vincent Wong [Sat, 8 Mar 2014 22:08:31 +0000 (14:08 -0800)]
Fixed reconnect system

18 months agoFixed bug in remind when multiple messages trigger simultaneously
Vincent Wong [Sat, 1 Mar 2014 06:17:54 +0000 (22:17 -0800)]
Fixed bug in remind when multiple messages trigger simultaneously

18 months agoMade maxlength and shortcut on/off configuration for replace, slightly tweaked markov...
Vincent Wong [Sun, 23 Feb 2014 05:16:26 +0000 (21:16 -0800)]
Made maxlength and shortcut on/off configuration for replace, slightly tweaked markov behavior

18 months agoAdded replace help msg, fixed small replace bug
Vincent Wong [Thu, 20 Feb 2014 07:50:46 +0000 (23:50 -0800)]
Added replace help msg, fixed small replace bug

18 months agoAdded untested replace script
Vincent Wong [Wed, 19 Feb 2014 08:21:42 +0000 (00:21 -0800)]
Added untested replace script

18 months agowrapped README.md to 80 cols
Troy Sankey [Tue, 11 Feb 2014 19:18:02 +0000 (11:18 -0800)]
wrapped README.md to 80 cols

18 months agoUpdated README
Vincent Wong [Tue, 11 Feb 2014 01:47:15 +0000 (17:47 -0800)]
Updated README

18 months agoRemoved fortunebot home; config and data files will now reside in /var/lib/fortunebot
Vincent Wong [Tue, 11 Feb 2014 00:55:04 +0000 (16:55 -0800)]
Removed fortunebot home; config and data files will now reside in /var/lib/fortunebot

18 months agoAllow a work directory to be specified for botrunner, which affects all relative...
Vincent Wong [Sat, 8 Feb 2014 09:59:13 +0000 (01:59 -0800)]
Allow a work directory to be specified for botrunner, which affects all relative paths

18 months agoForgot to stage deletions
Vincent Wong [Wed, 5 Feb 2014 10:47:39 +0000 (02:47 -0800)]
Forgot to stage deletions

18 months agoReorganized package, added help for remind, fixed misc bugs
Vincent Wong [Wed, 5 Feb 2014 10:39:59 +0000 (02:39 -0800)]
Reorganized package, added help for remind, fixed misc bugs

18 months agoAdded remind script, bot script polling (1 Hz), other utility classes
Vincent Wong [Tue, 4 Feb 2014 20:46:09 +0000 (12:46 -0800)]
Added remind script, bot script polling (1 Hz), other utility classes

19 months agoSwitched to a more standard logging method, fixed small bug in EasyConfigParser
Vincent Wong [Wed, 29 Jan 2014 21:57:50 +0000 (13:57 -0800)]
Switched to a more standard logging method, fixed small bug in EasyConfigParser

19 months agoFixed empty input bug, added EasyConfigParser, added markov_respond configuration...
Vincent Wong [Wed, 29 Jan 2014 20:23:57 +0000 (12:23 -0800)]
Fixed empty input bug, added EasyConfigParser, added markov_respond configuration option

19 months agoAdded help script
Vincent Wong [Sat, 25 Jan 2014 01:43:24 +0000 (17:43 -0800)]
Added help script

19 months agoUpdated README, fixed latin-1 encoding problem in fortune
Vincent Wong [Tue, 21 Jan 2014 00:21:50 +0000 (16:21 -0800)]
Updated README, fixed latin-1 encoding problem in fortune

19 months agoOrganized the scripts into pure bot plugins, integrated markov script
Vincent Wong [Mon, 20 Jan 2014 22:44:05 +0000 (14:44 -0800)]
Organized the scripts into pure bot plugins, integrated markov script

19 months agoWrote a basic markov chain script, not integrated with bot
Vincent Wong [Mon, 20 Jan 2014 09:19:31 +0000 (01:19 -0800)]
Wrote a basic markov chain script, not integrated with bot

19 months agoAdded a little hack in bot.py to work around irclib dying on signals
Vincent Wong [Sun, 19 Jan 2014 08:59:01 +0000 (00:59 -0800)]
Added a little hack in bot.py to work around irclib dying on signals

19 months agoFixed reconnect bugs, added weather key field to config
Vincent Wong [Mon, 13 Jan 2014 19:35:30 +0000 (11:35 -0800)]
Fixed reconnect bugs, added weather key field to config

19 months agoBot now reads all settings from a configuration file
Vincent Wong [Mon, 13 Jan 2014 08:32:11 +0000 (00:32 -0800)]
Bot now reads all settings from a configuration file

19 months agoGave fortunebot a proper home folder, daemon by default no longer start at boot time
Vincent Wong [Fri, 10 Jan 2014 08:26:40 +0000 (00:26 -0800)]
Gave fortunebot a proper home folder, daemon by default no longer start at boot time

19 months agoForgot to update-rc.d in install script
Vincent Wong [Fri, 10 Jan 2014 02:05:37 +0000 (18:05 -0800)]
Forgot to update-rc.d in install script

19 months agoDaemonization now closes all fds
Vincent Wong [Wed, 8 Jan 2014 01:21:42 +0000 (17:21 -0800)]
Daemonization now closes all fds

19 months agoAdded uninstall script, fixed install and setup scripts
Vincent Wong [Tue, 7 Jan 2014 09:25:56 +0000 (01:25 -0800)]
Added uninstall script, fixed install and setup scripts

19 months agoAdded SysV init script, install script
Vincent Wong [Tue, 7 Jan 2014 07:21:00 +0000 (23:21 -0800)]
Added SysV init script, install script

19 months agoFixed reconnect bugs and changed name to fortunebot
Vincent Wong [Sat, 4 Jan 2014 06:07:02 +0000 (22:07 -0800)]
Fixed reconnect bugs and changed name to fortunebot