Bug#696682: lazygal: fails to correctly process templates in user-defined themes

2013-01-02 Thread Alexandre Rossi
Hi,

 So, in summary, I cannot understand why the small part I added to the
 template file breaks the generated CSS stylesheet.

I can reproduce and this is a bug in genshi as the following code shows.

--
from genshi.template import OldTextTemplate

tmpl = OldTextTemplate('''
\#foo

#if bar
\#baz
#end
''')

print tmpl.generate(bar=True)
--

output :
--

\#foo

\#baz

--

Expected output :
--

#foo

#baz

--

 The lazygal man page refers to
 http://genshi.edgewall.org/wiki/Documentation/text-templates.html
 for the syntax explanation of text templates, but the web page now
 describes a new syntax and only dedicates a few final words to
 the legacy syntax...

Your bug report made me notice the deprecation of the text template
syntax I was using.

The following patch makes lazygal use the new text syntax.
http://sousmonlit.incube.tk/~niol/repositories/lazygal/rev/0ce290707e12

As the old text syntax is deprecated, I think there is no point in
re-assigning this bug to python-genshi. Please do so if you think this
is worth it. Please tell me if this bug report can be closed
otherwise.

Thanks,

Alex


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#696682: lazygal: fails to correctly process templates in user-defined themes

2013-01-02 Thread Francesco Poli
On Wed, 2 Jan 2013 12:18:55 +0100 Alexandre Rossi wrote:

 Hi,

Hello Alexandre,
thanks a lot for you kind reply!

 
  So, in summary, I cannot understand why the small part I added to the
  template file breaks the generated CSS stylesheet.
 
 I can reproduce and this is a bug in genshi
[...]

Good, thanks for testing and reproducing the bug.

 
  The lazygal man page refers to
  http://genshi.edgewall.org/wiki/Documentation/text-templates.html
  for the syntax explanation of text templates, but the web page now
  describes a new syntax and only dedicates a few final words to
  the legacy syntax...
 
 Your bug report made me notice the deprecation of the text template
 syntax I was using.

I am glad that my bug report was at least useful for that.

 
 The following patch makes lazygal use the new text syntax.
 http://sousmonlit.incube.tk/~niol/repositories/lazygal/rev/0ce290707e12
 
 As the old text syntax is deprecated, I think there is no point in
 re-assigning this bug to python-genshi.

I agree.

 Please do so if you think this
 is worth it. Please tell me if this bug report can be closed
 otherwise.

I think that this bug report can be closed, *once* the above mentioned
patch enters Debian, either in a new lazygal version incorporating the
patch, packaged for Debian and uploaded to unstable (or experimental),
or in a new Debian revision (0.7.4-2) incorporating the patch and
uploaded to unstable (or experimental).

All this, assuming that using the new syntax will allow me to apply the
customization I was trying to apply...


Thanks a lot for your time and for this very nice gallery generator
that you develop and release as Free Software!


-- 
 http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt
 New GnuPG key, see the transition document!
. Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE


pgpz72XFaEdZb.pgp
Description: PGP signature


Bug#696682: lazygal: fails to correctly process templates in user-defined themes

2012-12-25 Thread Francesco Poli (wintermute)
Package: lazygal
Version: 0.7.4-1
Severity: normal

Hello,
thanks for maintaining this nice static web photo gallery generator
in Debian!

I am learning how to use lazygal. While experimenting, I wanted to
customize the default theme and I found out something awkward that
really looks like a bug.

The steps to reproduce the issue are:

 0) create a small collection of pictures:

$ tree 
.
└── testpics
└── testalbum
├── dscn1650.jpg
├── dscn1652.jpg
└── dscn1654.jpg

2 directories, 3 files

 1) generate a web gallery with lazygal default theme:

$ lazygal -t default -o testgallery1 testpics
[...]
TPL %SHAREDDIR%/default.css
[...]

 2) now let's try and do the same thing, but with a user-defined
theme that is an exact copy of the default theme:

$ mkdir -p ~/.lazygal/themes/a
$ cp -ai /usr/share/lazygal/themes/default ~/.lazygal/themes/a
$ lazygal -t a/default -o testgallery2 testpics
[...]
TPL %SHAREDDIR%/default.css
[...]
$ diff -ruN testgallery1/shared/ testgallery2/shared/

 3) so far, so good... now let's try and modify the default theme:

$ cd ~/.lazygal/themes/
$ cp -ai a b
$ vim b/default/SHARED_default.tcss
$ diff -ruN a b
diff -ruN a/default/SHARED_default.tcss b/default/SHARED_default.tcss
--- a/default/SHARED_default.tcss   2012-07-16 07:32:55.0 +0200
+++ b/default/SHARED_default.tcss   2012-12-25 18:23:54.0 +0100
@@ -53,6 +53,12 @@
 right:0.1em;
 }
 
+#if imgalign
+\#image_img{
+text-align:${imgalign};
+}
+#end
+
 .inline_enum ul{
 margin-left: 0;
 padding-left: 0;
$ cd -
$ lazygal -t b/default -o testgallery3 testpics
[...]
TPL %SHAREDDIR%/default.css
[...]
$ diff -ruN testgallery2/shared/ testgallery3/shared/
diff -ruN testgallery2/shared/default.css testgallery3/shared/default.css
--- testgallery2/shared/default.css 2012-12-25 18:26:22.0 +0100
+++ testgallery3/shared/default.css 2012-12-25 18:31:41.0 +0100
@@ -21,18 +21,19 @@
 display: none;
 }
 
-#prev_link{
+\#prev_link{
 position:absolute;
 top:50%;
 left:0.1em;
 }
 
-#next_link{
+\#next_link{
 position:absolute;
 top:50%;
 right:0.1em;
 }
 
+
 .inline_enum ul{
 margin-left: 0;
 padding-left: 0;

 4) this is not good, there seems to no longer be a way to obtain a '#'
in the output CSS stylesheet...  let's try to enable the new template
variable:

$ lazygal -t b/default --template-vars='imgalign=center' \
-o testgallery4 testpics
[...]
TPL %SHAREDDIR%/default.css
[...]
$ diff -ruN testgallery3/shared/ testgallery4/shared/
diff -ruN testgallery3/shared/default.css testgallery4/shared/default.css
--- testgallery3/shared/default.css 2012-12-25 18:31:41.0 +0100
+++ testgallery4/shared/default.css 2012-12-25 18:36:30.0 +0100
@@ -33,6 +33,9 @@
 right:0.1em;
 }
 
+\#image_img{
+text-align:center;
+}
 
 .inline_enum ul{
 margin-left: 0;
   
 5) once again, the newly added rule was generated with '\#'
instead of '#'...


So, in summary, I cannot understand why the small part I added to the
template file breaks the generated CSS stylesheet.

The lazygal man page refers to
http://genshi.edgewall.org/wiki/Documentation/text-templates.html
for the syntax explanation of text templates, but the web page now
describes a new syntax and only dedicates a few final words to
the legacy syntax...

What's wrong?
What did I fail to understand?

Please clarify the documentation or fix the bug (if there is actually
a misbehavior) and/or forward my bug report upstream, as appropriate.

Thanks for your time!


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (800, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages lazygal depends on:
ii  python  2.7.3~rc2-1
ii  python-genshi   0.6-3
ii  python-imaging  1.1.7-4
ii  python-pyexiv2  0.3.2-5

lazygal recommends no packages.

Versions of packages lazygal suggests:
ii  gstreamer0.10-plugins-base  0.10.36-1
pn  python-gst0.10  none

-- no debconf information


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org