Adjusted the code that parses blog.ini values so that it can take values like:
foo = 'a' # string
foo = "a" # string
foo = 23 # integer
foo = [ "a", 23, "b" ] # list of strings and integers
as well as:
foo = a # string
Note: if you want the string “23”, then you MUST enclose it in quotes, otherwise it will be parsed as an integer.
blog.ini is used when you set up PyBlosxom using Paste.
Fixed PyBlosxomWSGIApp so that it’s WSGI compliant as an application. Thanks Michael!
Template variables can be parenthesized. Examples:
$foo - variable is "foo"
$(foo) - variable is "foo"
$(url)index.atom - variable is "url"
This reduces ambiguity which was causing problems with recognition of variables.
1. Lots of code clean-up, documentation, test-code, and some refactoring.
cb_filestat will only do an os.stat if no plugin handles the filestat. Previously, cb_filestat did an os.stat and ran through all the plugins allowing them to over-ride it.
Added some testing framework pieces. This requires nose. To run the tests, do:
nosetests --verbose --include unit
nosetests --verbose --include functional
We added a blog_rights property. This holds a textual description of the rights you give to others who read your blog. Leaving this blank or not filling it in will affect the RSS 2.0 and Atom 1.0 feeds.
If you set flavourdir``in your config.py file, you have to put your flavour files in that directory tree. If you don't set ``flavourdir, then PyBlosxom expects to find your flavour files in your datadir.
The flavour overhaul is backwards compatible with previous PyBlosxom versions. So if you want to upgrade your blog, but don’t want to move your flavour files to a new directory, DON’T set your flavourdir property.
Moved the content that was in README to CHANGELOG.
You can now organize the directory hierarchy of your blog by date. For example, you could create a category for each year and put posts for that year in that year (2003, 2004, 2005, ...). Previously URLs requesting “2003”, “2004”, ... would get parsed as dates and would pull blog entries by mtime and not by category.
Logging works now. The following configuration properties are useful for determining whether events in PyBlosxom are logged and what will get logged:
It’s likely you’ll want to set log_file and log_level and that’s it. Omit log_file and logging will fall back to stderr which usually gets logged to your web server’s error log.
We added a blog_email item to config.py and changed blog_author to just the author’s name. Examples:
py[“blog_email”] = “joe@blah.com” py[“blog_author”] = “Joe Man”
We no longer adjust blog_title from what you set in config.py. Now we have a blog_title_with_path variable which is in the data dict which is the blog_title with the path information. People who want the title of their blog to be the title and not include the path should use $blog_title. Folks who want the old behavior where the path was appended to the title should use $blog_title_with_path .
We now support WSGI, mod_python, and Twisted in addition to CGI.
Upped our Python requirement to Python 2.2. If you have an earlier version than that, you won’t be able to use PyBlosxom 1.2.
Changed defaultFlavour to default_flavour. This property allows you to specify the flavour to use by default if the URI doesn’t specify one. It default to html.
We moved the main PyBlosxom site to http://pyblosxom.sourceforge.net/ . There’s a “powered by pyblosxom” image at http://pyblosxom.sourceforge.net/images/pb_pyblosxom.gif
You should adjust your templates accordingly.
We now have a Request and a Response object. See API documentation for more details.
Don’t use os.environ directly—use the http dict. For example, this is bad:
path_info = os.environ["HTTP_PATHINFO"]
This is what you should be doing:
http = request.getHttp()
path_info = http["HTTP_PATHINFO"]
If you use os.environ directly, it’s likely your plugin won’t work with non-CGI installations of PyBlosxom.
We added __iter__, read, readline, readlines, seek, and tell to the Request object. All of them access the input stream. You should not use sys.stdin directly.
Usage:
data = request.read()
data_part = request.read(1024)
one_line = request.readline()
lines = request.readlines()
The output stream should be accessed through the PyBlosxom Response object. The following methods are implemented in the Response object: __iter__, close, flush, read, readline, readlines, seek, tell, write, writelines, setStatus, and addHeader. You should not use sys.stdout directly. See the API for more details.
Usage:
response = request.getResponse()
response.addHeader('Status', '200 Ok')
response.addHeader('Content-type', 'text/html')
response.write("Hello World")
response.writelines(["list", "of", "data"])
Instead of doing:
form = request.getHttp()["form"]
you can now do:
form = request.getForm()
Plugins should not be importing the config module and looking at the py dict directly. You should instead use the Request getConfiguration() method to get the config py dict.
We ditched blosxom_custom_flavours—you can remove it from your config.py file.
We added static rendering—see the howto in the PyBlosxom manual.
Rewrote comments to use the new handler system. You should replace the comments, pingbacks, trackbacks, and other comments-oriented plugins with the new versions from contrib/plugins/comments/.
pingbacks plugin is now xmlrpc_pingbacks.py .
Adjusted the default templates for HTML and RSS. Removed all other default templates. Look at the flavour_examples directory for flavour examples.
Added an ignore_properties property to config.py which allows you to specify which directories in your datadir should be ignored. For example:
py["ignore_directories"] = ["CVS", ".svn"]
Added a template variable pyblosxom_version which points to pyblosxom/Pyblosxom/pyblosxom.VERSION_DATE .
Fixed some code in pyarchives so it worked with Python 2.1. Thanks to Wilhelm.
Fixed template retrieving code so that you can specify templates to use for a given category or parent categories. Thanks to Nathan for fixing this.
We added a logdir property to config. PyBlosxom (and plugins) will create logs in this directory so the directory has to have write access for whatever user the webserver uses to run the script.