diff --git a/docs/api/modulebase.rst b/docs/api/modulebase.rst new file mode 100644 index 0000000..74d3289 --- /dev/null +++ b/docs/api/modulebase.rst @@ -0,0 +1,10 @@ +:mod:`ModuleBase` --- Main class of the bot +========================================= + +yabba blahblah blahblah + +.. automodule:: core.modulebase + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/api/modules/error.rst b/docs/api/modules/error.rst new file mode 100644 index 0000000..4b3e3b2 --- /dev/null +++ b/docs/api/modules/error.rst @@ -0,0 +1,9 @@ +:mod:`Error` --- A module to cause an error +=========================================== + +yabba blahblah blahblah + +.. automodule:: modules.Error + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/modules/scramble.rst b/docs/api/modules/scramble.rst new file mode 100644 index 0000000..36d633f --- /dev/null +++ b/docs/api/modules/scramble.rst @@ -0,0 +1,9 @@ +:mod:`Scramble` --- Module to provide a word scramble game +========================================================= + +yabba blahblah blahblah + +.. automodule:: modules.Scramble + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/PyIRCBot.rst b/docs/api/pyircbot.rst similarity index 99% rename from docs/PyIRCBot.rst rename to docs/api/pyircbot.rst index 97e99e2..e6196a4 100644 --- a/docs/PyIRCBot.rst +++ b/docs/api/pyircbot.rst @@ -7,3 +7,4 @@ yabba blahblah blahblah :members: :undoc-members: :show-inheritance: + diff --git a/docs/api/rpc.rst b/docs/api/rpc.rst new file mode 100644 index 0000000..d19a9a9 --- /dev/null +++ b/docs/api/rpc.rst @@ -0,0 +1,9 @@ +:mod:`BotRPC` --- Main class of the bot +========================================= + +yabba blahblah blahblah + +.. automodule:: core.rpc + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/conf.py b/docs/conf.py index 17d70bf..cbfa3df 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,6 +22,9 @@ import os #sys.path.insert(0, os.path.abspath('.')) sys.path.insert(0, os.path.abspath('../pyircbot/')) +sys.path.append(os.path.abspath('../pyircbot/core/')) +sys.path.append(os.path.abspath('../pyircbot/modules/')) + # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -60,7 +63,8 @@ copyright = '2014, dpedu' # The short X.Y version. version = '3.4' # The full version, including alpha/beta/rc tags. -release = '1.0a1' +import pyircbot +release = pyircbot.PyIRCBot.version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/index.rst b/docs/index.rst index 3308643..b8627ce 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,7 +18,6 @@ Contents: modules/_modules.rst rpc/_rpc.rst dev/_dev.rst - #PyIRCBot.rst More Information ================ diff --git a/docs/modules/_modules.rst b/docs/modules/_modules.rst index 99ded63..ac6a175 100644 --- a/docs/modules/_modules.rst +++ b/docs/modules/_modules.rst @@ -1,4 +1,12 @@ Included Modules ================ -TODO: Document included modules \ No newline at end of file +PyIRCBot includes several modules to add basic functionality to your bot. + +Contents: + +.. toctree:: + :maxdepth: 8 + :glob: + + ../api/modules/* diff --git a/pyircbot/core/__init__.py b/pyircbot/core/__init__.py index e69de29..4bfefa1 100644 --- a/pyircbot/core/__init__.py +++ b/pyircbot/core/__init__.py @@ -0,0 +1,11 @@ +""" +.. module:: Core + :synopsis: Core module of the bot + +.. moduleauthor:: Dave Pedu + +.. automodule:: core.pyircbot + +.. automodule:: core.rpc + +""" diff --git a/pyircbot/core/modulebase.py b/pyircbot/core/modulebase.py index d8f309a..b997f94 100644 --- a/pyircbot/core/modulebase.py +++ b/pyircbot/core/modulebase.py @@ -1,4 +1,10 @@ -#!/usr/bin/env python +""" +.. module:: ModuleBase + :synopsis: Base class that modules will extend + +.. moduleauthor:: Dave Pedu + +""" import logging import os diff --git a/pyircbot/core/pyircbot.py b/pyircbot/core/pyircbot.py index fbb26ba..928aad5 100644 --- a/pyircbot/core/pyircbot.py +++ b/pyircbot/core/pyircbot.py @@ -28,6 +28,8 @@ class PyIRCBot(asynchat.async_chat): :type botconfig: dict """ + version = "1.0a1-git" + def __init__(self, coreconfig, botconfig): asynchat.async_chat.__init__(self) diff --git a/pyircbot/core/rpc.py b/pyircbot/core/rpc.py index 3a6edd1..b64a1c0 100644 --- a/pyircbot/core/rpc.py +++ b/pyircbot/core/rpc.py @@ -1,4 +1,11 @@ -#!/usr/bin/env python +""" +.. module:: BotRPC + :synopsis: RPC server + +.. moduleauthor:: Dave Pedu + +""" + import traceback import logging from core import jsonrpc diff --git a/pyircbot/modules/Error.py b/pyircbot/modules/Error.py index f6c1d60..ee4d1c7 100644 --- a/pyircbot/modules/Error.py +++ b/pyircbot/modules/Error.py @@ -1,3 +1,11 @@ +""" +.. module:: Error + :synopsis: Module to deliberately cause an error for testing handling. + +.. moduleauthor:: Dave Pedu + +""" + #!/usr/bin/env python from modulebase import ModuleBase,ModuleHook diff --git a/pyircbot/modules/Scramble.py b/pyircbot/modules/Scramble.py index d1cfc84..a10e8a6 100644 --- a/pyircbot/modules/Scramble.py +++ b/pyircbot/modules/Scramble.py @@ -1,4 +1,11 @@ -#!/usr/bin/env python +""" +.. module:: Scramble + :synopsis: Module to provide a word scramble game + +.. moduleauthor:: Dave Pedu + +""" + from modulebase import ModuleBase,ModuleHook import random import yaml @@ -16,7 +23,7 @@ class Scramble(ModuleBase): # Dictionary self.wordsCount=0; - self.wordsFile = self.getFilePath("words.txt") + self.wordsFile = self.getFilePath("words.txt") print(self.wordsFile) wordsF = open(self.wordsFile, "r") while True: diff --git a/pyircbot/modules/__init__.py b/pyircbot/modules/__init__.py new file mode 100644 index 0000000..189b536 --- /dev/null +++ b/pyircbot/modules/__init__.py @@ -0,0 +1,7 @@ +""" +.. module:: Modules + :synopsis: Module containing the bot's modules + +.. moduleauthor:: Dave Pedu + +"""