[PhotoFloat] my pet peeves

Antoine Beaupré anarcat at orangeseeds.org
Thu Oct 17 15:41:08 CEST 2013


On 2013-10-17 07:39:02, Joachim Tingvold wrote:
> Hi,
>
> (Sorry for breaking the thread -- I'm replying to an email sent to the 
> list before I joined it, so I had to copy-paste stuff from the archive 
> (-: ).
>
> On Sat Jun 1, at 16:57:31 CEST, Antoine Beaupré wrote:
>> Another is packaging: I am a Debian member and would love to ship
>> photofloat in Debian! There are a few things to do for this to work, 
>> see
>> http://bugs.debian.org/694259 for details. A short summary, this
>> includes:
>> […]
>> * multiple gallery support
>
> I achieved this simply by using symlinks. If you also want to have 
> different <title> for each page, you just have hard-copies of index.html 
> for each gallery.

Here too, as detailed in http://bugs.debian.org/694259

To quote that:

On 2013-06-02 22:49:07, Antoine Beaupré wrote:
> I also *think* it supports multiple galleries. The shared code is stored
> in /usr/share/photofloat, so to create a new gallery symlink needs to be
> used, for example, to create my gallery, I did:
>
>     mkdir /var/www/photofloat
>     cd !$
>     ln -s /usr/share/photofloat/web/*
>     mkdir albums cache
>
> Then I can go into /var/www/photofloat and run photofloat as normal.
>
> Things would be much simpler if:
>
>  1. I could pass only the /var/www/photofloat directory to main.py
>  2. if main.py would then create albums/ and cache/ automatically for me
>  3. if main.py would setup those symlinks automatically
>  4. the albums and cache directories would be one level up
>  (so that only one symlink would be required, or an Apache Alias directive)
>
> To make things real clear, here's the current hierarchy for a gallery:
>
> $ cd /var/www/photofloat
> $ ls -Rl
> .:
> total 4K
> drwxr-xr-x 4 anarcat anarcat 4096 juin   2 22:18 web
>
> ./web:
> total 76K
> drwxr-xr-x 9 anarcat anarcat  4096 mai    5 23:46 albums
> drwxr-xr-x 2 anarcat anarcat 73728 juin   2 22:25 cache
> lrwxrwxrwx 1 anarcat anarcat    29 juin   2 22:04 css -> /usr/share/photofloat/web/css
> lrwxrwxrwx 1 anarcat anarcat    31 juin   2 22:04 fonts -> /usr/share/photofloat/web/fonts
> lrwxrwxrwx 1 anarcat anarcat    29 juin   2 22:04 img -> /usr/share/photofloat/web/img
> lrwxrwxrwx 1 anarcat anarcat    36 juin   2 22:04 index.html -> /usr/share/photofloat/web/index.html
> lrwxrwxrwx 1 anarcat anarcat    28 juin   2 22:04 js -> /usr/share/photofloat/web/js
> lrwxrwxrwx 1 anarcat anarcat    38 juin   2 22:04 redirect.php -> /usr/share/photofloat/web/redirect.php
> lrwxrwxrwx 1 anarcat anarcat    42 juin   2 22:04 staticrender.php -> /usr/share/photofloat/web/staticrender.php
>
> albums/ and cache/ are what you expect, and are removed from the output
> for brievety.
>
> I am not so happy with the "symlink forest" approach, but at least it
> works. The #4 mentionned above would mostly fix that, and then the
> directory structure would look like:
>
> $ cd /var/www/photofloat
> $ ls -Rl
> .:
> total 4K
> drwxr-xr-x 9 anarcat anarcat  4096 mai    5 23:46 albums
> drwxr-xr-x 2 anarcat anarcat 73728 juin   2 22:25 cache
> drwxr-xr-x 4 anarcat anarcat  4096 juin   2 22:18 web -> /usr/share/photofloat/web
>
> Here we would only have to symlink the web/ directory instead of
> symlinking all the contents. Of course, it's tricky because the
> index.html needs to be installed somewhere, so maybe a compromise would
> be this:
>
> $ cd /var/www/photofloat
> $ ls -Rl
> .:
> total 4K
> drwxr-xr-x 9 anarcat anarcat  4096 mai    5 23:46 albums
> drwxr-xr-x 2 anarcat anarcat 73728 juin   2 22:25 cache
> drwxr-xr-x 4 anarcat anarcat  4096 juin   2 22:18 index.html -> /usr/share/photofloat/index.html
> drwxr-xr-x 4 anarcat anarcat  4096 juin   2 22:18 web -> /usr/share/photofloat/web

So there could be some improvements upstream in photofloat to make that
easier.

> Probably not the most elegant solution, but since the logic of the 
> gallery already is simple (based on files in folders, and no complex 
> configuration files), I guess this is a viable solution (unless you plan 
> to have shitloads of galleries (-:).

It is, and it works, but really - it's a hack and not so pretty. I would
rather have only two symlinks.

A.

-- 
Si l'image donne l'illusion de savoir
C'est que l'adage pretend que pour croire,
L'important ne serait que de voir
                        - Lofofora
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/photofloat/attachments/20131017/71e3be2f/attachment.asc>


More information about the PhotoFloat mailing list