bulletin
index
/home/thindil/Projekty/anaria/server/lib/pymodules/bulletin.py

# -*- coding: utf-8 -*-
################################################################################
#
# bulletin.py
#
# This module implements a bulletin board system, allowing people to post and
# read messages to various bulletins. This is *not* a substitute for forums. It
# is not nearly as functionally complete as any freely available web-based
# forum. This is meant for posting notes and notices, not for carrying out
# conversations.
#
# contains one command, "bulletin". Syntax is:
#   bulletin
#   bulletin read <board> [article number]
#   bulletin post <board> <title>
#   bulletin delete <board> [article number]
#   bulletin create <board> [groups]
#
Post makes use of a character's notepad, from the editor module.
#
Bulletin requires a minimum of NakedMud v3.5 to work, but should work fine
# with version below with minor alterations.
#
################################################################################

 
Modules
       
auxiliary
char
hooks
mud
storage
string
time

 
Classes
       
Bulletin
Post

 
class Bulletin
    Implements a bulletin board
 
  Methods defined here:
__init__(self, set=None)
Prepares the bulletin board for use
getGroups(self)
returns the groups that have access to this board.
getPosts(self)
returns the posts made on the bulletin.
getRGroups(self)
returns the groups which can read this board.
post(self, ch, title, mssg)
posts a message onto the bulletin board. Each message is a tuple
comprised of the poster's name, the time of posting, the message
title, and the message body.
setGroups(self, groups)
sets the groups that have access to this board.
setRGroups(self, groups)
set the groups which can only read this board.
store(self)
returns a storage set representation of the board

 
class Post
    Implements one bulletin board post
 
  Methods defined here:
__init__(self, name, time, title, mssg, set=None)
Prepares the post for use
getMssg(self)
getPoster(self)
getTime(self)
getTitle(self)
setMssg(self, mssg)
setPoster(self, name)
# various getters and setters for the Post class
setTime(self, time)
setTitle(self, title)
store(self)
returns a storage set representation of the post

 
Functions
       
__unload__()
things that need to be detached when the module is un/reloaded
add_cmd(...)
add_cmd(name, shorthand, cmd_func, user_group, interrupts_action)
 
Add a new command to the master command table. If a preferred shorthand
exists, e.g., 'n' for 'north', it can be specified. Otherwise, shorthand
should be None. Command functions take three arguments: a character
issuing the command, the command name, and a string argument supplied
to the command. Commands must be tied to a specific user group, and they
can optionally interupt character actions.
bulletin_display_hook(info)
displays the bulletin board info to a character when he enters game
cmd_bulletin(ch, cmd, arg)
The entrypoint into the board system. Allows people to view or post
messages to bulletin boards. Admin can create/delete boards or messages.
 
Syntax:
  biuletyn
  biuletyn czytaj <board> [article number]
  biuletyn pisz <board> <title>
  biuletyn kasuj <board> [article number]
  biuletyn stworz <board> [groups]
do_delete(ch, key, arg)
deleted a post from a board, or an entire board
do_list_bulletins(ch)
lists all of the bulletins to a character
do_list_one_bulletin(ch, key)
lists the topics on one bulletin board to a character
do_post(ch, key, arg)
posts a message to a bulletin board
do_read(ch, key, arg)
read a specific messge on a board, or list the board messages
load_bulletins()
save_bulletins()
saves all of the bulletin boards to a file

 
Data
        __bulletin_file__ = '../lib/misc/bulletins'
__bulletins__ = {'admini': <bulletin.Bulletin instance>, 'budowniczy': <bulletin.Bulletin instance>, 'b\xc5\x82\xc4\x99dy': <bulletin.Bulletin instance>, 'liter\xc3\xb3wki': <bulletin.Bulletin instance>, 'pomys\xc5\x82y': <bulletin.Bulletin instance>, 'zmiany': <bulletin.Bulletin instance>}