diff options
-rw-r--r-- | Changes | 5 | ||||
-rw-r--r-- | MANIFEST | 114 | ||||
-rw-r--r-- | Makefile.PL | 35 | ||||
-rw-r--r-- | README | 63 | ||||
-rw-r--r-- | categories.conf | 6 | ||||
-rw-r--r-- | extras/Services/adminService.conf (renamed from AdminPanel/Services/adminService.conf) | 2 | ||||
-rw-r--r-- | extras/Users/adminUser.conf (renamed from AdminPanel/Users/adminUser.conf) | 2 | ||||
-rw-r--r-- | ignore.txt | 20 | ||||
-rw-r--r-- | lib/AdminPanel/Category.pm (renamed from Category.pm) | 4 | ||||
-rw-r--r-- | lib/AdminPanel/ConfigReader.pm (renamed from ConfigReader.pm) | 4 | ||||
-rw-r--r-- | lib/AdminPanel/LogViewer/init.pm (renamed from AdminPanel/LogViewer/init.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/MainDisplay.pm (renamed from MainDisplay.pm) | 106 | ||||
-rw-r--r-- | lib/AdminPanel/Module.pm (renamed from Module.pm) | 4 | ||||
-rw-r--r-- | lib/AdminPanel/Module/AdminMouse.pm (renamed from AdminPanel/AdminMouse.pm) | 6 | ||||
-rw-r--r-- | lib/AdminPanel/Module/Hosts.pm (renamed from AdminPanel/Hosts/GHosts.pm) | 8 | ||||
-rw-r--r-- | lib/AdminPanel/Module/Services.pm (renamed from AdminPanel/Services/AdminService.pm) | 10 | ||||
-rw-r--r-- | lib/AdminPanel/Module/Users.pm (renamed from AdminPanel/Users/GUsers.pm) | 26 | ||||
-rw-r--r-- | lib/AdminPanel/Privileges.pm (renamed from AdminPanel/Privileges.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/.perl_checker (renamed from AdminPanel/Rpmdragora/.perl_checker) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm (renamed from AdminPanel/Rpmdragora/edit_urpm_sources.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/formatting.pm (renamed from AdminPanel/Rpmdragora/formatting.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/gui.pm (renamed from AdminPanel/Rpmdragora/gui.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/gurpm.pm (renamed from AdminPanel/Rpmdragora/gurpm.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/icon.pm (renamed from AdminPanel/Rpmdragora/icon.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/init.pm (renamed from AdminPanel/Rpmdragora/init.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/localization.pm (renamed from AdminPanel/Rpmdragora/localization.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/open_db.pm (renamed from AdminPanel/Rpmdragora/open_db.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/pkg.pm (renamed from AdminPanel/Rpmdragora/pkg.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/rpmnew.pm (renamed from AdminPanel/Rpmdragora/rpmnew.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Rpmdragora/widgets.pm (renamed from AdminPanel/Rpmdragora/widgets.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/SettingsReader.pm (renamed from SettingsReader.pm) | 4 | ||||
-rw-r--r-- | lib/AdminPanel/Shared.pm (renamed from AdminPanel/Shared.pm) | 0 | ||||
-rw-r--r-- | lib/AdminPanel/Shared/Hosts.pm (renamed from AdminPanel/Hosts/hosts.pm) | 2 | ||||
-rw-r--r-- | lib/AdminPanel/Shared/Services.pm (renamed from AdminPanel/Services/Utility.pm) | 4 | ||||
-rw-r--r-- | lib/AdminPanel/Shared/Users.pm (renamed from AdminPanel/Users/users.pm) | 2 | ||||
-rw-r--r-- | lib/AdminPanel/rpmdragora.pm (renamed from AdminPanel/rpmdragora.pm) | 0 | ||||
-rwxr-xr-x | scripts/adminMouse (renamed from modules/adminMouse) | 4 | ||||
-rwxr-xr-x | scripts/adminService (renamed from modules/services/adminService) | 4 | ||||
-rwxr-xr-x | scripts/adminUser (renamed from modules/usermanager/adminUser) | 4 | ||||
-rwxr-xr-x | scripts/apanel.pl (renamed from apanel.pl) | 8 | ||||
-rwxr-xr-x | scripts/hostmanager (renamed from modules/hostmanager/hostmanager) | 4 | ||||
-rwxr-xr-x | scripts/mgaAddUser (renamed from modules/usermanager/mgaAddUser) | 4 | ||||
-rw-r--r-- | t/00-load.t | 13 | ||||
-rw-r--r-- | t/boilerplate.t | 57 | ||||
-rw-r--r-- | t/manifest.t | 15 | ||||
-rw-r--r-- | t/pod-coverage.t | 20 | ||||
-rw-r--r-- | t/pod.t | 12 |
47 files changed, 489 insertions, 83 deletions
diff --git a/Changes b/Changes new file mode 100644 index 00000000..a970b737 --- /dev/null +++ b/Changes @@ -0,0 +1,5 @@ +Revision history for AdminPanel-Shared + +0.01 Date/time + First version, released on an unsuspecting world. + diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 00000000..805d7d62 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,114 @@ +categories.conf +Changes +etc/categories.conf +etc/categories.conf.d/adminService.conf +etc/categories.conf.d/adminUser.conf +etc/settings.conf +extras/org.mageia.policykit.pkexec.adminpanel.policy +extras/README +extras/Services/adminService.conf +extras/setup.sh +extras/Users/adminUser.conf +ignore.txt +images/logo_mageia.png +images/mageia.png +images/quit.png +lib/AdminPanel/Category.pm +lib/AdminPanel/ConfigReader.pm +lib/AdminPanel/LogViewer/init.pm +lib/AdminPanel/MainDisplay.pm +lib/AdminPanel/Module.pm +lib/AdminPanel/Module/AdminMouse.pm +lib/AdminPanel/Module/Hosts.pm +lib/AdminPanel/Module/Services.pm +lib/AdminPanel/Module/Users.pm +lib/AdminPanel/Privileges.pm +lib/AdminPanel/rpmdragora.pm +lib/AdminPanel/Rpmdragora/.perl_checker +lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm +lib/AdminPanel/Rpmdragora/formatting.pm +lib/AdminPanel/Rpmdragora/gui.pm +lib/AdminPanel/Rpmdragora/gurpm.pm +lib/AdminPanel/Rpmdragora/icon.pm +lib/AdminPanel/Rpmdragora/init.pm +lib/AdminPanel/Rpmdragora/localization.pm +lib/AdminPanel/Rpmdragora/open_db.pm +lib/AdminPanel/Rpmdragora/pkg.pm +lib/AdminPanel/Rpmdragora/rpmnew.pm +lib/AdminPanel/Rpmdragora/widgets.pm +lib/AdminPanel/SettingsReader.pm +lib/AdminPanel/Shared.pm +lib/AdminPanel/Shared/Hosts.pm +lib/AdminPanel/Shared/Services.pm +lib/AdminPanel/Shared/Users.pm +Makefile.PL +MANIFEST This list of files +modules/logviewer/logviewer.pl +modules/rpmdragora/.perl_checker +modules/rpmdragora/AUTHORS +modules/rpmdragora/ChangeLog +modules/rpmdragora/COPYING +modules/rpmdragora/data/.svnignore +modules/rpmdragora/data/mageiaupdate.desktop.in +modules/rpmdragora/data/rpmdragora-browse-only.desktop.in +modules/rpmdragora/data/rpmdragora-sources.desktop.in +modules/rpmdragora/data/rpmdragora.desktop.in +modules/rpmdragora/edit-urpm-sources.pl +modules/rpmdragora/grpmi/curl_download/curl_download.pm +modules/rpmdragora/grpmi/curl_download/Makefile.PL +modules/rpmdragora/gui.lst +modules/rpmdragora/gurpmi.addmedia +modules/rpmdragora/icons/bugfix-update.png +modules/rpmdragora/icons/create_titles.pl +modules/rpmdragora/icons/general-update.png +modules/rpmdragora/icons/security-update.png +modules/rpmdragora/icons/selected.png +modules/rpmdragora/icons/semiselected.png +modules/rpmdragora/icons/state_backport.png +modules/rpmdragora/icons/state_base.png +modules/rpmdragora/icons/state_installed.png +modules/rpmdragora/icons/state_to_install.png +modules/rpmdragora/icons/state_to_remove.png +modules/rpmdragora/icons/state_to_update.png +modules/rpmdragora/icons/state_uninstalled.png +modules/rpmdragora/icons/title-install.png +modules/rpmdragora/icons/title-media.png +modules/rpmdragora/icons/title-tile.png +modules/rpmdragora/icons/title-update.png +modules/rpmdragora/icons/unselected.png +modules/rpmdragora/MageiaUpdate +modules/rpmdragora/mime/gurpmi.addmedia.desktop.in +modules/rpmdragora/mime/urpmi-media.xml +modules/rpmdragora/mime/x-urpmi-media.desktop.in +modules/rpmdragora/NEWS +modules/rpmdragora/pixmaps/edit-urpm-sources16.png +modules/rpmdragora/pixmaps/edit-urpm-sources32.png +modules/rpmdragora/pixmaps/edit-urpm-sources48.png +modules/rpmdragora/pixmaps/mageiaupdate16.png +modules/rpmdragora/pixmaps/mageiaupdate32.png +modules/rpmdragora/pixmaps/mageiaupdate48.png +modules/rpmdragora/pixmaps/rpmdragora-remove16.png +modules/rpmdragora/pixmaps/rpmdragora-remove32.png +modules/rpmdragora/pixmaps/rpmdragora-remove48.png +modules/rpmdragora/pixmaps/rpmdragora16.png +modules/rpmdragora/pixmaps/rpmdragora32.png +modules/rpmdragora/pixmaps/rpmdragora48.png +modules/rpmdragora/README +modules/rpmdragora/rpmdragora +modules/rpmdragora/rpmdragora.menu +modules/rpmdragora/rpmdragora.mine +modules/rpmdragora/simplify-drakx-modules +modules/test.cpp +README +scripts/adminMouse +scripts/adminService +scripts/adminUser +scripts/apanel.pl +scripts/hostmanager +scripts/mgaAddUser +settings.conf +t/00-load.t +t/boilerplate.t +t/manifest.t +t/pod-coverage.t +t/pod.t diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 00000000..171cd08f --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,35 @@ +use 5.006; +use strict; +use warnings FATAL => 'all'; +use ExtUtils::MakeMaker; + +WriteMakefile( + NAME => 'AdminPanel', + AUTHOR => q{Angelo Naselli <anaselli@linux.it> - Matteo Pasotti <matteo.pasotti@gmail.com>}, + VERSION_FROM => 'lib/AdminPanel/MainDisplay.pm', + ABSTRACT => 'AdminPanel contains a generic launcher application that can run perl modules or external programs using Suse YUI abstarction.', + LICENSE => 'GPL_2', + PL_FILES => {}, + MIN_PERL_VERSION => 5.006, + CONFIGURE_REQUIRES => { + 'ExtUtils::MakeMaker' => 0, + }, + BUILD_REQUIRES => { + 'Test::More' => 0, + }, + PREREQ_PM => { + #'ABC' => 1.6, + #'Foo::Bar::Module' => 5.0401, + "Moose" => 0, + "Config::Hosts" => 0, + }, + EXE_FILES => [ qw( scripts/adminMouse + scripts/adminService + scripts/adminUser + scripts/apanel.pl + scripts/hostmanager + scripts/mgaAddUser + ) ], + dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, + clean => { FILES => 'AdminPanel-*' }, +); @@ -0,0 +1,63 @@ +AdminPanel-Shared + +The README is used to introduce the module and provide instructions on +how to install the module, any machine dependencies it may have (for +example C compilers and installed libraries) and any other information +that should be provided before the module is installed. + +A README file is required for CPAN modules since CPAN extracts the README +file from a module distribution so that people browsing the archive +can use it to get an idea of the module's uses. It is usually a good idea +to provide version information here so that people can decide whether +fixes for the module are worth downloading. + + +INSTALLATION + +To install this module, run the following commands: + + perl Makefile.PL + make + make test + make install + +SUPPORT AND DOCUMENTATION + +After installing, you can find documentation for this module with the +perldoc command. + + perldoc AdminPanel + +You can also look for information at: + + RT, CPAN's request tracker (report bugs here) + http://rt.cpan.org/NoAuth/Bugs.html?Dist=AdminPanel-Shared + + AnnoCPAN, Annotated CPAN documentation + http://annocpan.org/dist/AdminPanel-Shared + + CPAN Ratings + http://cpanratings.perl.org/d/AdminPanel-Shared + + Search CPAN + http://search.cpan.org/dist/AdminPanel-Shared/ + + +LICENSE AND COPYRIGHT + +Copyright (C) 2012-2014 Angelo Naselli, Matteo Pasotti, Steven Tucker + +This program 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; version 2 dated June, 1991 or at your option +any later version. + +This program 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. + +A copy of the GNU General Public License is available in the source tree; +if not, write to the Free Software Foundation, Inc., +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + diff --git a/categories.conf b/categories.conf index d687780f..49b37c5a 100644 --- a/categories.conf +++ b/categories.conf @@ -28,21 +28,21 @@ <title>System</title> <icon>/usr/share/icons/system_section.png</icon> <module> - <class>AdminPanel::Users::GUsers</class> + <class>AdminPanel::Module::Users</class> </module> </category> <category> <title>Network && Internet</title> <icon>/usr/share/icons/networking_section.png</icon> <module> - <class>AdminPanel::Hosts::GHosts</class> + <class>AdminPanel::Module::Hosts</class> </module> </category> <category> <title>Hardware</title> <icon>/usr/share/icons/configuration_section.png</icon> <module> - <class>AdminPanel::AdminMouse</class> + <class>AdminPanel::Module::AdminMouse</class> </module> <module> <title>CD/DVD Config</title> diff --git a/AdminPanel/Services/adminService.conf b/extras/Services/adminService.conf index 6c40b101..304f75ed 100644 --- a/AdminPanel/Services/adminService.conf +++ b/extras/Services/adminService.conf @@ -4,7 +4,7 @@ <title>System</title> <icon>/usr/share/icons/system_section.png</icon> <module> - <class>AdminPanel::Services::AdminService</class> + <class>AdminPanel::Module::Services</class> </module> </category> </categories> diff --git a/AdminPanel/Users/adminUser.conf b/extras/Users/adminUser.conf index cf8bd636..85dba9f2 100644 --- a/AdminPanel/Users/adminUser.conf +++ b/extras/Users/adminUser.conf @@ -4,7 +4,7 @@ <title>System</title> <icon>/usr/share/icons/system_section.png</icon> <module> - <class>AdminPanel::Users::GUsers</class> + <class>AdminPanel::Module::Users</class> </module> </category> </categories> diff --git a/ignore.txt b/ignore.txt new file mode 100644 index 00000000..86918c02 --- /dev/null +++ b/ignore.txt @@ -0,0 +1,20 @@ +Makefile +Makefile.old +Build +Build.bat +META.* +MYMETA.* +.build/ +_build/ +cover_db/ +blib/ +inc/ +.lwpcookies +.last_cover_stats +.git +tags +nytprof.out +pod2htm*.tmp +pm_to_blib +AdminPanel-* +AdminPanel-*.tar.gz diff --git a/Category.pm b/lib/AdminPanel/Category.pm index b43a4c1a..7c89fbb7 100644 --- a/Category.pm +++ b/lib/AdminPanel/Category.pm @@ -18,7 +18,7 @@ #Class Category -package Category; +package AdminPanel::Category; use strict; use warnings; @@ -35,7 +35,7 @@ sub new { my $icon = 0, my $modules = 0 }; - bless $self, 'Category'; + bless $self, 'AdminPanel::Category'; $self->{name} = $newName; $self->{icon} = $newIcon; diff --git a/ConfigReader.pm b/lib/AdminPanel/ConfigReader.pm index d5ec8b1b..718a381d 100644 --- a/ConfigReader.pm +++ b/lib/AdminPanel/ConfigReader.pm @@ -18,7 +18,7 @@ #Class ConfigReader -package ConfigReader; +package AdminPanel::ConfigReader; use strict; use warnings; @@ -37,7 +37,7 @@ sub new { my $currMod = 0, my $placeHolder = 0 }; - bless $self, 'ConfigReader'; + bless $self, 'AdminPanel::ConfigReader'; my $xml = new XML::Simple (KeyAttr=>[]); $self->{data} = $xml->XMLin($fileName); diff --git a/AdminPanel/LogViewer/init.pm b/lib/AdminPanel/LogViewer/init.pm index 1c961712..1c961712 100644 --- a/AdminPanel/LogViewer/init.pm +++ b/lib/AdminPanel/LogViewer/init.pm diff --git a/MainDisplay.pm b/lib/AdminPanel/MainDisplay.pm index 35633b6e..8792bb28 100644 --- a/MainDisplay.pm +++ b/lib/AdminPanel/MainDisplay.pm @@ -17,16 +17,80 @@ # along with AdminPanel. If not, see <http://www.gnu.org/licenses/>. -#Class MainDisplay -package MainDisplay; +package AdminPanel::MainDisplay; +#============================================================= -*-perl-*- + +=head1 NAME + +AdminPanel::MainDisplay - class for AdminPaneol main window + +=head1 SYNOPSIS + + $mainDisplay = new AdminPanel::MainDisplay(); + +=head1 METHODS + +=head1 DESCRIPTION + +Long_description + +=head1 EXPORT + +exported + +=head1 SUPPORT + +You can find documentation for this module with the perldoc command: + +perldoc AdminPanel::MainDisplay + +=head1 SEE ALSO + +SEE_ALSO + +=head1 AUTHOR + +Steven Tucker + +=head1 COPYRIGHT and LICENSE + +Copyright (C) 2012, Steven Tucker +Copyright (C) 2014, Angelo Naselli. + +AdminPanel 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. + +AdminPanel 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 AdminPanel. If not, see <http://www.gnu.org/licenses/>. + +=head1 FUNCTIONS + +=cut + + + +=head1 VERSION + +Version 0.01 + +=cut + +our $VERSION = '1.0.0'; use strict; use warnings; use diagnostics; -use SettingsReader; -use ConfigReader; -use Category; -use Module; +use AdminPanel::SettingsReader; +use AdminPanel::ConfigReader; +use AdminPanel::Category; +use AdminPanel::Module; use Data::Dumper; use yui; @@ -54,7 +118,7 @@ sub new { # my $justToGetRidOfERROR = 0, my $replacePoint = 0 }; - bless $self, 'MainDisplay'; + bless $self, 'AdminPanel::MainDisplay'; ## Default values $self->{name} = "Administration panel"; @@ -235,7 +299,7 @@ sub loadSettings { # configuration file name my $fileName = "$self->{confDir}/settings.conf"; if (!$self->{settings} || $force_load) { - $self->{settings} = new SettingsReader($fileName); + $self->{settings} = new AdminPanel::SettingsReader($fileName); } } @@ -353,11 +417,11 @@ sub loadCategories { my $directory = "$self->{confDir}/categories.conf.d"; push(@categoryFiles, $fileName); - push(@categoryFiles, <etc/categories.conf.d/*.conf>); + push(@categoryFiles, <$directory/*.conf>); my $currCategory; foreach $fileName (@categoryFiles) { - my $inFile = new ConfigReader($fileName); + my $inFile = new AdminPanel::ConfigReader($fileName); my $tmpCat; my $tmp; my $hasNextCat = $inFile->hasNextCat(); @@ -365,7 +429,7 @@ sub loadCategories { $tmp = $inFile->getNextCat(); $tmpCat = $self->getCategory($tmp->{title}); if (!$tmpCat) { - $tmpCat = new Category($tmp->{title}, $tmp->{icon}); + $tmpCat = new AdminPanel::Category($tmp->{title}, $tmp->{icon}); } $self->loadCategory($tmpCat); $hasNextCat = $inFile->hasNextCat(); @@ -378,15 +442,15 @@ sub loadCategories { my $loaded = 0; if (exists $tmp->{title}) { if (not $currCategory->moduleLoaded($tmp->{title})) { - $tmpMod = Module->create(name => $tmp->{title}, - icon => $tmp->{icon}, - launch => $tmp->{launcher} - ); + $tmpMod = AdminPanel::Module->create(name => $tmp->{title}, + icon => $tmp->{icon}, + launch => $tmp->{launcher} + ); } } elsif (exists $tmp->{class}) { if (not $currCategory->moduleLoaded(-CLASS => $tmp->{class})) { - $tmpMod = Module->create(-CLASS => $tmp->{class}); + $tmpMod = AdminPanel::Module->create(-CLASS => $tmp->{class}); } } if ($tmpMod) { @@ -421,16 +485,6 @@ sub menuEventIndex { =pod -=head1 NAME - - MainDisplay - class for the main window - -=head1 SYNOPSIS - - $mainDisplay = new MainDisplay(); - -=head1 METHODS - =head2 start contains the main loop of the application diff --git a/Module.pm b/lib/AdminPanel/Module.pm index 48eb5bdc..1488e955 100644 --- a/Module.pm +++ b/lib/AdminPanel/Module.pm @@ -20,7 +20,7 @@ #Class Module -package Module; +package AdminPanel::Module; use Moose; @@ -67,7 +67,7 @@ sub create { } } else { - $obj = new Module(@_); + $obj = new AdminPanel::Module(@_); } return $obj; } diff --git a/AdminPanel/AdminMouse.pm b/lib/AdminPanel/Module/AdminMouse.pm index fecf1e21..9e4e37c0 100644 --- a/AdminPanel/AdminMouse.pm +++ b/lib/AdminPanel/Module/AdminMouse.pm @@ -19,7 +19,7 @@ # #***************************************************************************** -package AdminPanel::AdminMouse; +package AdminPanel::Module::AdminMouse; #leaving them atm use lib qw(/usr/lib/libDrakX); @@ -37,7 +37,7 @@ use AdminPanel::Shared; use yui; use Moose; -extends qw( Module ); +extends qw( AdminPanel::Module ); has '+icon' => ( default => "/usr/share/mcc/themes/default/mousedrake-mdk.png", @@ -275,4 +275,4 @@ sub _adminMouseDialog { yui::YUI::app()->setApplicationTitle($appTitle); } -1;
\ No newline at end of file +1; diff --git a/AdminPanel/Hosts/GHosts.pm b/lib/AdminPanel/Module/Hosts.pm index 4b64ddf7..fe6e0117 100644 --- a/AdminPanel/Hosts/GHosts.pm +++ b/lib/AdminPanel/Module/Hosts.pm @@ -18,7 +18,7 @@ # #***************************************************************************** -package AdminPanel::Hosts::GHosts; +package AdminPanel::Module::Hosts; use Modern::Perl 2011; use autodie; @@ -29,9 +29,9 @@ use utf8; use Glib; use yui; use AdminPanel::Shared; -use AdminPanel::Hosts::hosts; +use AdminPanel::Shared::Hosts; -extends qw( Module ); +extends qw( AdminPanel::Module ); has '+icon' => ( @@ -267,7 +267,7 @@ sub manageHostsDialog { $self->table($factory->createTable($leftContent,$tableHeader)); # initialize Config::Hosts - $self->cfgHosts(AdminPanel::Hosts::hosts->new()); + $self->cfgHosts(AdminPanel::Shared::Hosts->new()); $self->setupTable(); my $rightContent = $factory->createRight($hbox_content); diff --git a/AdminPanel/Services/AdminService.pm b/lib/AdminPanel/Module/Services.pm index 8b02227f..33326379 100644 --- a/AdminPanel/Services/AdminService.pm +++ b/lib/AdminPanel/Module/Services.pm @@ -19,7 +19,7 @@ # #***************************************************************************** -package AdminPanel::Services::AdminService; +package AdminPanel::Module::Services; #-###################################################################################### #- misc imports @@ -41,7 +41,7 @@ use Moose; use yui; use AdminPanel::Shared; -use AdminPanel::Services::Utility qw( +use AdminPanel::Shared::Services qw( services xinetd_services is_service_running @@ -52,7 +52,7 @@ use AdminPanel::Services::Utility qw( use File::Basename; -extends qw( Module ); +extends qw( AdminPanel::Module ); has '+icon' => ( default => "/usr/share/mcc/themes/default/service-mdk.png", @@ -315,8 +315,8 @@ sub start { sub loadServices { my $self = shift; - my ($l, $on_services) = AdminPanel::Services::Utility::services(); - my @xinetd_services = map { $_->[0] } AdminPanel::Services::Utility::xinetd_services(); + my ($l, $on_services) = AdminPanel::Shared::Services::services(); + my @xinetd_services = map { $_->[0] } AdminPanel::Shared::Services::xinetd_services(); $self->xinetd_services(); $self->xinetd_services(\@xinetd_services); diff --git a/AdminPanel/Users/GUsers.pm b/lib/AdminPanel/Module/Users.pm index fe95a0b2..16ea058a 100644 --- a/AdminPanel/Users/GUsers.pm +++ b/lib/AdminPanel/Module/Users.pm @@ -19,7 +19,7 @@ # #***************************************************************************** -package AdminPanel::Users::GUsers; +package AdminPanel::Module::Users; ############################################### ## @@ -51,9 +51,9 @@ use log; use Glib; use yui; use AdminPanel::Shared; -use AdminPanel::Users::users; +use AdminPanel::Shared::Users; use Moose; -extends qw( Module ); +extends qw( AdminPanel::Module ); has '+icon' => ( default => "/usr/share/icons/userdrake.png", @@ -744,9 +744,9 @@ sub addUserDialog { ## user 'icon' $hbox = $factory->createHBox($layout); $factory->createLabel($hbox, N("Click on icon to change it") ); - my $iconFace = AdminPanel::Users::users::GetFaceIcon(); + my $iconFace = AdminPanel::Shared::Users::GetFaceIcon(); my $icon = $factory->createPushButton($hbox, ""); - $icon->setIcon(AdminPanel::Users::users::face2png($iconFace)); + $icon->setIcon(AdminPanel::Shared::Users::face2png($iconFace)); $icon->setLabel($iconFace); $hbox = $factory->createHBox($layout); @@ -773,7 +773,7 @@ sub addUserDialog { my $nextIcon = GetFaceIcon($icon->label(), 1); $icon->setLabel($nextIcon); - $icon->setIcon(AdminPanel::Users::users::face2png($nextIcon)); + $icon->setIcon(AdminPanel::Shared::Users::face2png($nextIcon)); } elsif ($widget == $uidManually) { # UID inserction enabled? @@ -837,7 +837,7 @@ sub addUserDialog { # Put it in 'users' group log::explanations(N("Putting %s to 'users' group", $username)); - $gid = AdminPanel::Users::users::Add2UsersGroup($username, $self->ctx); + $gid = AdminPanel::Shared::Users::Add2UsersGroup($username, $self->ctx); } else { $errorString = ""; @@ -852,7 +852,7 @@ sub addUserDialog { } } } else { - $continue and $gid = AdminPanel::Users::users::Add2UsersGroup($username, $self->ctx); + $continue and $gid = AdminPanel::Shared::Users::Add2UsersGroup($username, $self->ctx); } if (!$continue) { @@ -872,7 +872,7 @@ sub addUserDialog { $self->ctx->UserAdd($userEnt, $is_system, $dontcreatehomedir); $self->ctx->UserSetPass($userEnt, $passwd); defined $icon->label() and - AdminPanel::Users::users::addKdmIcon($username, $icon->label()); + AdminPanel::Shared::Users::addKdmIcon($username, $icon->label()); ### TODO Migration wizard # # Refresh($sysfilter, $stringsearch); @@ -1241,7 +1241,7 @@ sub _getUserInfo { $userData{lockuser} = $self->ctx->IsLocked($userEnt); - $userData{icon_face} = AdminPanel::Users::users::GetFaceIcon($userData{username}); + $userData{icon_face} = AdminPanel::Shared::Users::GetFaceIcon($userData{username}); $userData{pwd_check_exp} = 0; $userData{pwd_exp_min} = $userEnt->ShadowMin($self->USER_GetValue); $userData{pwd_exp_max} = $userEnt->ShadowMax($self->USER_GetValue); @@ -1548,7 +1548,7 @@ sub _userAccountInfoTabWidget { $hbox = $factory->createHBox($align); $label = $factory->createLabel($hbox, N("Click on the icon to change it")); $userAccountWidget{icon_face} = $factory->createPushButton($hbox, ""); - $userAccountWidget{icon_face}->setIcon(AdminPanel::Users::users::face2png($userData{icon_face})); + $userAccountWidget{icon_face}->setIcon(AdminPanel::Shared::Users::face2png($userData{icon_face})); $userAccountWidget{icon_face}->setLabel($userData{icon_face}); $replace_pnt->showChild(); @@ -1900,7 +1900,7 @@ sub _userEdit_Ok { $self->ctx->IsLocked($userEnt) and $self->ctx->UnLock($userEnt); } - defined $userData{icon_face} and AdminPanel::Users::users::addKdmIcon($userData{username}, $userData{icon_face}); + defined $userData{icon_face} and AdminPanel::Shared::Users::addKdmIcon($userData{username}, $userData{icon_face}); $self->_refresh(); return 1; @@ -2025,7 +2025,7 @@ sub _editUserDialog { my $iconLabel = $self->_skipShortcut($self->get_edit_tab_widget('icon_face')->label()); my $nextIcon = GetFaceIcon($iconLabel, 1); $self->get_edit_tab_widget('icon_face')->setLabel($nextIcon); - $self->get_edit_tab_widget('icon_face')->setIcon(AdminPanel::Users::users::face2png($nextIcon)); + $self->get_edit_tab_widget('icon_face')->setIcon(AdminPanel::Shared::Users::face2png($nextIcon)); } } elsif ($current_tab && $current_tab eq $userEditLabel{groups}) { diff --git a/AdminPanel/Privileges.pm b/lib/AdminPanel/Privileges.pm index 73f20984..73f20984 100644 --- a/AdminPanel/Privileges.pm +++ b/lib/AdminPanel/Privileges.pm diff --git a/AdminPanel/Rpmdragora/.perl_checker b/lib/AdminPanel/Rpmdragora/.perl_checker index 202e0535..202e0535 100644 --- a/AdminPanel/Rpmdragora/.perl_checker +++ b/lib/AdminPanel/Rpmdragora/.perl_checker diff --git a/AdminPanel/Rpmdragora/edit_urpm_sources.pm b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm index 9ef5d00b..9ef5d00b 100644 --- a/AdminPanel/Rpmdragora/edit_urpm_sources.pm +++ b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm diff --git a/AdminPanel/Rpmdragora/formatting.pm b/lib/AdminPanel/Rpmdragora/formatting.pm index ccbdf0c8..ccbdf0c8 100644 --- a/AdminPanel/Rpmdragora/formatting.pm +++ b/lib/AdminPanel/Rpmdragora/formatting.pm diff --git a/AdminPanel/Rpmdragora/gui.pm b/lib/AdminPanel/Rpmdragora/gui.pm index 66d41fda..66d41fda 100644 --- a/AdminPanel/Rpmdragora/gui.pm +++ b/lib/AdminPanel/Rpmdragora/gui.pm diff --git a/AdminPanel/Rpmdragora/gurpm.pm b/lib/AdminPanel/Rpmdragora/gurpm.pm index 983f0554..983f0554 100644 --- a/AdminPanel/Rpmdragora/gurpm.pm +++ b/lib/AdminPanel/Rpmdragora/gurpm.pm diff --git a/AdminPanel/Rpmdragora/icon.pm b/lib/AdminPanel/Rpmdragora/icon.pm index 1dee4e5c..1dee4e5c 100644 --- a/AdminPanel/Rpmdragora/icon.pm +++ b/lib/AdminPanel/Rpmdragora/icon.pm diff --git a/AdminPanel/Rpmdragora/init.pm b/lib/AdminPanel/Rpmdragora/init.pm index 34581bf2..34581bf2 100644 --- a/AdminPanel/Rpmdragora/init.pm +++ b/lib/AdminPanel/Rpmdragora/init.pm diff --git a/AdminPanel/Rpmdragora/localization.pm b/lib/AdminPanel/Rpmdragora/localization.pm index fb199d93..fb199d93 100644 --- a/AdminPanel/Rpmdragora/localization.pm +++ b/lib/AdminPanel/Rpmdragora/localization.pm diff --git a/AdminPanel/Rpmdragora/open_db.pm b/lib/AdminPanel/Rpmdragora/open_db.pm index aa1fd14d..aa1fd14d 100644 --- a/AdminPanel/Rpmdragora/open_db.pm +++ b/lib/AdminPanel/Rpmdragora/open_db.pm diff --git a/AdminPanel/Rpmdragora/pkg.pm b/lib/AdminPanel/Rpmdragora/pkg.pm index e8c1a08a..e8c1a08a 100644 --- a/AdminPanel/Rpmdragora/pkg.pm +++ b/lib/AdminPanel/Rpmdragora/pkg.pm diff --git a/AdminPanel/Rpmdragora/rpmnew.pm b/lib/AdminPanel/Rpmdragora/rpmnew.pm index 3c4335d0..3c4335d0 100644 --- a/AdminPanel/Rpmdragora/rpmnew.pm +++ b/lib/AdminPanel/Rpmdragora/rpmnew.pm diff --git a/AdminPanel/Rpmdragora/widgets.pm b/lib/AdminPanel/Rpmdragora/widgets.pm index 84844069..84844069 100644 --- a/AdminPanel/Rpmdragora/widgets.pm +++ b/lib/AdminPanel/Rpmdragora/widgets.pm diff --git a/SettingsReader.pm b/lib/AdminPanel/SettingsReader.pm index e0790f61..d93ebd57 100644 --- a/SettingsReader.pm +++ b/lib/AdminPanel/SettingsReader.pm @@ -18,7 +18,7 @@ #Class SettingsReader -package SettingsReader; +package AdminPanel::SettingsReader; use strict; use warnings; @@ -33,7 +33,7 @@ sub new { my $settings = 0, my $justToGetRidOfERROR = 0 }; - bless $self, 'SettingsReader'; + bless $self, 'AdminPanel::SettingsReader'; my $xml = new XML::Simple (KeyAttr=>[]); $self->{settings} = $xml->XMLin($fileName); diff --git a/AdminPanel/Shared.pm b/lib/AdminPanel/Shared.pm index 583b214c..583b214c 100644 --- a/AdminPanel/Shared.pm +++ b/lib/AdminPanel/Shared.pm diff --git a/AdminPanel/Hosts/hosts.pm b/lib/AdminPanel/Shared/Hosts.pm index 3186be11..3e1fb905 100644 --- a/AdminPanel/Hosts/hosts.pm +++ b/lib/AdminPanel/Shared/Hosts.pm @@ -17,7 +17,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # #***************************************************************************** -package AdminPanel::Hosts::hosts; +package AdminPanel::Shared::Hosts; use Moose; use diagnostics; diff --git a/AdminPanel/Services/Utility.pm b/lib/AdminPanel/Shared/Services.pm index baae3db0..49937438 100644 --- a/AdminPanel/Services/Utility.pm +++ b/lib/AdminPanel/Shared/Services.pm @@ -19,9 +19,7 @@ # #***************************************************************************** -package AdminPanel::Services::Utility; - - +package AdminPanel::Shared::Services; #-###################################################################################### diff --git a/AdminPanel/Users/users.pm b/lib/AdminPanel/Shared/Users.pm index 2f90b7ce..9dcc5bd1 100644 --- a/AdminPanel/Users/users.pm +++ b/lib/AdminPanel/Shared/Users.pm @@ -1,4 +1,4 @@ -package AdminPanel::Users::users; +package AdminPanel::Shared::Users; use diagnostics; use strict; diff --git a/AdminPanel/rpmdragora.pm b/lib/AdminPanel/rpmdragora.pm index b96ed53d..b96ed53d 100644 --- a/AdminPanel/rpmdragora.pm +++ b/lib/AdminPanel/rpmdragora.pm diff --git a/modules/adminMouse b/scripts/adminMouse index 6af17135..40b86f4f 100755 --- a/modules/adminMouse +++ b/scripts/adminMouse @@ -4,9 +4,9 @@ use lib qw(/usr/lib/libDrakX); use common qw(N); -use AdminPanel::AdminMouse; +use AdminPanel::Module::AdminMouse; -my $mouseMan = AdminPanel::AdminMouse->new(); +my $mouseMan = AdminPanel::Module::AdminMouse->new(); $mouseMan->start(); diff --git a/modules/services/adminService b/scripts/adminService index 953b2ccd..e46942e9 100755 --- a/modules/services/adminService +++ b/scripts/adminService @@ -4,9 +4,9 @@ use strict; use lib qw(/usr/lib/libDrakX); use common qw(N); -use AdminPanel::Services::AdminService; +use AdminPanel::Module::Services; -my $serviceMan = AdminPanel::Services::AdminService->new({icon => "/usr/share/mcc/themes/default/service-mdk.png", +my $serviceMan = AdminPanel::Module::Services->new({icon => "/usr/share/mcc/themes/default/service-mdk.png", name => N("Services and daemons"),}); $serviceMan->start(); diff --git a/modules/usermanager/adminUser b/scripts/adminUser index c7f5b23a..2e72b5fc 100755 --- a/modules/usermanager/adminUser +++ b/scripts/adminUser @@ -4,9 +4,9 @@ use lib qw(/usr/lib/libDrakX); use common qw(N); -use AdminPanel::Users::GUsers; +use AdminPanel::Module::Users; -my $userMan = AdminPanel::Users::GUsers->new({icon => "/usr/share/icons/userdrake.png", +my $userMan = AdminPanel::Module::Users->new({icon => "/usr/share/icons/userdrake.png", name => N("Mageia Users Management Tool"),}); $userMan->start(); diff --git a/apanel.pl b/scripts/apanel.pl index f75c2fab..750f3f13 100755 --- a/apanel.pl +++ b/scripts/apanel.pl @@ -25,8 +25,8 @@ use diagnostics; use AdminPanel::Privileges; use FindBin; use lib "$FindBin::RealBin"; -use SettingsReader; -use MainDisplay; +use AdminPanel::SettingsReader; +use AdminPanel::MainDisplay; use yui; my $cmdline = new yui::YCommandLine; @@ -37,7 +37,7 @@ my $settings = getSettings(); ask_for_authentication($settings->{priv_method}) if(require_root_capability()); - my $mainWin = new MainDisplay(); + my $mainWin = new AdminPanel::MainDisplay(); while (1) { my $launch = $mainWin->start(); @@ -81,7 +81,7 @@ sub getSettings { } # configuration file name my $fileName = "$confDir/settings.conf"; - return new SettingsReader($fileName); + return new AdminPanel::SettingsReader($fileName); } =pod diff --git a/modules/hostmanager/hostmanager b/scripts/hostmanager index 360387cf..006f5efd 100755 --- a/modules/hostmanager/hostmanager +++ b/scripts/hostmanager @@ -17,7 +17,7 @@ # along with AdminPanel. If not, see <http://www.gnu.org/licenses/>. use Modern::Perl 2011; use autodie; -use AdminPanel::Hosts::GHosts; +use AdminPanel::Module::Hosts; use yui; @@ -27,7 +27,7 @@ my $wm_name = "Manage hosts definitions"; yui::YUI::app()->setApplicationTitle($wm_name); yui::YUI::app()->setApplicationIcon($wm_icon); -my $hostMan = AdminPanel::Hosts::GHosts->new({ +my $hostMan = AdminPanel::Module::Hosts->new({ icon => $wm_icon, name => $wm_name }); diff --git a/modules/usermanager/mgaAddUser b/scripts/mgaAddUser index f1af4bd3..093da724 100755 --- a/modules/usermanager/mgaAddUser +++ b/scripts/mgaAddUser @@ -4,9 +4,9 @@ use lib qw(/usr/lib/libDrakX); use common qw(N); -use AdminPanel::Users::GUsers; +use AdminPanel::Module::Users; -my $userMan = AdminPanel::Users::GUsers->new({icon => "/usr/share/icons/userdrake.png", +my $userMan = AdminPanel::Module::Users->new({icon => "/usr/share/icons/userdrake.png", name => N("Mageia Add Users Tool"),}); $userMan->addUserDialog(1); diff --git a/t/00-load.t b/t/00-load.t new file mode 100644 index 00000000..5be19d43 --- /dev/null +++ b/t/00-load.t @@ -0,0 +1,13 @@ +#!perl -T +use 5.006; +use strict; +use warnings FATAL => 'all'; +use Test::More; + +plan tests => 1; + +BEGIN { + use_ok( 'AdminPanel::Shared' ) || print "Bail out!\n"; +} + +diag( "Testing AdminPanel::Shared $AdminPanel::Shared::VERSION, Perl $], $^X" ); diff --git a/t/boilerplate.t b/t/boilerplate.t new file mode 100644 index 00000000..9d8d3fae --- /dev/null +++ b/t/boilerplate.t @@ -0,0 +1,57 @@ +#!perl -T +use 5.006; +use strict; +use warnings FATAL => 'all'; +use Test::More; + +plan tests => 3; + +sub not_in_file_ok { + my ($filename, %regex) = @_; + open( my $fh, '<', $filename ) + or die "couldn't open $filename for reading: $!"; + + my %violated; + + while (my $line = <$fh>) { + while (my ($desc, $regex) = each %regex) { + if ($line =~ $regex) { + push @{$violated{$desc}||=[]}, $.; + } + } + } + + if (%violated) { + fail("$filename contains boilerplate text"); + diag "$_ appears on lines @{$violated{$_}}" for keys %violated; + } else { + pass("$filename contains no boilerplate text"); + } +} + +sub module_boilerplate_ok { + my ($module) = @_; + not_in_file_ok($module => + 'the great new $MODULENAME' => qr/ - The great new /, + 'boilerplate description' => qr/Quick summary of what the module/, + 'stub function definition' => qr/function[12]/, + ); +} + +TODO: { + local $TODO = "Need to replace the boilerplate text"; + + not_in_file_ok(README => + "The README is used..." => qr/The README is used/, + "'version information here'" => qr/to provide version information/, + ); + + not_in_file_ok(Changes => + "placeholder date/time" => qr(Date/time) + ); + + module_boilerplate_ok('lib/AdminPanel/Shared.pm'); + + +} + diff --git a/t/manifest.t b/t/manifest.t new file mode 100644 index 00000000..6ddfe364 --- /dev/null +++ b/t/manifest.t @@ -0,0 +1,15 @@ +#!perl -T +use 5.006; +use strict; +use warnings FATAL => 'all'; +use Test::More; + +unless ( $ENV{RELEASE_TESTING} ) { + plan( skip_all => "Author tests not required for installation" ); +} + +my $min_tcm = 0.9; +eval "use Test::CheckManifest $min_tcm"; +plan skip_all => "Test::CheckManifest $min_tcm required" if $@; + +ok_manifest(); diff --git a/t/pod-coverage.t b/t/pod-coverage.t new file mode 100644 index 00000000..866fac2b --- /dev/null +++ b/t/pod-coverage.t @@ -0,0 +1,20 @@ +#!perl -T +use 5.006; +use strict; +use warnings FATAL => 'all'; +use Test::More; + +# Ensure a recent version of Test::Pod::Coverage +my $min_tpc = 1.08; +eval "use Test::Pod::Coverage $min_tpc"; +plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" + if $@; + +# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, +# but older versions don't recognize some common documentation styles +my $min_pc = 0.18; +eval "use Pod::Coverage $min_pc"; +plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" + if $@; + +all_pod_coverage_ok(); diff --git a/t/pod.t b/t/pod.t new file mode 100644 index 00000000..a0054e97 --- /dev/null +++ b/t/pod.t @@ -0,0 +1,12 @@ +#!perl -T +use 5.006; +use strict; +use warnings FATAL => 'all'; +use Test::More; + +# Ensure a recent version of Test::Pod +my $min_tp = 1.22; +eval "use Test::Pod $min_tp"; +plan skip_all => "Test::Pod $min_tp required for testing POD" if $@; + +all_pod_files_ok(); |