line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (C) 2017 Koha-Suomi |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# This file is part of Pootle-Client. |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Pootle::Resource::Project; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
343
|
use Modern::Perl '2015'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
8
|
1
|
|
|
1
|
|
129
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
9
|
|
|
|
|
|
|
binmode STDOUT, ':encoding(UTF-8)'; |
10
|
|
|
|
|
|
|
binmode STDERR, ':encoding(UTF-8)'; |
11
|
1
|
|
|
1
|
|
32
|
use feature 'signatures'; no warnings "experimental::signatures"; |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
12
|
1
|
|
|
1
|
|
5
|
use Carp::Always; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
13
|
1
|
|
|
1
|
|
3
|
use Try::Tiny; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54
|
|
14
|
1
|
|
|
1
|
|
6
|
use Scalar::Util qw(blessed); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
35
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head2 Pootle::Resource::Project |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Pootle object |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
4
|
use base('Pootle::Resource'); |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
104
|
|
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
|
5
|
use Params::Validate qw(:all); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
168
|
|
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
5
|
use Pootle::Logger; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
27
|
|
|
|
|
|
|
my $l = bless({}, 'Pootle::Logger'); #Lazy load package logger this way to avoid circular dependency issues with logger includes from many packages |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
0
|
|
sub new($class, @params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
30
|
0
|
0
|
|
|
|
|
$l->debug("Initializing ".__PACKAGE__." with parameters: ".$l->flatten(@params)) if $l->is_debug(); |
31
|
0
|
|
|
|
|
|
my %self = validate(@params, { |
32
|
|
|
|
|
|
|
checkstyle => 1, #eg. "standard", |
33
|
|
|
|
|
|
|
code => 1, #eg. "firefox", |
34
|
|
|
|
|
|
|
description => 1, #eg. "", |
35
|
|
|
|
|
|
|
fullname => 1, #eg. "Firefox 22 (Aurora)", |
36
|
|
|
|
|
|
|
ignoredfiles => 1, #eg. "", |
37
|
|
|
|
|
|
|
localfiletype => 1, #eg. "po", |
38
|
|
|
|
|
|
|
resource_uri => 1, #eg. "/api/v1/projects/4/", |
39
|
|
|
|
|
|
|
source_language => 1, #eg. "/api/v1/languages/2/", |
40
|
|
|
|
|
|
|
translation_projects => { type => ARRAYREF }, #eg. [ "/api/v1/translation-projects/71/", ... ], |
41
|
|
|
|
|
|
|
treestyle => 1, #eg. "nongnu", |
42
|
|
|
|
|
|
|
}); |
43
|
0
|
|
|
|
|
|
my $s = bless(\%self, $class); |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
return $s; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
0
|
1
|
|
sub checkstyle($s) { return $s->{checkstyle} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
49
|
0
|
|
|
0
|
1
|
|
sub code($s) { return $s->{code} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
50
|
0
|
|
|
0
|
1
|
|
sub description($s) { return $s->{description} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
51
|
0
|
|
|
0
|
1
|
|
sub fullname($s) { return $s->{fullname} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
52
|
0
|
|
|
0
|
1
|
|
sub ignoredfiles($s) { return $s->{ignoredfiles} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
53
|
0
|
|
|
0
|
1
|
|
sub localfiletype($s) { return $s->{localfiletype} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
54
|
0
|
|
|
0
|
1
|
|
sub resource_uri($s) { return $s->{resource_uri} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
55
|
0
|
|
|
0
|
1
|
|
sub source_language($s) { return $s->{source_language} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
56
|
0
|
|
|
0
|
1
|
|
sub translation_projects($s) { return $s->{translation_projects} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
57
|
0
|
|
|
0
|
1
|
|
sub treestyle($s) { return $s->{treestyle} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 Accessors |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=over 4 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item B |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item B |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item B |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item B |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item B |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item B |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item B |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item B |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item B |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item B |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=cut |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
1; |