[PATCH] testbot/web: Standardize the packages inheritance.
Use "our" instead of fully prefixing @ISA. Also defining the package inheritance does not depend on the rest of the package so move these statements first, even before all the other imports. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> --- testbot/web/Activity.pl | 6 ++++-- testbot/web/Feedback.pl | 6 ++++-- testbot/web/ForgotPassword.pl | 6 ++++-- testbot/web/JobDetails.pl | 7 +++++-- testbot/web/Login.pl | 6 ++++-- testbot/web/Logout.pl | 6 ++++-- testbot/web/PatchesList.pl | 6 ++++-- testbot/web/Register.pl | 6 ++++-- testbot/web/ResetPassword.pl | 6 ++++-- testbot/web/Stats.pl | 4 +++- testbot/web/Submit.pl | 6 ++++-- testbot/web/admin/BranchDetails.pl | 5 +++-- testbot/web/admin/BranchesList.pl | 4 +++- testbot/web/admin/Log.pl | 5 +++-- testbot/web/admin/UserDetails.pl | 4 +++- testbot/web/admin/UsersList.pl | 3 ++- testbot/web/admin/VMDetails.pl | 4 +++- testbot/web/admin/VMsList.pl | 4 +++- 18 files changed, 64 insertions(+), 30 deletions(-) diff --git a/testbot/web/Activity.pl b/testbot/web/Activity.pl index 08e0291ae..8b1fd6dc5 100644 --- a/testbot/web/Activity.pl +++ b/testbot/web/Activity.pl @@ -21,17 +21,18 @@ use strict; package ActivityPage; +use ObjectModel::CGI::FreeFormPage; +our @ISA = qw(ObjectModel::CGI::FreeFormPage); + use POSIX qw(strftime); use URI::Escape; -use ObjectModel::CGI::FreeFormPage; use WineTestBot::Config; use WineTestBot::Activity; use WineTestBot::Log; use WineTestBot::Utils; use WineTestBot::VMs; -(a)ActivityPage::ISA = qw(ObjectModel::CGI::FreeFormPage); my $HOURS_DEFAULT = 12; @@ -297,6 +298,7 @@ sub GenerateFooter($) print "<p class='GeneralFooterText'>Generated in ", Elapsed($self->{start}), " s</p>\n"; } + package main; my $Request = shift; diff --git a/testbot/web/Feedback.pl b/testbot/web/Feedback.pl index 2480243d4..2adc4cd40 100644 --- a/testbot/web/Feedback.pl +++ b/testbot/web/Feedback.pl @@ -21,11 +21,12 @@ use strict; package FeedbackPage; -use ObjectModel::BasicPropertyDescriptor; use ObjectModel::CGI::FreeFormPage; +our @ISA = qw(ObjectModel::CGI::FreeFormPage); + +use ObjectModel::BasicPropertyDescriptor; use WineTestBot::Config; -(a)FeedbackPage::ISA = qw(ObjectModel::CGI::FreeFormPage); sub _initialize($$$) { @@ -125,6 +126,7 @@ sub GenerateBody($) $self->SUPER::GenerateBody(); } + package main; my $Request = shift; diff --git a/testbot/web/ForgotPassword.pl b/testbot/web/ForgotPassword.pl index 3c94c27e8..af79b65c7 100644 --- a/testbot/web/ForgotPassword.pl +++ b/testbot/web/ForgotPassword.pl @@ -21,13 +21,14 @@ use strict; package ForgotPasswordPage; -use ObjectModel::BasicPropertyDescriptor; use ObjectModel::CGI::FreeFormPage; +our @ISA = qw(ObjectModel::CGI::FreeFormPage); + +use ObjectModel::BasicPropertyDescriptor; use WineTestBot::Users; use WineTestBot::Utils; use WineTestBot::CGI::Sessions; -(a)ForgotPasswordPage::ISA = qw(ObjectModel::CGI::FreeFormPage); sub _initialize($$$) { @@ -131,6 +132,7 @@ sub GenerateBody($) $self->SUPER::GenerateBody(); } + package main; my $Request = shift; diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl index 70fb0fe98..0213eb5e2 100644 --- a/testbot/web/JobDetails.pl +++ b/testbot/web/JobDetails.pl @@ -21,14 +21,16 @@ use strict; package JobDetailsPage; -use URI::Escape; use ObjectModel::CGI::CollectionPage; +our @ISA = qw(ObjectModel::CGI::CollectionPage); + +use URI::Escape; + use WineTestBot::Config; use WineTestBot::Jobs; use WineTestBot::StepsTasks; use WineTestBot::Engine::Notify; -(a)JobDetailsPage::ISA = qw(ObjectModel::CGI::CollectionPage); sub _initialize($$$) { @@ -485,6 +487,7 @@ sub GenerateDataCell($$$$$) } } + package main; my $Request = shift; diff --git a/testbot/web/Login.pl b/testbot/web/Login.pl index b5b63651e..14cf4bda8 100644 --- a/testbot/web/Login.pl +++ b/testbot/web/Login.pl @@ -21,14 +21,15 @@ use strict; package LoginPage; -use ObjectModel::BasicPropertyDescriptor; use ObjectModel::CGI::FreeFormPage; +our @ISA = qw(ObjectModel::CGI::FreeFormPage); + +use ObjectModel::BasicPropertyDescriptor; use WineTestBot::Config; use WineTestBot::Users; use WineTestBot::Utils; use WineTestBot::CGI::Sessions; -(a)LoginPage::ISA = qw(ObjectModel::CGI::FreeFormPage); sub _initialize($$$) { @@ -153,6 +154,7 @@ sub OnAction($$) return $self->SUPER::OnAction($Action); } + package main; my $Request = shift; diff --git a/testbot/web/Logout.pl b/testbot/web/Logout.pl index 417232d08..17e81d2b8 100644 --- a/testbot/web/Logout.pl +++ b/testbot/web/Logout.pl @@ -22,10 +22,11 @@ use strict; package LogoutPage; use ObjectModel::CGI::Page; -use WineTestBot::CGI::Sessions; +our @ISA = qw(ObjectModel::CGI::Page); + use CGI qw(:standard); +use WineTestBot::CGI::Sessions; -(a)LogoutPage::ISA = qw(ObjectModel::CGI::Page); sub _initialize($$$) { @@ -72,6 +73,7 @@ sub GeneratePage($) $self->SUPER::GeneratePage(); } + package main; my $Request = shift; diff --git a/testbot/web/PatchesList.pl b/testbot/web/PatchesList.pl index f0571b126..6728a285f 100644 --- a/testbot/web/PatchesList.pl +++ b/testbot/web/PatchesList.pl @@ -21,11 +21,12 @@ use strict; package PatchesListPage; -use URI::Escape; use ObjectModel::CGI::CollectionPage; +our @ISA = qw(ObjectModel::CGI::CollectionPage); + +use URI::Escape; use WineTestBot::Patches; -(a)PatchesListPage::ISA = qw(ObjectModel::CGI::CollectionPage); sub _initialize($$$) { @@ -91,6 +92,7 @@ sub GenerateDataCell($$$$$) } } + package main; my $Request = shift; diff --git a/testbot/web/Register.pl b/testbot/web/Register.pl index 4cbc8c953..207728e75 100644 --- a/testbot/web/Register.pl +++ b/testbot/web/Register.pl @@ -21,15 +21,16 @@ use strict; package RegisterPage; +use ObjectModel::CGI::ItemPage; +our @ISA = qw(ObjectModel::CGI::ItemPage); + use URI::Escape; use ObjectModel::BasicPropertyDescriptor; -use ObjectModel::CGI::ItemPage; use WineTestBot::Config; use WineTestBot::Users; use WineTestBot::Utils; -(a)RegisterPage::ISA = qw(ObjectModel::CGI::ItemPage); sub _initialize($$$) { @@ -187,6 +188,7 @@ EOF $self->SUPER::GenerateBody(); } + package main; my $Request = shift; diff --git a/testbot/web/ResetPassword.pl b/testbot/web/ResetPassword.pl index db129dbf2..1e2b94d03 100644 --- a/testbot/web/ResetPassword.pl +++ b/testbot/web/ResetPassword.pl @@ -21,13 +21,14 @@ use strict; package ResetPasswordPage; -use ObjectModel::BasicPropertyDescriptor; use ObjectModel::CGI::FreeFormPage; +our @ISA = qw(ObjectModel::CGI::FreeFormPage); + +use ObjectModel::BasicPropertyDescriptor; use WineTestBot::Users; use WineTestBot::Utils; use WineTestBot::CGI::Sessions; -(a)ResetPasswordPage::ISA = qw(ObjectModel::CGI::FreeFormPage); sub _initialize($$$) { @@ -183,6 +184,7 @@ sub GenerateBody($) $self->SUPER::GenerateBody(); } + package main; my $Request = shift; diff --git a/testbot/web/Stats.pl b/testbot/web/Stats.pl index 90f546397..64f29bdcd 100644 --- a/testbot/web/Stats.pl +++ b/testbot/web/Stats.pl @@ -22,6 +22,8 @@ use strict; package StatsPage; use ObjectModel::CGI::Page; +our @ISA = qw(ObjectModel::CGI::Page); + use ObjectModel::Collection; use WineTestBot::Config; use WineTestBot::Activity; @@ -29,7 +31,6 @@ use WineTestBot::Log; use WineTestBot::Utils; use WineTestBot::VMs; -(a)StatsPage::ISA = qw(ObjectModel::CGI::Page); sub _initialize($$$) { @@ -336,6 +337,7 @@ sub GenerateBody($) print "<p class='GeneralFooterText'>Generated in ", Elapsed($self->{start}), " s</p>\n"; } + package main; my $Request = shift; diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl index 9bf17814f..3b80841cc 100644 --- a/testbot/web/Submit.pl +++ b/testbot/web/Submit.pl @@ -21,6 +21,9 @@ use strict; package SubmitPage; +use ObjectModel::CGI::FreeFormPage; +our @ISA = qw(ObjectModel::CGI::FreeFormPage); + use CGI qw(:standard); use Fcntl; # For O_XXX use IO::Handle; @@ -28,7 +31,6 @@ use POSIX qw(:fcntl_h); # For SEEK_XXX use File::Basename; use ObjectModel::BasicPropertyDescriptor; -use ObjectModel::CGI::FreeFormPage; use WineTestBot::Branches; use WineTestBot::Config; use WineTestBot::Jobs; @@ -36,7 +38,6 @@ use WineTestBot::Engine::Notify; use WineTestBot::Utils; use WineTestBot::VMs; -(a)SubmitPage::ISA = qw(ObjectModel::CGI::FreeFormPage); sub _initialize($$$) { @@ -1006,6 +1007,7 @@ sub OnAction($$) return $self->SUPER::OnAction($Action); } + package main; my $Request = shift; diff --git a/testbot/web/admin/BranchDetails.pl b/testbot/web/admin/BranchDetails.pl index 36d946482..fe3ebd118 100644 --- a/testbot/web/admin/BranchDetails.pl +++ b/testbot/web/admin/BranchDetails.pl @@ -22,10 +22,10 @@ use strict; package BranchDetailsPage; use ObjectModel::CGI::ItemPage; -use WineTestBot::Config; +our @ISA = qw(ObjectModel::CGI::ItemPage); + use WineTestBot::Branches; -(a)BranchDetailsPage::ISA = qw(ObjectModel::CGI::ItemPage); sub _initialize($$$) { @@ -34,6 +34,7 @@ sub _initialize($$$) $self->SUPER::_initialize($Request, $RequiredRole, CreateBranches()); } + package main; my $Request = shift; diff --git a/testbot/web/admin/BranchesList.pl b/testbot/web/admin/BranchesList.pl index 716fbd713..7a496cddb 100644 --- a/testbot/web/admin/BranchesList.pl +++ b/testbot/web/admin/BranchesList.pl @@ -22,10 +22,11 @@ use strict; package BranchesListPage; use ObjectModel::CGI::CollectionPage; +our @ISA = qw(ObjectModel::CGI::CollectionPage); + use WineTestBot::Config; use WineTestBot::Branches; -(a)BranchesListPage::ISA = qw(ObjectModel::CGI::CollectionPage); sub _initialize($$$) { @@ -42,6 +43,7 @@ sub SortKeys($$$) return \@SortedKeys; } + package main; my $Request = shift; diff --git a/testbot/web/admin/Log.pl b/testbot/web/admin/Log.pl index 3ad35a476..8d6e52654 100644 --- a/testbot/web/admin/Log.pl +++ b/testbot/web/admin/Log.pl @@ -21,12 +21,13 @@ use strict; package LogPage; -use ObjectModel::BasicPropertyDescriptor; use ObjectModel::CGI::FreeFormPage; +our @ISA = qw(ObjectModel::CGI::FreeFormPage); + +use ObjectModel::BasicPropertyDescriptor; use WineTestBot::Config; use WineTestBot::Log; -(a)LogPage::ISA = qw(ObjectModel::CGI::FreeFormPage); sub _initialize($$$) { diff --git a/testbot/web/admin/UserDetails.pl b/testbot/web/admin/UserDetails.pl index 28eb4b5ca..2cf0f597f 100644 --- a/testbot/web/admin/UserDetails.pl +++ b/testbot/web/admin/UserDetails.pl @@ -23,11 +23,12 @@ use strict; package UserDetailsPage; use ObjectModel::CGI::ItemPage; +our @ISA = qw(ObjectModel::CGI::ItemPage); + use WineTestBot::CGI::Sessions; use WineTestBot::Config; use WineTestBot::Users; -(a)UserDetailsPage::ISA = qw(ObjectModel::CGI::ItemPage); sub _initialize($$$) { @@ -124,6 +125,7 @@ sub OnAction($$) return $self->SUPER::OnAction($Action); } + package main; my $Request = shift; diff --git a/testbot/web/admin/UsersList.pl b/testbot/web/admin/UsersList.pl index eb6c324c3..f46949d24 100644 --- a/testbot/web/admin/UsersList.pl +++ b/testbot/web/admin/UsersList.pl @@ -23,11 +23,12 @@ use strict; package UsersListPage; use ObjectModel::CGI::CollectionPage; +our @ISA = qw(ObjectModel::CGI::CollectionPage); + use WineTestBot::CGI::Sessions; use WineTestBot::Config; use WineTestBot::Users; -(a)UsersListPage::ISA = qw(ObjectModel::CGI::CollectionPage); sub _initialize($$$) { diff --git a/testbot/web/admin/VMDetails.pl b/testbot/web/admin/VMDetails.pl index 11cec4cf1..f883884c7 100644 --- a/testbot/web/admin/VMDetails.pl +++ b/testbot/web/admin/VMDetails.pl @@ -23,9 +23,10 @@ use strict; package VMDetailsPage; use ObjectModel::CGI::ItemPage; +our @ISA = qw(ObjectModel::CGI::ItemPage); + use WineTestBot::VMs; -(a)VMDetailsPage::ISA = qw(ObjectModel::CGI::ItemPage); sub _initialize($$$) { @@ -62,6 +63,7 @@ sub Save($) return ! defined($self->{ErrMessage}); } + package main; my $Request = shift; diff --git a/testbot/web/admin/VMsList.pl b/testbot/web/admin/VMsList.pl index 500442b5b..832c3bd4c 100644 --- a/testbot/web/admin/VMsList.pl +++ b/testbot/web/admin/VMsList.pl @@ -22,9 +22,10 @@ use strict; package VMsListPage; use ObjectModel::CGI::CollectionPage; +our @ISA = qw(ObjectModel::CGI::CollectionPage); + use WineTestBot::VMs; -(a)VMsListPage::ISA = qw(ObjectModel::CGI::CollectionPage); sub _initialize($$$) { @@ -65,6 +66,7 @@ sub OnItemAction($$$$) return $self->SUPER::OnItemAction($CollectionBlock, $Item, $Action); } + package main; my $Request = shift; -- 2.17.0
participants (1)
-
Francois Gouget