Re: change history plugin

Ryan Barrett <pyblosxom-6sb6M7qyT/[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
hi pyblosxom-devel. while i was writing the change history plugin, i ran into
a few of pyblosxom's rough edges. i figured i'd mention them here, along with
possible solutions, in the hopes that we might eventually smooth them out.

1) the docs and manual make entries sound equal opportunity. as long as you
subclass EntryBase or use generate_entry, you can return your own entries from
e.g. cb_filelist and pyblosxom will do the right thing.

i found this to be somewhat true. however, some of the code, templates, and
plugins (e.g. comments) assume FileEntry. for example, the fn, filename,
file_path, and title data dict members are expected in many places. i had to
populate these when generating my own entries to appease pyblosxom.

i see a couple approaches. we could either promote those to EntryBase,
possibly change their names (ugh, not backwards compatible), and document
them. or we could just bite the bullet and cement the FileEntry req't.

to be fair, this is pretty minor.

2) there's no good way to run the entry parser on custom data.
blosxom_entry_parser is hard-coded to take a filename and read it from disk
before it parses it. i had to copy and paste those 50 lines of code from
pyblosxom.py so that i could preformat, run the entry parser, and postformat
data i'd pulled from version control. :/

this might be as easy as modifying blosxom_entry_parser to take a string, and
reading the file before it's called (on pyblosxom.py:62, in 1.3.2).

that code does imply a bias that all entries are on disk, though, which ties
back to #1. if tools like the renderer and (hopefully soon) the entry parser
can be given arbitrary data, though, that might not be a big problem.


On Sat, 16 Sep 2006, Ryan Barrett wrote:

> hi all! i've just finished a pyblosxom change history plugin. if your entries
> are kept in a version control system, database, or any other source that
> tracks changes, you can use this plugin to show changes over time, past
> versions, and diffs between any two versions.
>
> http://snarfed.org/space/pyblosxom+history
>
> a picture is worth a thousand words, so here's a quick example:
>
> http://snarfed.org/space/pyblosxom+ajax+comments?history=1
>
> right now it only support subversion, but the backend code is abstracted out,
> so adding new backends should be pretty straightforward.
>
> i've cc'ed christopher baus and lennart poettering, since they worked on
> another plugin that pulls mtimes from subversion.
>
> -Ryan
>
> --
> http://snarfed.org/
>

-Ryan

--
http://snarfed.org/

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.