line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Orze::Drivers::Llgal; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1251
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1021
|
use File::Copy::Recursive qw/dircopy/; |
|
1
|
|
|
|
|
7846
|
|
|
1
|
|
|
|
|
77
|
|
7
|
1
|
|
|
1
|
|
9
|
use Template; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
24
|
|
8
|
1
|
|
|
1
|
|
3854
|
use String::Escape qw/quote/; |
|
1
|
|
|
|
|
6832
|
|
|
1
|
|
|
|
|
120
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
14
|
use base "Orze::Drivers"; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
553
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Orze::Drivers::Llgal - Create a photo gallery using Llgal |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
This driver copies a directory in the C directory and run llgal |
19
|
|
|
|
|
|
|
into it. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 EXAMPLE |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Cool event |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SEE ALSO |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Look at C and L. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 METHODS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Do the real processing |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 process |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub process { |
42
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
my $page = $self->{page}; |
45
|
0
|
|
|
|
|
|
my $variables = $self->{variables}; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
$variables->{root} = "../" . $self->root(); |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
my $path = $page->att('path'); |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
my $name = $page->att('name'); |
52
|
0
|
|
|
|
|
|
$variables->{page} = $name; |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
my $extension = $page->att('extension'); |
55
|
0
|
|
|
|
|
|
$variables->{extension} = $extension; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
$variables->{css} = ".llgal/llgal"; |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
my $title = $variables->{title}; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
my $output = $self->output($name); |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
my $tt = Template->new( |
64
|
|
|
|
|
|
|
RELATIVE => 1, |
65
|
|
|
|
|
|
|
INCLUDE_PATH => [ |
66
|
|
|
|
|
|
|
"includes/Template", |
67
|
|
|
|
|
|
|
"includes/Llgal", |
68
|
|
|
|
|
|
|
"templates/Llgal", |
69
|
|
|
|
|
|
|
], |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
0
|
0
|
|
|
|
|
$tt->process("indextemplate.html", |
73
|
|
|
|
|
|
|
$variables, |
74
|
|
|
|
|
|
|
"tmp/" . $path . $name . "/indextemplate.html", |
75
|
|
|
|
|
|
|
) |
76
|
|
|
|
|
|
|
|| $self->warning($tt->error()); |
77
|
0
|
0
|
|
|
|
|
$tt->process("slidetemplate.html", |
78
|
|
|
|
|
|
|
$variables, |
79
|
|
|
|
|
|
|
"tmp/" . $path . $name . "/slidetemplate.html", |
80
|
|
|
|
|
|
|
) |
81
|
|
|
|
|
|
|
|| $self->warning($tt->error()); |
82
|
0
|
0
|
|
|
|
|
$tt->process("llgal.css", |
83
|
|
|
|
|
|
|
$variables, |
84
|
|
|
|
|
|
|
"tmp/" . $path . $name . "/llgal.css", |
85
|
|
|
|
|
|
|
) |
86
|
|
|
|
|
|
|
|| $self->warning($tt->error()); |
87
|
0
|
0
|
|
|
|
|
$tt->process("llgalrc", |
88
|
|
|
|
|
|
|
$variables, |
89
|
|
|
|
|
|
|
"tmp/" . $path . $name . "/llgalrc", |
90
|
|
|
|
|
|
|
) |
91
|
|
|
|
|
|
|
|| $self->warning($tt->error()); |
92
|
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
my $command = "llgal " |
94
|
|
|
|
|
|
|
. "-d " . $output . " " |
95
|
|
|
|
|
|
|
. "--title " . quote($title) . " " |
96
|
|
|
|
|
|
|
. "--config tmp/$path$name/llgalrc " |
97
|
|
|
|
|
|
|
. "--templates tmp/$path$name " |
98
|
|
|
|
|
|
|
. ">/dev/null"; |
99
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
dircopy($self->input($name), $output); |
101
|
0
|
|
|
|
|
|
system $command; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
1; |