[SCM] Packaging for padre-plugin-spellcheck branch, master, updated. debian/1.24-1-5-g2880256

Dominique Dumont dod at debian.org
Thu May 3 14:49:41 UTC 2012


The following commit has been merged in the master branch:
commit 84d0a73c608dfd798c4cf0db58e09ca4776cc169
Merge: efe650bb683725a61ae3c0f6598ead54af0b4920 66f726ea8e6d34062acb1b27d86d3eb9a585d5c0
Author: Dominique Dumont <dod at debian.org>
Date:   Thu May 3 16:38:04 2012 +0200

    Merge tag 'upstream/1.25'
    
    Upstream version 1.25

diff --combined lib/Padre/Plugin/SpellCheck.pm
index 8b2c915,d0d2598..377d017
--- a/lib/Padre/Plugin/SpellCheck.pm
+++ b/lib/Padre/Plugin/SpellCheck.pm
@@@ -1,19 -1,28 +1,28 @@@
  package Padre::Plugin::SpellCheck;
  
- use 5.008005;
+ use 5.010;
  use strict;
  use warnings;
  
  use Padre::Plugin ();
  use Padre::Unload ();
  use File::Which   ();
+ use Try::Tiny;
  
- our $VERSION = '1.24';
+ our $VERSION = '1.25';
  our @ISA     = 'Padre::Plugin';
- # use Data::Printer {
- 	# caller_info => 1,
- 	# colored     => 1,
- # };
+ 
+ # Child modules we need to unload when disabled
+ use constant CHILDREN => qw{
+ 	Padre::Plugin::SpellCheck
+ 	Padre::Plugin::SpellCheck::Checker
+ 	Padre::Plugin::SpellCheck::FBP::Checker
+ 	Padre::Plugin::SpellCheck::Engine
+ 	Padre::Plugin::SpellCheck::Preferences
+ 	Padre::Plugin::SpellCheck::FBP::Preferences
+ 	Text::Aspell
+ 	Text::Hunspell
+ };
  
  #######
  # Define Plugin Name Spell Checker
@@@ -27,15 -36,15 +36,15 @@@ sub plugin_name 
  #######
  sub padre_interfaces {
  	return (
- 		'Padre::Plugin' => '0.94',
- 		'Padre::Unload' => '0.94',
+ 		'Padre::Plugin' => '0.96',
+ 		'Padre::Unload' => '0.96',
  
  		# used by my sub packages
- 		'Padre::Locale'         => '0.94',
- 		'Padre::Logger'         => '0.94',
- 		'Padre::Wx'             => '0.94',
- 		'Padre::Wx::Role::Main' => '0.94',
- 		'Padre::Util'           => '0.94',
+ 		'Padre::Locale'         => '0.96',
+ 		'Padre::Logger'         => '0.96',
+ 		'Padre::Wx'             => '0.96',
+ 		'Padre::Wx::Role::Main' => '0.96',
+ 		'Padre::Util'           => '0.96',
  	);
  }
  
@@@ -47,16 -56,16 +56,16 @@@ sub menu_plugins 
  	my $main = $self->main;
  
  	# Create a manual menu item
- 	my $item = Wx::MenuItem->new( undef, -1, $self->plugin_name . "...\tF7 ", );
+ 	my $menu_item = Wx::MenuItem->new( undef, -1, $self->plugin_name . "...\tF7", );
  	Wx::Event::EVT_MENU(
- 		$main, $item,
+ 		$main,
+ 		$menu_item,
  		sub {
- 			local $@;
- 			eval { $self->spell_check($main); };
+ 			$self->spell_check;
  		},
  	);
  
- 	return $item;
+ 	return $menu_item;
  }
  
  #########
@@@ -64,23 -73,25 +73,25 @@@
  # as we have an external dependency
  #########
  sub plugin_enable {
- 	my $self                       = shift;
- 	my $local_dictonary_bin_exists = 0;
+ 	my $self                        = shift;
+ 	my $local_dictionary_bin_exists = 0;
  
  	# Tests for externals used by Preference's
- 	if ( eval { require Text::Aspell } ) {
- 		$local_dictonary_bin_exists = 1;
- 	}
- 	if ( File::Which::which('hunspell') ) {
- 		$local_dictonary_bin_exists = 1;
- 	}
+ 	try {
+ 		if ( require Text::Aspell ) {
+ 			$local_dictionary_bin_exists = 1;
+ 		}
+ 	};
+ 	try {
+ 		if ( File::Which::which('hunspell') ) {
+ 			$local_dictionary_bin_exists = 1;
+ 		}
+ 	};
  
  	#Set/ReSet Config data
- 	$self->_config if $local_dictonary_bin_exists;
- 
- 	# p $self->_config_read;
+ 	$self->_config if $local_dictionary_bin_exists;
  
- 	return $local_dictonary_bin_exists;
+ 	return $local_dictionary_bin_exists;
  }
  
  #######
@@@ -104,41 -115,45 +115,45 @@@ sub _config 
  	#	Info P-P-SpellCheck    >= 1.23
  	#	+ $config->{Engine}     = 'Aspell'
  	###
- 	if ( eval { $config->{Version} >= 1.23; } ) {
- 		return;
- 	} elsif (
- 		eval {
- 			$config->{Version} < 1.23;
+ 
+ 	try {
+ 		if ( $config->{Version} >= 1.23 ) {
+ 			return;
  		}
- 		)
- 	{
- 		$config->{Version} = $VERSION;
- 		$config->{Engine}  = 'Aspell';
- 		$self->config_write($config);
- 		return;
- 	} elsif (
- 		eval {
- 			$config->{dictionary};
+ 	};
+ 
+ 	try {
+ 		if ( $config->{Version} < 1.23 ) {
+ 
+ 			$config->{Version} = $VERSION;
+ 			$config->{Engine}  = 'Aspell';
+ 			$self->config_write($config);
+ 			return;
  		}
- 		)
- 	{
- 		my $tmp_iso = $config->{dictionary};
- 		$self->config_write( {} );
- 		$config             = $self->config_read;
- 		$config->{Aspell}   = $tmp_iso;
- 		$config->{Hunspell} = $tmp_iso;
- 		$config->{Version}  = $VERSION;
- 		$config->{Engine}   = 'Aspell';
- 		$self->config_write($config);
- 		return;
- 	} else {
+ 	};
+ 
+ 	try {
+ 		if ( $config->{dictionary} ) {
+ 			my $tmp_iso = $config->{dictionary};
+ 			$self->config_write( {} );
+ 			$config             = $self->config_read;
+ 			$config->{Aspell}   = $tmp_iso;
+ 			$config->{Hunspell} = $tmp_iso;
+ 			$config->{Version}  = $VERSION;
+ 			$config->{Engine}   = 'Aspell';
+ 			$self->config_write($config);
+ 			return;
+ 		}
+ 	}
+ 	catch {
  		$self->config_write( {} );
  		$config->{Aspell}   = 'en_GB';
  		$config->{Hunspell} = 'en_GB';
  		$config->{Version}  = $VERSION;
  		$config->{Engine}   = 'Aspell';
  		$self->config_write($config);
- 	}
+ 		return;
+ 	};
  
  	return;
  }
@@@ -153,19 -168,10 +168,10 @@@ sub plugin_disable 
  	$self->clean_dialog;
  
  	# Unload all our child classes
- 
- 	require Padre::Unload;
- 	Padre::Unload->unload(
- 		qw{
- 			Padre::Plugin::SpellCheck
- 			Padre::Plugin::SpellCheck::Checker
- 			Padre::Plugin::SpellCheck::FBP::Checker
- 			Padre::Plugin::SpellCheck::Engine
- 			Padre::Plugin::SpellCheck::Preferences
- 			Padre::Plugin::SpellCheck::FBP::Preferences
- 			Text::Aspell
- 			}
- 	);
+ 	for my $package (CHILDREN) {
+ 		require Padre::Unload;
+ 		Padre::Unload->unload($package);
+ 	}
  
  	$self->SUPER::plugin_disable(@_);
  
@@@ -194,13 -200,19 +200,19 @@@ sub clean_dialog 
  #######
  sub plugin_preferences {
  	my $self = shift;
+ 	my $main = $self->main;
  
  	# Clean up any previous existing dialog
  	$self->clean_dialog;
  
- 	require Padre::Plugin::SpellCheck::Preferences;
- 	$self->{dialog} = Padre::Plugin::SpellCheck::Preferences->new($self);
- 	$self->{dialog}->ShowModal;
+ 	try {
+ 		require Padre::Plugin::SpellCheck::Preferences;
+ 		$self->{dialog} = Padre::Plugin::SpellCheck::Preferences->new($main);
+ 		$self->{dialog}->ShowModal;
+ 	}
+ 	catch {
+ 		$self->main->error( sprintf( Wx::gettext('Error: %s'), $_ ) );
+ 	};
  
  	return;
  }
@@@ -210,13 -222,19 +222,19 @@@
  #######
  sub spell_check {
  	my $self = shift;
+ 	my $main = $self->main;
  
  	# Clean up any previous existing dialog
  	$self->clean_dialog;
  
- 	require Padre::Plugin::SpellCheck::Checker;
- 	$self->{dialog} = Padre::Plugin::SpellCheck::Checker->new($self);
- 	$self->{dialog}->Show;
+ 	try {
+ 		require Padre::Plugin::SpellCheck::Checker;
+ 		$self->{dialog} = Padre::Plugin::SpellCheck::Checker->new($main);
+ 		$self->{dialog}->Show;
+ 	}
+ 	catch {
+ 		$self->main->error( sprintf( Wx::gettext('Error: %s'), $_ ) );
+ 	};
  
  	return;
  }
@@@ -253,13 -271,16 +271,17 @@@ sub menu_plugins_simple 
  
  Padre::Plugin::SpellCheck - Check spelling in Padre The Perl IDE
  
+ =head1 VERSION
+ 
+ version 1.25
+ 
  =head1 DESCRIPTION
  
  This plug-in allows one to check there spelling within Padre using
  C<F7> (standard spelling short-cut across text processors). 
  
  One can change the dictionary language used (based upon install languages) in the preferences window via Plug-in Manager. 
 +Note that preferences can B<only> be setup while the plugin is B<disabled>.
  Preferences are persistent. You need to Save your preferred language.
  
  This plug-in is using C<Text::Aspell> default (legacy). You can also use C<Text::Hunspell>, so check these module's
@@@ -394,4 -415,10 +416,10 @@@ This software is copyright (c) 2010 by 
  
  This program is free software; you can redistribute it and/or
  modify it under the same terms as Perl 5 itself.
+ 
  =cut
+ 
+ # Copyright 2008-2012 The Padre development team as listed in Padre.pm.
+ # LICENSE
+ # This program is free software; you can redistribute it and/or
+ # modify it under the same terms as Perl 5 itself.

-- 
Packaging for padre-plugin-spellcheck



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