Mercurial > pub > buggler
annotate lib/Benzin/Bugzilla/XmlRpcDeserializer.pm @ 12:52b34ea50eff default tip
sync: work time projection doesn't seem to be working anyway
author | cin |
---|---|
date | Sun, 13 Sep 2015 19:37:16 +0300 |
parents | 14a966369278 |
children |
rev | line source |
---|---|
10
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
1 package Benzin::Bugzilla::XmlRpcDeserializer; |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
2 use strict; |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
3 use mro; |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
4 use parent qw(-norequire XMLRPC::Deserializer); |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
5 use IMPL::require { Strptime => 'DateTime::Format::Strptime' }; |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
6 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
7 my $xmlRpcDateFormat = Strptime->new( |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
8 pattern => '%Y%m%dT%H:%M:%S', |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
9 time_zone => 'UTC', |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
10 on_error => 'croak' |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
11 ); |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
12 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
13 sub decode_value { |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
14 my $this = shift; |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
15 my ( $name, $attrs, $children, $value ) = @{ $_[0] }; |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
16 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
17 if ( $name eq 'dateTime.iso8601' ) { |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
18 return $xmlRpcDateFormat->parse_datetime($value); |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
19 } |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
20 else { |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
21 $this->next::method(@_); |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
22 } |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
23 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
24 } |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
25 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
26 1; |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
27 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
28 __END__ |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
29 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
30 =pod |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
31 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
32 =head1 NAME |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
33 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
34 C<Benzin::Bugzilla::XmlRpcDeserializer> - data deserializer for L<XMLRPC::Lite>. |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
35 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
36 =head1 SYNOPSIS |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
37 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
38 =begin code perl |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
39 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
40 # override the default deserializer |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
41 my $client = XMLRPC::Lite->new( |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
42 deserializer => Benzin::Bugzilla::XmlRpcDeserializer->new() |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
43 ); |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
44 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
45 =end code perl |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
46 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
47 =head1 DESCRIPTION |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
48 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
49 Slightly tuned C<XMLRPC::Deserializer> to parse C<dateTime.iso8601> values to L<DateTime> objects. |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
50 |
14a966369278
working version of exporting bugs from bugzilla in tj3 format (without bookings)
cin
parents:
diff
changeset
|
51 =cut |