r55444 - in /trunk/libconfig-model-itself-perl: ChangeLog META.yml config-model-edit debian/changelog lib/Config/Model/Itself.pm lib/Config/Model/Itself/TkEditUI.pm t/itself-editor.t

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Sun Apr 4 16:29:29 UTC 2010


Author: gregoa
Date: Sun Apr  4 16:29:19 2010
New Revision: 55444

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=55444
Log:
New upstream release.

Modified:
    trunk/libconfig-model-itself-perl/ChangeLog
    trunk/libconfig-model-itself-perl/META.yml
    trunk/libconfig-model-itself-perl/config-model-edit
    trunk/libconfig-model-itself-perl/debian/changelog
    trunk/libconfig-model-itself-perl/lib/Config/Model/Itself.pm
    trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/TkEditUI.pm
    trunk/libconfig-model-itself-perl/t/itself-editor.t

Modified: trunk/libconfig-model-itself-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/ChangeLog?rev=55444&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/ChangeLog (original)
+++ trunk/libconfig-model-itself-perl/ChangeLog Sun Apr  4 16:29:19 2010
@@ -1,3 +1,8 @@
+2010-03-31  Dominique Dumont  <domi.dumont at free.fr> 1.214
+
+	* config-model-edit (): ensure that model modified by loading data
+	or YAML is saved later on by the GUI.
+
 2010-03-25  Dominique Dumont  <dominique.dumont at hp.com> 1.213
 
 	* lib/Config/Model/Itself/BackendDetector.pm (): New class derived

Modified: trunk/libconfig-model-itself-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/META.yml?rev=55444&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/META.yml (original)
+++ trunk/libconfig-model-itself-perl/META.yml Sun Apr  4 16:29:19 2010
@@ -13,7 +13,7 @@
 provides:
   Config::Model::Itself:
     file: lib/Config/Model/Itself.pm
-    version: 1.213
+    version: 1.214
   Config::Model::Itself::BackendDetector:
     file: lib/Config/Model/Itself/BackendDetector.pm
     version: 1.001
@@ -28,4 +28,4 @@
   YAML::Any: 0
 resources:
   license: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
-version: 1.213
+version: 1.214

Modified: trunk/libconfig-model-itself-perl/config-model-edit
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/config-model-edit?rev=55444&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/config-model-edit (original)
+++ trunk/libconfig-model-itself-perl/config-model-edit Sun Apr  4 16:29:19 2010
@@ -176,6 +176,10 @@
 Force a save of the model even if no edition was done. This option is
 useful to migrate a model when Config::Model model feature changes.
 
+=item -model_dir
+
+Directory where to read and write model
+
 =back
 
 
@@ -208,6 +212,7 @@
 my $load_yaml ;
 my $save = 0;
 my $load ;
+my $model_modified = 0;
 
 my $result = GetOptions (
 			 "dir=s"            => \$model_dir,
@@ -275,16 +280,19 @@
 if (defined $load) {
     my $data = load_data($load) ;
     $meta_root->load($data);
+    $model_modified = 1;
 }
 
 if (defined $load_yaml) {
     my $yaml = load_data($load_yaml) ;
     my $pdata = Load($yaml) ;
     $meta_root->load_data($pdata) ;
+    $model_modified = 1;
 }
 
 if (@ARGV) {
     $meta_root->load("@ARGV") ;
+    $model_modified = 1;
 }
 
 $meta_inst->pop_no_value_check() if $force_load ;
@@ -330,11 +338,14 @@
 # Thanks to Jerome Quelin for the tip
 $mw->optionAdd('*BorderWidth' => 1);
 
+$model_modified = 1 if $wr_model_dir ne $read_model_dir ;
+
+
 my $cmu = $mw->ConfigModelEditUI (-root      => $meta_root,
 				  -store_sub => $write_sub,
- 				  -read_model_dir => $read_model_dir,
- 				  -write_model_dir => $wr_model_dir,
+  				  -model_dir => $wr_model_dir,
 				  -model_name => $root_model,
+				  -model_modified => $model_modified,
 				 ) ;
 
 &MainLoop ; # Tk's

Modified: trunk/libconfig-model-itself-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/debian/changelog?rev=55444&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/debian/changelog (original)
+++ trunk/libconfig-model-itself-perl/debian/changelog Sun Apr  4 16:29:19 2010
@@ -1,3 +1,9 @@
+libconfig-model-itself-perl (1.214-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org>  Sun, 04 Apr 2010 18:28:42 +0200
+
 libconfig-model-itself-perl (1.213-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libconfig-model-itself-perl/lib/Config/Model/Itself.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/lib/Config/Model/Itself.pm?rev=55444&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/lib/Config/Model/Itself.pm (original)
+++ trunk/libconfig-model-itself-perl/lib/Config/Model/Itself.pm Sun Apr  4 16:29:19 2010
@@ -28,7 +28,7 @@
 use File::Path ;
 use File::Basename ;
 
-our $VERSION = '1.213';
+our $VERSION = '1.214';
 
 my $logger = Log::Log4perl::get_logger(__PACKAGE__);
 

Modified: trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/TkEditUI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/TkEditUI.pm?rev=55444&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/TkEditUI.pm (original)
+++ trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/TkEditUI.pm Sun Apr  4 16:29:19 2010
@@ -41,10 +41,10 @@
     my ($cw, $args) = @_;
 
 
-    my $r_model_dir  = delete $args->{-read_model_dir} ;
-    my $w_model_dir  = delete $args->{-write_model_dir} ;
+    my $model_dir    = delete $args->{-model_dir} ;
     my $model_name   = delete $args->{-model_name} ;
     my $root_dir     = delete $args->{-root_dir} ;
+    my $modified     = delete $args->{-model_modified} || 0;
 
     $args->{'-title'} ||= "config-model-edit $model_name" ;
 
@@ -55,10 +55,10 @@
 
     my $model_menu = $cw->{my_menu}->cascade(-label => 'Model',
 					     -menuitems => $items) ;
-    $cw->{read_model_dir} = $r_model_dir ;
-    $cw->{write_model_dir} = $w_model_dir ;
+    $cw->{model_dir} = $model_dir ;
     $cw->{model_name} = $model_name ;
     $cw->{root_dir} = $root_dir ;
+    $cw->{modified_data} = $modified ;
 }
 
 sub test_model {
@@ -70,7 +70,7 @@
     $testw->destroy if defined $testw and Tk::Exists($testw);
 
     # need to read test model from where it was written...
-    my $model = Config::Model -> new(model_dir => $cw->{write_model_dir}) ;
+    my $model = Config::Model -> new(model_dir => $cw->{model_dir}) ;
 
     my $name = $cw->{model_name};
     my $inst = $model->instance (root_class_name => $name,

Modified: trunk/libconfig-model-itself-perl/t/itself-editor.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/t/itself-editor.t?rev=55444&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/t/itself-editor.t (original)
+++ trunk/libconfig-model-itself-perl/t/itself-editor.t Sun Apr  4 16:29:19 2010
@@ -1,7 +1,4 @@
 # -*- cperl -*-
-# $Author: ddumont $
-# $Date: 2008-03-10 12:57:54 $
-# $Revision: 1.5 $
 
 use ExtUtils::testlib;
 use Test::More ;
@@ -56,7 +53,7 @@
     }
 }
 
-plan tests => 7 ; # avoid double print of plan when exec is run
+plan tests => 14 ; # avoid double print of plan when exec is run
 
 Log::Log4perl->easy_init($log ? $DEBUG: $ERROR);
 
@@ -123,33 +120,45 @@
     my $cmu = $mw->ConfigModelEditUI (-root => $meta_root,
 				      -root_dir => $wr_conf1,
 				      -store_sub => $write_sub,
-				      -read_model_dir => $read_dir,
-				      -write_model_dir => $wr_model1,
+				      -model_dir => $wr_model1,
 				      -model_name => 'MasterModel',
+				      -model_modified => 1,
 				     ) ;
-    my $delay = 200 ;
-
-    sub inc_d { $delay += 1000 } ;
+    my $delay = 2000 ;
 
     my $tktree= $cmu->Subwidget('tree') ;
     my $mgr   = $cmu->Subwidget('multi_mgr') ;
 
     my @test
       = (
-         sub { $cmu->create_element_widget('view','itself_instance.class')},
-	 sub { $tktree->open('itself_instance.class') },
-	 sub { $tktree->open('itself_instance.class.MasterModel') },
-	 sub { $cmu -> save ;},
-	 sub { $cmu -> test_model ;},
-	 sub { $cmu -> test_model ;},
-	 sub { exit; }
+         view => sub { $cmu->create_element_widget('view','itself_instance.class');},
+	 open_class => sub { $tktree->open('itself_instance.class');1;},
+	 open_instance => sub{$tktree->open('itself_instance.class.MasterModel');1;},
+	 # save step is mandatory to avoid interaction
+	 save => sub { $cmu -> save ; 1;},
+	 'open test window' => sub { $cmu -> test_model ; },
+	 'reopen test window' => sub { $cmu -> test_model ; },
+	 exit => sub { $cmu->quit ; 1;}
         );
 
     unless ($show) {
-        foreach my $t (@test) {
-            $mw->after($delay, $t);
-            inc_d ;
+	my $step = 0;
+
+	my $oldsub ;
+        while (@test) {
+	    # iterate through test list in reverse order
+	    my $t = pop @test ;
+	    my $k = pop @test ;
+	    my $next_sub = $oldsub ;
+	    my $s = sub { 
+		my $res = &$t; 
+		ok($res,"Step ".$step++." $k done");
+		$mw->after($delay, $next_sub) if defined $next_sub;
+	    };
+	    $oldsub = $s ;
         }
+
+	$mw->after($delay, $oldsub) ; # will launch first test
     }
 
     ok(1,"window launched") ;




More information about the Pkg-perl-cvs-commits mailing list