Nav apraksta http://bits.zero9f9.com/pybot
Matt Weller 404d77b957 Merge branch 'master' into time_event | 10 gadi atpakaļ | |
---|---|---|
docs | 10 gadi atpakaļ | |
modules | 10 gadi atpakaļ | |
tests | 10 gadi atpakaļ | |
.gitignore | 10 gadi atpakaļ | |
.travis.yml | 10 gadi atpakaļ | |
CHANGES | 10 gadi atpakaļ | |
Makefile | 10 gadi atpakaļ | |
README.md | 10 gadi atpakaļ | |
Vagrantfile | 10 gadi atpakaļ | |
bootstrap.sh | 10 gadi atpakaļ | |
bot.py | 10 gadi atpakaļ | |
botbrain.py | 10 gadi atpakaļ | |
conf.py | 10 gadi atpakaļ | |
conferror.py | 11 gadi atpakaļ | |
confman.py | 10 gadi atpakaļ | |
db.py | 10 gadi atpakaļ | |
event.py | 10 gadi atpakaļ | |
index.rst | 10 gadi atpakaļ | |
logger.py | 10 gadi atpakaļ | |
mysql_dump | 10 gadi atpakaļ | |
pybotrc | 10 gadi atpakaļ | |
requirements.txt | 10 gadi atpakaļ | |
setup.sh | 10 gadi atpakaļ | |
stats.py | 11 gadi atpakaļ | |
util.py | 10 gadi atpakaļ | |
version.py | 10 gadi atpakaļ | |
webwriter.py | 10 gadi atpakaļ |
he is modular, extensible, multi-threaded, and configurable.
pybot runs on python 2.6 and 2.7 (though steamapi does not work with 2.6, the core bot does). python versions > 3 are in the works.
sudo ./bootstrap.sh
to install pybot dependencies such as mysql../setup.sh
. It will check for module dependencies and create a mysql_init file../bot.py pybotrc
rejoice.
for debugging purposes, ./bot.py -d.
If you have Vagrant locally installed and configured, you can set up pybot by invoking
vagrant up
. Your development environment will be configured, and you can skip step 1 and
2 above. After that, SSH into your VM and do steps 3 through 5 to finish things off.
pybot requires mysqldb. It's probably in your package manager. It will run without it, it'll just throw lots of exceptions. SQLite integration and no-db (pickle) support are in the works.
Run ./bootstrap.sh
and wait for your system to be configured. Mysql will be installed with a
default password of 'root', which you'll definitely want to change.
Run ./setup.sh
and follow the prompts. It will create a mysql_init file, which you can then
run against mysql with mysql -p < mysql_init
. This will create your database and add a user
with full privileges on that database. Your bot will run as this user.
Put that information into the pybotrc.
If you do not run ./setup.sh
you will have to perform the step below.
Add a mysql user for pybot with permissions to update, insert, and delete from the created tables.
Logged into mysql: grant all on <dbname>.* to '<username>' identified by '<password>';
Run the included mysql_dump file (as root, mysql -p <pybot's database name> < mysql_dump
).
Set his dbpass in the config file (pybotrc) to the password you've given him.
Copy that config file to the home folder of whatever user will be running the bot. (~user/.pybotrc)
As that user, ./bot.py.
Here pybot is connected to two networks at once. They are held entirely separately. Modules loaded on one are independent of modules loaded on another. If one server goes down, the other connections to other networks are unaffected.
This project uses smiley's steamapi for its steam integration, and PRAW (python reddit API wrapper) for the redditinfo module.