Browse Source

Document more things, finalize docs file structure

dave/xdcc
dave 8 years ago
parent
commit
f9581e207e
  1. 10
      docs/api/modulebase.rst
  2. 9
      docs/api/modules/error.rst
  3. 9
      docs/api/modules/scramble.rst
  4. 1
      docs/api/pyircbot.rst
  5. 9
      docs/api/rpc.rst
  6. 6
      docs/conf.py
  7. 1
      docs/index.rst
  8. 10
      docs/modules/_modules.rst
  9. 11
      pyircbot/core/__init__.py
  10. 8
      pyircbot/core/modulebase.py
  11. 2
      pyircbot/core/pyircbot.py
  12. 9
      pyircbot/core/rpc.py
  13. 8
      pyircbot/modules/Error.py
  14. 11
      pyircbot/modules/Scramble.py
  15. 7
      pyircbot/modules/__init__.py

10
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:

9
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:

9
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:

1
docs/PyIRCBot.rst → docs/api/pyircbot.rst

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

9
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:

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

1
docs/index.rst

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

10
docs/modules/_modules.rst

@ -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/*

11
pyircbot/core/__init__.py

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

8
pyircbot/core/modulebase.py

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

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

9
pyircbot/core/rpc.py

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

8
pyircbot/modules/Error.py

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

11
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 <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:

7
pyircbot/modules/__init__.py

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