Convert to python module

This commit is contained in:
dpedu 2015-06-18 19:29:46 -07:00
parent 99479e193c
commit b7eacbfc22
34 changed files with 36 additions and 13 deletions

5
.gitignore vendored
View File

@ -2,4 +2,7 @@ libs
*__pycache__* *__pycache__*
docs/_build docs/_build
.DS_Store .DS_Store
botenv botenv
dist
build
pyircbot.egg-info

View File

@ -4,7 +4,8 @@ import sys
import logging import logging
import yaml import yaml
from optparse import OptionParser from optparse import OptionParser
from core.pyircbot import PyIRCBot from pyircbot import PyIRCBot
if __name__ == "__main__": if __name__ == "__main__":
" logging level and facility " " logging level and facility "

View File

@ -1,8 +1,9 @@
user: user:
nick: nick:
- pyircbot3 - dave
- pyircbot3_ - dave_
- pyircbot3__ - dave__
- dave___
password: nickservpassword password: nickservpassword
username: pyircbot3 username: pyircbot3
hostname: pyircbot3.domain.com hostname: pyircbot3.domain.com
@ -15,7 +16,7 @@ ident:
ghost_to: nickserv ghost_to: nickserv
ghost_cmd: ghost %(nick)s %(password)s ghost_cmd: ghost %(nick)s %(password)s
channels: channels:
- "#xmopx" - "#dave2"
privatechannels: privatechannels:
to: chanserv to: chanserv
command: invite %(channel)s command: invite %(channel)s

2
examples/run-example.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
../bin/pyircbot -c config.main.yml -b config.instance.yml

View File

@ -9,3 +9,8 @@
.. automodule:: core.rpc .. automodule:: core.rpc
""" """
__all__ = ["PyIRCBot"]
from pyircbot.pyircbot import PyIRCBot
from pyircbot.irccore import IRCCore

View File

@ -7,7 +7,7 @@
""" """
from modulebase import ModuleBase,ModuleHook from pyircbot.modulebase import ModuleBase,ModuleHook
class PingResponder(ModuleBase): class PingResponder(ModuleBase):
def __init__(self, bot, moduleName): def __init__(self, bot, moduleName):

2
pyircbot/modules/Services.py Normal file → Executable file
View File

@ -7,7 +7,7 @@
""" """
from modulebase import ModuleBase,ModuleHook from pyircbot.modulebase import ModuleBase,ModuleHook
from time import sleep from time import sleep
class Services(ModuleBase): class Services(ModuleBase):

View File

@ -9,8 +9,9 @@
import logging import logging
import time import time
import sys import sys
from core.rpc import BotRPC from pyircbot.rpc import BotRPC
from core.irccore import IRCCore from pyircbot.irccore import IRCCore
from pyircbot import modulebase
import os.path import os.path
class PyIRCBot: class PyIRCBot:

View File

@ -8,7 +8,7 @@
import traceback import traceback
import logging import logging
from core import jsonrpc from pyircbot import jsonrpc
from threading import Thread from threading import Thread
class BotRPC(Thread): class BotRPC(Thread):

View File

@ -1,2 +0,0 @@
#!/bin/sh
./pyircbot/main.py -c config.main.yml -b config.instance.yml

12
setup.py Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env python3
from setuptools import setup
setup(name='pyircbot',
version='4.0.0aa',
description='A modular python irc bot',
url='http://gitlab.xmopx.net/dave/pyircbot3/tree/master',
author='dpedu',
author_email='dave@davepedu.com',
packages=['pyircbot'],
scripts=['bin/pyircbot'],
zip_safe=False)