line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Wikibase::Datatype::Print::Mediainfo; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
936399
|
use base qw(Exporter); |
|
3
|
|
|
|
|
33
|
|
|
3
|
|
|
|
|
317
|
|
4
|
3
|
|
|
3
|
|
23
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
58
|
|
5
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
77
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
917
|
use Error::Pure qw(err); |
|
3
|
|
|
|
|
22859
|
|
|
3
|
|
|
|
|
75
|
|
8
|
3
|
|
|
3
|
|
116
|
use Readonly; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
135
|
|
9
|
3
|
|
|
3
|
|
1400
|
use Wikibase::Datatype::Print::MediainfoStatement; |
|
3
|
|
|
|
|
13
|
|
|
3
|
|
|
|
|
164
|
|
10
|
3
|
|
|
|
|
160
|
use Wikibase::Datatype::Print::Utils qw(print_descriptions print_labels |
11
|
3
|
|
|
3
|
|
22
|
print_statements); |
|
3
|
|
|
|
|
6
|
|
12
|
3
|
|
|
3
|
|
25
|
use Wikibase::Datatype::Print::Value::Monolingual; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
956
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Readonly::Array our @EXPORT_OK => qw(print); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = 0.12; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub print { |
19
|
2
|
|
|
2
|
0
|
3662
|
my ($obj, $opts_hr) = @_; |
20
|
|
|
|
|
|
|
|
21
|
2
|
50
|
|
|
|
8
|
if (! defined $opts_hr) { |
22
|
2
|
|
|
|
|
5
|
$opts_hr = {}; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
2
|
50
|
|
|
|
7
|
if (! exists $opts_hr->{'lang'}) { |
26
|
2
|
|
|
|
|
5
|
$opts_hr->{'lang'} = 'en'; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
2
|
100
|
|
|
|
16
|
if (! $obj->isa('Wikibase::Datatype::Mediainfo')) { |
30
|
1
|
|
|
|
|
5
|
err "Object isn't 'Wikibase::Datatype::Mediainfo'."; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
1
|
50
|
|
|
|
5
|
my @ret = ( |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
34
|
|
|
|
|
|
|
defined $obj->id ? 'Id: '.$obj->id : (), |
35
|
|
|
|
|
|
|
defined $obj->title ? 'Title: '.$obj->title : (), |
36
|
|
|
|
|
|
|
defined $obj->ns ? 'NS: '.$obj->ns : (), |
37
|
|
|
|
|
|
|
defined $obj->lastrevid ? 'Last revision id: '.$obj->lastrevid : (), |
38
|
|
|
|
|
|
|
defined $obj->modified ? 'Date of modification: '.$obj->modified : (), |
39
|
|
|
|
|
|
|
defined $obj->page_id ? 'Page ID: '.$obj->page_id : (), |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# Label. |
43
|
1
|
|
|
|
|
119
|
push @ret, print_labels($obj, $opts_hr, |
44
|
|
|
|
|
|
|
\&Wikibase::Datatype::Print::Value::Monolingual::print); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# Description. |
47
|
1
|
|
|
|
|
8
|
push @ret, print_descriptions($obj, $opts_hr, |
48
|
|
|
|
|
|
|
\&Wikibase::Datatype::Print::Value::Monolingual::print); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# Statements. |
51
|
1
|
|
|
|
|
5
|
push @ret, print_statements($obj, $opts_hr, |
52
|
|
|
|
|
|
|
\&Wikibase::Datatype::Print::MediainfoStatement::print); |
53
|
|
|
|
|
|
|
|
54
|
1
|
50
|
|
|
|
9
|
return wantarray ? @ret : (join "\n", @ret); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |