diff options
author | Angelo Naselli <anaselli@linux.it> | 2015-07-21 11:57:55 +0200 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2015-07-21 11:57:55 +0200 |
commit | 189b85e09c80c886e37eab515b25525a45b4a4c2 (patch) | |
tree | f7db93574c647237c701047ee056d292e04b8cea /lib/ManaTools/Shared | |
parent | fcb8b8c795a1033687a14dfdbc0d122bed73f338 (diff) | |
download | manatools-189b85e09c80c886e37eab515b25525a45b4a4c2.tar manatools-189b85e09c80c886e37eab515b25525a45b4a4c2.tar.gz manatools-189b85e09c80c886e37eab515b25525a45b4a4c2.tar.bz2 manatools-189b85e09c80c886e37eab515b25525a45b4a4c2.tar.xz manatools-189b85e09c80c886e37eab515b25525a45b4a4c2.zip |
removed you dependency form backends, left in Shared only atm.
if localization is changed from default has to be passed to constructor
now
Diffstat (limited to 'lib/ManaTools/Shared')
-rw-r--r-- | lib/ManaTools/Shared/Services.pm | 13 | ||||
-rw-r--r-- | lib/ManaTools/Shared/TimeZone.pm | 17 | ||||
-rw-r--r-- | lib/ManaTools/Shared/Users.pm | 14 | ||||
-rw-r--r-- | lib/ManaTools/Shared/urpmi_backend/tools.pm | 19 |
4 files changed, 18 insertions, 45 deletions
diff --git a/lib/ManaTools/Shared/Services.pm b/lib/ManaTools/Shared/Services.pm index b2dc5db9..7db83939 100644 --- a/lib/ManaTools/Shared/Services.pm +++ b/lib/ManaTools/Shared/Services.pm @@ -72,25 +72,18 @@ use ManaTools::Shared::RunProgram qw(rooted); has 'loc' => ( is => 'rw', - init_arg => undef, - builder => '_localeInitialize' + isa => 'ManaTools::Shared::Locales', + lazy => 1, + builder => '_localeInitialize', ); sub _localeInitialize { my $self = shift; - my $cmdline = new yui::YCommandLine; - my $locale_dir = undef; - my $pos = $cmdline->find("--locales-dir"); - if ($pos > 0) - { - $locale_dir = $cmdline->arg($pos+1); - } $self->loc( ManaTools::Shared::Locales->new( domain_name => 'manatools', - dir_name => $locale_dir, ) ); } diff --git a/lib/ManaTools/Shared/TimeZone.pm b/lib/ManaTools/Shared/TimeZone.pm index a380a69a..744e7f91 100644 --- a/lib/ManaTools/Shared/TimeZone.pm +++ b/lib/ManaTools/Shared/TimeZone.pm @@ -336,26 +336,19 @@ sub _servername_config_suffix_init { } has 'loc' => ( - is => 'rw', - lazy => 1, - init_arg => undef, - builder => '_localeInitialize' + is => 'rw', + isa => 'ManaTools::Shared::Locales', + lazy => 1, + builder => '_localeInitialize', ); + sub _localeInitialize { my $self = shift; - my $cmdline = new yui::YCommandLine; - my $locale_dir = undef; - my $pos = $cmdline->find("--locales-dir"); - if ($pos > 0) - { - $locale_dir = $cmdline->arg($pos+1); - } $self->loc( ManaTools::Shared::Locales->new( domain_name => 'manatools', - dir_name => $locale_dir, ) ); } diff --git a/lib/ManaTools/Shared/Users.pm b/lib/ManaTools/Shared/Users.pm index d9091fb8..900819e9 100644 --- a/lib/ManaTools/Shared/Users.pm +++ b/lib/ManaTools/Shared/Users.pm @@ -110,29 +110,23 @@ has 'user_face_dir' => ( has 'loc' => ( is => 'rw', - init_arg => undef, - builder => '_localeInitialize' + isa => 'ManaTools::Shared::Locales', + lazy => 1, + builder => '_localeInitialize', ); sub _localeInitialize { my $self = shift; - my $cmdline = new yui::YCommandLine; - my $locale_dir = undef; - my $pos = $cmdline->find("--locales-dir"); - if ($pos > 0) - { - $locale_dir = $cmdline->arg($pos+1); - } $self->loc( ManaTools::Shared::Locales->new( domain_name => 'manatools', - dir_name => $locale_dir, ) ); } + ## Used by USER (for getting values? TODO need explanations, where?) has 'USER_GetValue' => ( default => -65533, diff --git a/lib/ManaTools/Shared/urpmi_backend/tools.pm b/lib/ManaTools/Shared/urpmi_backend/tools.pm index 05768c9f..4997f586 100644 --- a/lib/ManaTools/Shared/urpmi_backend/tools.pm +++ b/lib/ManaTools/Shared/urpmi_backend/tools.pm @@ -95,26 +95,19 @@ sub _urpmi_db_backend_init { has 'loc' => ( - is => 'rw', - lazy => 1, - init_arg => undef, - builder => '_localeInitialize' + is => 'rw', + isa => 'ManaTools::Shared::Locales', + lazy => 1, + builder => '_localeInitialize', ); + sub _localeInitialize { my $self = shift; - my $cmdline = new yui::YCommandLine; - my $locale_dir = undef; - my $pos = $cmdline->find("--locales-dir"); - if ($pos > 0) - { - $locale_dir = $cmdline->arg($pos+1); - } $self->loc( ManaTools::Shared::Locales->new( domain_name => 'manatools', - dir_name => $locale_dir, ) ); } @@ -351,7 +344,7 @@ sub get_package_id { #============================================================= -=head2 get_package_id +=head2 pkg2medium =head3 INPUT |