Now for some of my cows

/2005/Oct   thoughts, notes and mooo...

<  October 2005  >
SuMoTuWeThFrSa
       1
2 3 4 5 6 7 8
9101112131415
16171819202122
23242526272829
3031     
misc.

Mon, 31 Oct 2005 Explaning REST to his wife   >>

Tomayko's explanation of REST to his wife. Great read!

Sun, 30 Oct 2005 "Modeled in some solid substance" *   >>

A small collection of photo's I took from statues over time.

There're found in Zaltbommel (Netherlands, 1 and 2), Glamondans (France, 3 and 4), Vienna (Austria, 5, 6, 7, 8, 9 and 10) and Goteborg (Sweden, 11, 12 and 13).

* I took the title from the defintion for ``statue`` in the ``The Collaborative International Dictionary of English v.0.48``.

Sun, 30 Oct 2005 Statues   >>

more

Sun, 30 Oct 2005 Restructured text entry parser touch up   >>

Most of the entries I write are usually in so called restructured text (reST for short) format. The rst.py entry parser needed a little touch up though.

First of all, there's the conflict between Pyblosxom's idea of an entry's title and that of the reST parser. Most entry parsers do regard the very first line of the entry to be the title and the rst.py plugin is no different.

ReST though, has an idea of a document title too, where a section start, immediately followed by another section start, and marked with a unique pattern, is regarded as the document's title. And this gets rendered regardless as a <h1> element.

Second detail is the starting heading level for the section titles. This starts at <h1> for the highest-level section title in the document. This can be a bit troublesome when this document is rendered in the context of other content that may have higher-level headings in use already.

For both situation, the underlying reST parser can be supplied with overriding settings. I have modified the rst.py plugin to recognize two configuration options and pass these on to the actual reST parser. The first to disable the promotion of the uniquely marked section title to always be the document's title, rendered as <h1>. A second to start rendering headings from a level other than 1.

Patch submitted, accepted and applied. Isn't working with a motivated and friendly open source community just great!

ps. I realize I could even introduce a third option, that would allow to take the document title in reST-terms as the entry title too. Thus, not just taking the very first line for the title.

Thu, 20 Oct 2005 Badkamerraampjes (nl)   >>

Het is zover! Na letterlijk maanden, stapje voor stapje, gezaagd, geschuurd, gefreesd en gebeiteld te hebben aan compleet nieuwe raampjes voor in de badkamer, zitten ze er dan nu daadwerkelijk in!

Goed, de boel moet nog een keer netjes afgelakt worden, maar we zitten in elk geval niet meer met onze blote billen in de kou tijdens het douchen - de laatste twee weken zaten ook de oude raampjes er niet meer in, om zo het kozijn te kunnen renoveren.

En het mooie, ijzeren anti-inbraak traliewerk tocht toch nog best aardig ;)

Vandaag het dubbelglas in de raampjes geplaatst. Dat bleek een leuk, maar zeker wel secuur klusje. Eerst de boel goed ontvet. Daarna kon er een zelfklevende schuimrubberen (nou ja, zoiets) band in de sponning geplakt worden. Ook op de glaslatten - die natuurlijk netjes in verstek gezaagd moesten worden - kwam zo'n stukje band.

Rondom de met het glas meegeleverde afstandhoudertjes tussen glas een sponning geprutst. Zo blijft het glas op zijn plek zitten, maar heeft het toch wat speling om te kunnen krimpen en uitzetten.

Bij mijn favoriete ijzerwarenzaak een handje vol roestvrij spijkertjes "met een verloren kop" gekocht. En daarmee de glaslatten netjes op hun plek vast getimmerd.

En ja, dat zonder vakkundig door het glas heen te slaan.

Sandra heeft via haar favoriet twee bijzonder mooie raamkrukjes op de kop getikt. En daarvoor had dan Kruis weer mooi vernikkelde schroefjes -vinden ze leuk daar, als je laat zien waarvoor het is, dan denken ze mee over de oplossing. Probeer zulke service (en materialen) maar eens bij de doorsnee bouwmarkt te vinden!

Maar ja, "elk voordeel heb zun nadeel": het contrast tussen de mooie nieuwe raampjes en de rest van de badkamer die min of meer in puin ligt, is nu wel pijnlijk groot...

Wed, 19 Oct 2005 Its official now!   >>

Portico has just been added to the Pyblosxom plugin registry!

Frankly, I'm quite fond of that. This is my first 'publically available' and released - albeit small - piece of software. Out of the number of attempts to write something useful (anyone say Foobees? :) I got Portico in a usable and documented state.

Plans for the near future:

  • Follow Walco's suggestion and introduce the concept of a configurable URL mapper. This could be used to map the URL pointing to an image to the URL of the thumbnail or resized version of it.
  • Do something with EXIF metadata.
  • Write some smaller tools for generating the .port files. This is probably connected to the second bullet point.
  • Finish up and release (in some way) the exifarchiver tool. And there's probably a way to integrate that with the previous point.

Tue, 11 Oct 2005 Preserving modification times (2)   >>

Small modification to the mtime preserving script:

1 #! /bin/bash
2
3 EDITOR=$1
4 FILE=$2
5 MTIME=`date -r $FILE +%Y%m%d%H%M.%S`
6 $EDITOR $FILE
7 touch -t $MTIME $FILE

In the original version I accidentally used %e for the day of the month timestamp. However, this was a blank padded number, which, if the day of the month is earlier than the 10th, touch does not recognize.

It should be %d.

Duh.

Mon, 10 Oct 2005 Portico readme   >>

Portico, a Pyblosxom plugin for entry based photo galleries

Portico is a Pyblosxom entry parser plugin for displaying small to medium size photo galleries as a single blog entry. Portico blog entries are displayed in three different ways, depending on the context:

  1. Displaying short series of thumbnails, whenever the entry is not individually rendered at its permanent URL (e.g. on the front page of your blog, amongst other entries).
  2. Displaying all the thumbnails for the collection, whenever the entry is rendered at its permanent URL.
  3. Slideshow-like, displaying a larger version of the photo, possibly including 'next' and 'previous' links to navigate though all the previews of the collection.

It parses and renders blog entries that have a .port file extension. The Portico blog entry file format is different from most other Pyblosxom entry types in that it follows the simple '.ini' style syntax.

Each entry file is required to have one section called entry, with one required 'option', called title. Example:

[entry]
title: A small photographic report on my visit to Timbooktoo

The entry section recognizes two other options: thumbnails and cherries. The first depicts the number of thumbnails to display whenever the entry is not rendered at its permanent URL. The cherries option allows to specify what thumbnails to show in a space seperated list of thumbnail numbers.

Every image in the gallery has its own section in the file. Each of these sections requires two 'options', image and thumbnail. Example:

[photo_1]
image: http://foo.bar.com/path/to/image.jpg
thumbnail: http://foo.bar.com/path/to/thumbnail.jpg

The displayed images are sorted on the section's title. At the current stage, the section's title is not displayed. This may change. See also TODO.txt

Portico will not create thumbnails nor preview nor resized versions of the photos for you. At least not this moment. Who knows.. maybe it will at a later stage.

Portico is at an early stage of development. It most probably still contains bug here and there and its functionality might not suite anyone at all. Feel free to send questions, ideas, patches or any other feedback to jw at n--tree dot net.

How should it be used?

There're at least two ways to install the Portico plugin:

  1. Copy (or link) the portico.py module in the plugins directory of your Pyblosxom installation
  2. adjust the py['plugins_dir'] configuration option in the config.py file of your Pyblosom installation to include the directory containing the portico.py module.

If you're using the py['load_plugins'] configuration option, you probably know that in order for the Portico plugin to be usable, it needs to be listed there.

After installation, you can start to write blog entries with the .port file extension. Apart from being photo galleries and the specific file format used, Portico entries behave like any other blog entry type.

What configuration options are available?

There're currently six configuration options recognised by the plugin:

py['portico_thumbs']
To set the number of thumbnails display, whenever the entry is not rendered at ot permanent URL. This number will be overrided whenever an individual entry has the thumbnails or cherries metadata field set.
py['portico_single_image_template']
The template used for rendering one individual image. The following four variables are recognized for interpolation: prevlink (the URL to the previous image in the gallery, or an empty string if we're at the the first), nextlink (the URL to the next image in the gallery or an empty string if we're at the last), backlink (the permanent URL of the entry) and imagesrc (the URL for the image being displayed).
py[''portico_gallery_main_template']
The template used to render the entry displaying the thumbnails in the gallery. There's two variables that are used for interpolation: thumbnails, used to interpolate the sequence of thumbnails and morelink that is interpolated with the result of the portico_more_thumbnail template.
py['portico_more_template']
The template used for the more link. There's one variable used for interpolation: morelink, which is the permanent URL for the gallery entry.
py['portico_thumbnail_template']
The template used for rendering one thumbnail (and thus is repeated for each of the thumbnails in the sequence). There's two variables used: singleimagelink and imagesrc. The former is the URL that will render the single resized image. The latter is the URL for the thumbnail.
py['portico_url_mapper']
Either an (importable) name or the factory function for a URL mapper.

The optional, pluggable URL mappers are used to determine the URL to the thumbnails and resized versions of the images referenced in the .port file. If there's a mapper configured, the thumbnail key in the image sections in the .port file is ignored. Instead, the image key is used and passed as an argument to the thumbnail() and image() methods of the URL mapper. These methods should return a URL.

The portico.py plugin module contains an example of a simple mapper implementation. The image() method will just return the URL unmodified. The thumbnail() method will replace any occurence of resized in the URL with thumbnails. This mapper is compatible with the galleries generated by the gallery2.py script.

What could it look like?

You can see Portico in action in the author's blog.

See also:

  • The portico.py python module. It contains some smaller explanations and of course the plugin source code itself.
  • For the latest development version, check the Subversion repository.

Mon, 10 Oct 2005 Portico todo list   >>

Portico, a Pyblosxom plugin for entry based photo galleries.

TODO items

Soon

  • Display more information/metadata about images.

A bit later

  • Extend number of recognized options for the entry section and image sections. E.g. certain EXIF tags or DC like metadata.
  • Allow sorting of the gallery images based on other elements than the section's title.
  • Small toolset to generate entry files.

Sometime, if ever

  • Render thumbnails and preview versions of the images files on the fly.

Mon, 10 Oct 2005 Portico sees the light of the day!   >>

The photo-gallery-blog-entries plugin for my Pyblosxom blog is somewhat complete! I found a nice name - Portico - and wrote some documentation for it.

Now for releasing it to the world of Pyblosxom plugins!

There's still lots of possible features to implement.

And I shouldn't forget to mention Walco and thank him for testing the various stages of development.

Mon, 10 Oct 2005 Portico file format   >>

The contents of the entry file for the test gallery looks like this:

[entry]
title: Test gallery

[dsc_3655]
thumbnail: http://jw.n--tree.net/galleries/vienna/thumbnails/DSC_3655.JPG
image: http://jw.n--tree.net/galleries/vienna/resized/DSC_3655.JPG

[dsc_3661]
thumbnail: http://jw.n--tree.net/galleries/vienna/thumbnails/DSC_3661.JPG
image: http://jw.n--tree.net/galleries/vienna/resized/DSC_3661.JPG

[dsc_3664]
thumbnail: http://jw.n--tree.net/galleries/vienna/thumbnails/DSC_3664.JPG
image: http://jw.n--tree.net/galleries/vienna/resized/DSC_3664.JPG

[dsc_3665]
thumbnail: http://jw.n--tree.net/galleries/vienna/thumbnails/DSC_3665.JPG
image: http://jw.n--tree.net/galleries/vienna/resized/DSC_3665.JPG

[dsc_3672]
thumbnail: http://jw.n--tree.net/galleries/vienna/thumbnails/DSC_3672.JPG
image: http://jw.n--tree.net/galleries/vienna/resized/DSC_3672.JPG

[dsc_3674]
thumbnail: http://jw.n--tree.net/galleries/vienna/thumbnails/DSC_3674.JPG
image: http://jw.n--tree.net/galleries/vienna/resized/DSC_3674.JPG

[dsc_3675]
thumbnail: http://jw.n--tree.net/galleries/vienna/thumbnails/DSC_3675.JPG
image: http://jw.n--tree.net/galleries/vienna/resized/DSC_3675.JPG

Mon, 10 Oct 2005 Test gallery   >>

more