[freeside-commits] freeside/FS/FS/part_export communigate_pro.pm, 1.16.4.20, 1.16.4.21

Ivan,,, ivan at wavetail.420.am
Tue Aug 3 18:22:37 PDT 2010


Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail.420.am:/tmp/cvs-serv18245

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	communigate_pro.pm 
Log Message:
better serialization on debugging data, RT#7514

Index: communigate_pro.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/communigate_pro.pm,v
retrieving revision 1.16.4.20
retrieving revision 1.16.4.21
diff -u -w -d -r1.16.4.20 -r1.16.4.21
--- communigate_pro.pm	4 Aug 2010 01:15:51 -0000	1.16.4.20
+++ communigate_pro.pm	4 Aug 2010 01:22:35 -0000	1.16.4.21
@@ -823,17 +823,7 @@
   foreach my $key ( grep ref($effective_settings->{$_}),
                     keys %$effective_settings )
   {
-    my $value = $effective_settings->{$key};
-    if ( ref($value) eq 'ARRAY' ) {
-      $effective_settings->{$key} =
-        join(' ', map { ref($_) ? '['.join(', ', @$_).']' : $_ } @$value );
-    } elsif ( ref($value) eq 'HASH' ) {
-      $effective_settings->{$key} =
-        join(', ', map { "$_:".$value->{$_} } keys %$value );
-    } else {
-      #XXX
-      warn "serializing ". ref($value). " for table display not yet handled";
-    }
+    $effective_settings->{$key} = _pretty( $effective_settings->{$key} );
   }
 
   %{$settingsref} = %$effective_settings;
@@ -843,6 +833,22 @@
 
 }
 
+sub _pretty {
+  my $value = shift;
+  if ( ref($value) eq 'ARRAY' ) {
+    '['. join(' ', map { ref($_) ? _pretty($_) : $_ } @$value ). ']';
+  } elsif ( ref($value) eq 'HASH' ) {
+    my $hv = $value->{$_};
+    join(', ', map { my $v = $value->{$_};
+                     "$_:". ref($v) ? _pretty($v) : $_ 
+                   }
+                   keys %$value
+        );
+  } else {
+    warn "serializing ". ref($value). " for table display not yet handled";
+  }
+}
+
 sub export_getsettings_svc_forward {
   my($self, $svc_forward, $settingsref, $defaultref ) = @_;
 



More information about the freeside-commits mailing list