Document more things, finalize docs file structure

This commit is contained in:
dave 2014-10-02 14:48:59 -07:00
parent 41eb244d25
commit f9581e207e
15 changed files with 104 additions and 7 deletions

10
docs/api/modulebase.rst Normal file
View File

@ -0,0 +1,10 @@
:mod:`ModuleBase` --- Main class of the bot
=========================================
yabba blahblah blahblah
.. automodule:: core.modulebase
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
:mod:`Error` --- A module to cause an error
===========================================
yabba blahblah blahblah
.. automodule:: modules.Error
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
:mod:`Scramble` --- Module to provide a word scramble game
=========================================================
yabba blahblah blahblah
.. automodule:: modules.Scramble
:members:
:undoc-members:
:show-inheritance:

View File

@ -7,3 +7,4 @@ yabba blahblah blahblah
:members:
:undoc-members:
:show-inheritance:

9
docs/api/rpc.rst Normal file
View File

@ -0,0 +1,9 @@
:mod:`BotRPC` --- Main class of the bot
=========================================
yabba blahblah blahblah
.. automodule:: core.rpc
:members:
:undoc-members:
:show-inheritance:

View File

@ -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.

View File

@ -18,7 +18,6 @@ Contents:
modules/_modules.rst
rpc/_rpc.rst
dev/_dev.rst
#PyIRCBot.rst
More Information
================

View File

@ -1,4 +1,12 @@
Included Modules
================
TODO: Document included modules
PyIRCBot includes several modules to add basic functionality to your bot.
Contents:
.. toctree::
:maxdepth: 8
:glob:
../api/modules/*

View File

@ -0,0 +1,11 @@
"""
.. module:: Core
:synopsis: Core module of the bot
.. moduleauthor:: Dave Pedu <dave@davepedu.com>
.. automodule:: core.pyircbot
.. automodule:: core.rpc
"""

View File

@ -1,4 +1,10 @@
#!/usr/bin/env python
"""
.. module:: ModuleBase
:synopsis: Base class that modules will extend
.. moduleauthor:: Dave Pedu <dave@davepedu.com>
"""
import logging
import os

View File

@ -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)

View File

@ -1,4 +1,11 @@
#!/usr/bin/env python
"""
.. module:: BotRPC
:synopsis: RPC server
.. moduleauthor:: Dave Pedu <dave@davepedu.com>
"""
import traceback
import logging
from core import jsonrpc

View File

@ -1,3 +1,11 @@
"""
.. module:: Error
:synopsis: Module to deliberately cause an error for testing handling.
.. moduleauthor:: Dave Pedu <dave@davepedu.com>
"""
#!/usr/bin/env python
from modulebase import ModuleBase,ModuleHook

View File

@ -1,4 +1,11 @@
#!/usr/bin/env python
"""
.. module:: Scramble
:synopsis: Module to provide a word scramble game
.. moduleauthor:: Dave Pedu <dave@davepedu.com>
"""
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:

View File

@ -0,0 +1,7 @@
"""
.. module:: Modules
:synopsis: Module containing the bot's modules
.. moduleauthor:: Dave Pedu <dave@davepedu.com>
"""