summaryrefslogtreecommitdiffstats
path: root/perl-install/patch/patch-IMPS2.pl
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/patch/patch-IMPS2.pl')
0 files changed, 0 insertions, 0 deletions
='#n163'>163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
# vim: set et ts=4 sw=4:
#
#    Copyright 2013-2015 Angelo Naselli
#    Copyright 2012 Steven Tucker
#
#    This file is part of ManaTools
#
#    ManaTools is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 2 of the License, or
#    (at your option) any later version.
#
#    ManaTools is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with ManaTools.  If not, see <http://www.gnu.org/licenses/>.


#Class Module
package ManaTools::Module;

use Moose;
use ManaTools::Shared;
use ManaTools::Shared::Locales;
use ManaTools::Shared::Logging;
use ManaTools::Shared::GUI::CommandLine;

=head1 VERSION

Version 1.0.1

=cut

our $VERSION = '1.0.1';

use yui;

#=============================================================

=head1 Attributes - Optional constructor parameters

=head2 icon

    icon attribute defines the Module icon, override this
    attribute by using
        has '+icon' => (
            ...
        )
    into your module implementation.

=cut

#=============================================================
has 'icon' => (
    is      => 'rw',
    isa     => 'Str',
);

#=============================================================

=head2 name

    name attribute defines the Module name, override this
    attribute by using
        has '+name' => (
            ...
        )
    into your module implementation.

=cut

#=============================================================
has 'name' => (
    is      => 'rw',
    isa     => 'Str',
);

#=============================================================

=head2 launch

    launch attribute defines the Module as external command
    to be run, pass this attribute to the "create" to set it.

=cut

#=============================================================

has 'launch' => (
    is      => 'rw',
    isa     => 'Str',
);

has 'button' => (
    is      => 'rw',
    init_arg => undef,
);

#=============================================================

=head2 loc

    loc attribute defines localization object that uses "manatools"
    domain as default. (see ManaTools::Shared::Locales for details).
    To use your own Module domain, override this attribute by using
        has '+loc' => (
            ...
        )
    or assign it again to your ManaTools::Shared::Locales object into
    the extension module implementation.

=cut

#=============================================================
has 'loc' => (
    is => 'rw',
    isa => 'ManaTools::Shared::Locales',
    lazy => 1,
    default => sub {
        return ManaTools::Shared::Locales->new();
    }
);

#=============================================================

=head2 logger

    logger attribute defines the Logging object
    see ManaTools::Shared::Logging for details and usage.

=cut

#=============================================================
has 'logger' => (
    is => 'ro',
    isa => 'ManaTools::Shared::Logging',
    init_arg => undef,
    lazy => 1,
    builder => '_loggerInitialize',
);

sub _loggerInitialize{
    my $self = shift;

    return ManaTools::Shared::Logging->new(ident => $self->name);
}


#=============================================================

=head2 commandline

    commandline attribute defines the given command line, if
    --help is passed help message is shown and the module is not
    loaded.
    See ManaTools::Shared::GUI::CommandLine for details and usage.

=cut

#=============================================================
has 'commandline' => (
    is => 'ro',
    isa => 'ManaTools::Shared::GUI::CommandLine',
    init_arg => undef,
    default => sub {
        return ManaTools::Shared::GUI::CommandLine->new_with_options();
    }
);



#=============================================================

=head1 SUBROUTINES/METHODS

=head2 create

=head3 INPUT

    %params:    moudule extension construtcor parameters
                --CLASS <name> name of the Class module extension name
                in the case of acting as a launcher mandatory parameters
                are name, icon and launch (see Attributes section of
                this manual)

=head3 DESCRIPTION

    returns a Module instance, such as a module launcher
    (this object) or an extension of this class

=cut

#=============================================================
sub create {
    my $class = shift;
    $class = ref $class || $class;
    my (%params) = @_;

    my $obj;
    if ( exists $params{-CLASS} ) {
        my $driver = $params{-CLASS};

        eval {
            my $pkg = $driver;
            $pkg =~ s/::/\//g;
            $pkg .= '.pm';
            require $pkg;
            $obj=$driver->new();
        };
        if ( $@ ) {