2
This is my fancy module to add a token which tells us whether we're
3
the first day being displayed or not.
6
1. Copy this file into your pyblosxom/libs/plugins directory.
8
2. Create a file named date_head.html in your datadir containing::
10
<div class="$dayDivClass">
11
<span class="blosxomDate">$date</span>
13
3. Edit your config.py and add the line::
15
py['firstDayDiv'] = 'blosxomFirstDayDiv'
17
4. That's it. You're done.
19
Questions, comments, concerns? Email bwinton@latte.ca for help.
21
__author__ = "Blake Winton - bwinton@latte.ca"
22
__version__ = "$Id: firstdaydiv.py,v 1.9 2003/04/01 08:52:37 wari Exp $"
27
This class stores the state needed to determine whether we're
28
supposed to return the first-day-div class or the
29
not-the-first-day-div class.
32
@ivar _dayDiv: The davDiv class to return.
34
@ivar _count: The number of times we've been called (currently 0 or 1)
36
def __init__(self, request):
38
Initialize the PyFirstDate class.
40
@type request: L{libs.Request.Request} object
41
@param request: A reference to the L{libs.Request.Request} object.
43
config = request.getConfiguration()
44
self._dayDiv = config.get("firstDayDiv", "blosxomDayDiv")
49
Get a string representing the current state of this
53
@return: the user-specified firstDayDiv if it's the first
54
time we're called, or "blosxomDayDiv" if it's not.
59
self._dayDiv = "blosxomDayDiv"
64
Populate the L{libs.Request.Request} with an instance of the
65
L{PyFirstDate} class in the "dayDivClass" key.
67
request = args["request"]
69
data = request.getData()
70
data["dayDivClass"] = PyFirstDate(request)