From 9ea70ddcd675ade0ea22feab84dc4137559dd24e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 16 Mar 2012 09:07:36 +0100 Subject: first external module --- Loadbars/.Constants.pm.swp | Bin 0 -> 12288 bytes Loadbars/Constants.pm | 39 +++++++++++++++++++++++++++++++++++++++ loadbars | 43 ++++--------------------------------------- 3 files changed, 43 insertions(+), 39 deletions(-) create mode 100644 Loadbars/.Constants.pm.swp create mode 100755 Loadbars/Constants.pm diff --git a/Loadbars/.Constants.pm.swp b/Loadbars/.Constants.pm.swp new file mode 100644 index 0000000..ff130ab Binary files /dev/null and b/Loadbars/.Constants.pm.swp differ diff --git a/Loadbars/Constants.pm b/Loadbars/Constants.pm new file mode 100755 index 0000000..c275f92 --- /dev/null +++ b/Loadbars/Constants.pm @@ -0,0 +1,39 @@ +package Loadbars::Constants; + +use strict; +use warnings; + +use SDL::Color; + +use constant { + VERSION => 'loadbars v0.5.2-devel', + COPYRIGHT => '2010-2012 (c) Paul Buetow ', + CONFFILE => $ENV{HOME} . '/.loadbarsrc', + CSSH_CONFFILE => '/etc/clusters', + CSSH_MAX_RECURSION => 10, + COLOR_DEPTH => 8, + BLACK => SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0x00 ), + BLUE0 => SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0xff ), + BLUE => SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0x88 ), + GREEN => SDL::Color->new( -r => 0x00, -g => 0x90, -b => 0x00 ), + ORANGE => SDL::Color->new( -r => 0xff, -g => 0x70, -b => 0x00 ), + PURPLE => SDL::Color->new( -r => 0xa0, -g => 0x20, -b => 0xf0 ), + RED => SDL::Color->new( -r => 0xff, -g => 0x00, -b => 0x00 ), + WHITE => SDL::Color->new( -r => 0xff, -g => 0xff, -b => 0xff ), + GREY0 => SDL::Color->new( -r => 0x11, -g => 0x11, -b => 0x11 ), + GREY => SDL::Color->new( -r => 0xaa, -g => 0xaa, -b => 0xaa ), + DARK_GREY => SDL::Color->new( -r => 0x15, -g => 0x15, -b => 0x15 ), + YELLOW0 => SDL::Color->new( -r => 0xff, -g => 0xa0, -b => 0x00 ), + YELLOW => SDL::Color->new( -r => 0xff, -g => 0xc0, -b => 0x00 ), + SYSTEM_BLUE0 => 30, + USER_ORANGE => 70, + USER_YELLOW0 => 50, + INTERVAL => 0.1, + INTERVAL_WARN => 1.0, + SUCCESS => 0, + E_UNKNOWN => 1, + E_NOHOST => 2, +}; + +1; + diff --git a/loadbars b/loadbars index b3026a9..bfdda8b 100755 --- a/loadbars +++ b/loadbars @@ -4,45 +4,6 @@ # E-Mail: loadbars@mx.buetow.org WWW: http://loadbars.buetow.org # For legal informations see COPYING and COPYING.FONT -package Loadbars::Constants; - -use strict; -use warnings; - -use SDL::Color; - -use constant { - VERSION => 'loadbars v0.5.2-devel', - COPYRIGHT => '2010-2012 (c) Paul Buetow ', - CONFFILE => $ENV{HOME} . '/.loadbarsrc', - CSSH_CONFFILE => '/etc/clusters', - CSSH_MAX_RECURSION => 10, - COLOR_DEPTH => 8, - BLACK => SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0x00 ), - BLUE0 => SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0xff ), - BLUE => SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0x88 ), - GREEN => SDL::Color->new( -r => 0x00, -g => 0x90, -b => 0x00 ), - ORANGE => SDL::Color->new( -r => 0xff, -g => 0x70, -b => 0x00 ), - PURPLE => SDL::Color->new( -r => 0xa0, -g => 0x20, -b => 0xf0 ), - RED => SDL::Color->new( -r => 0xff, -g => 0x00, -b => 0x00 ), - WHITE => SDL::Color->new( -r => 0xff, -g => 0xff, -b => 0xff ), - GREY0 => SDL::Color->new( -r => 0x11, -g => 0x11, -b => 0x11 ), - GREY => SDL::Color->new( -r => 0xaa, -g => 0xaa, -b => 0xaa ), - DARK_GREY => SDL::Color->new( -r => 0x15, -g => 0x15, -b => 0x15 ), - YELLOW0 => SDL::Color->new( -r => 0xff, -g => 0xa0, -b => 0x00 ), - YELLOW => SDL::Color->new( -r => 0xff, -g => 0xc0, -b => 0x00 ), - SYSTEM_BLUE0 => 30, - USER_ORANGE => 70, - USER_YELLOW0 => 50, - INTERVAL => 0.1, - INTERVAL_WARN => 1.0, - SUCCESS => 0, - E_UNKNOWN => 1, - E_NOHOST => 2, -}; - -1; - package Loadbars; use strict; @@ -64,6 +25,8 @@ use Proc::ProcessTable; use threads; use threads::shared; +use Loadbars::Constants; + $| = 1; my %PIDS : shared; @@ -1242,6 +1205,8 @@ use warnings; use Getopt::Long; +use Loadbars::Constants; + sub main () { my ( $hosts, $dispatch ) = Loadbars::dispatch_table; my $usage; -- cgit v1.2.3