diff options
| author | pbuetow <puppet@mx.buetow.org> | 2012-07-04 19:31:37 +0200 |
|---|---|---|
| committer | pbuetow <puppet@mx.buetow.org> | 2012-07-04 19:31:37 +0200 |
| commit | 64e01e90742fcaca0e85e68dc11d970a39b2cbbd (patch) | |
| tree | a224295a161171c497966a618f0ae7550b93b95d | |
| parent | 5692c8a1210340ed38bbbf4c1097b4609f25de7b (diff) | |
perltidy
| -rw-r--r-- | lib/Loadbars/HelpDispatch.pm | 16 | ||||
| -rw-r--r-- | lib/Loadbars/Main.pm | 33 |
2 files changed, 27 insertions, 22 deletions
diff --git a/lib/Loadbars/HelpDispatch.pm b/lib/Loadbars/HelpDispatch.pm index 36e0e78..d29e605 100644 --- a/lib/Loadbars/HelpDispatch.pm +++ b/lib/Loadbars/HelpDispatch.pm @@ -112,8 +112,12 @@ END mode => 6, type => 's' }, - netint_hot => - { menupos => 17, cmd => 'n', help => 'Iterate to next net interface', mode => 1 }, + netint_hot => { + menupos => 17, + cmd => 'n', + help => 'Iterate to next net interface', + mode => 1 + }, netlink => { menupos => 6, @@ -125,14 +129,14 @@ END netlink_hot_up => { menupos => 9, cmd => 'f', - help => 'Increases net interface link speed reference by factor 10', - mode => 1 + help => 'Increases net interface link speed reference by factor 10', + mode => 1 }, netlink_hot_dn => { menupos => 10, cmd => 'v', - help => 'Decreases net interface link speed reference by factor 10', - mode => 1 + help => 'Decreases net interface link speed reference by factor 10', + mode => 1 }, barwidth => { diff --git a/lib/Loadbars/Main.pm b/lib/Loadbars/Main.pm index 9213627..9ec0721 100644 --- a/lib/Loadbars/Main.pm +++ b/lib/Loadbars/Main.pm @@ -37,7 +37,7 @@ sub percentage ($$) { } sub max_100 ($) { - return $_[0] > 100 ? 100 : $_[0]; + return $_[0] > 100 ? 100 : $_[0]; } sub percentage_norm ($$$) { @@ -608,9 +608,10 @@ sub loop ($@) { } elsif ( $key_name eq 'v' ) { $net_max_bytes = int( $net_max_bytes / 10 ); - $net_max_bytes = $I{bytes_mbit} if $net_max_bytes < $I{bytes_mbit}; + $net_max_bytes = $I{bytes_mbit} + if $net_max_bytes < $I{bytes_mbit}; display_info "Set net interface speed reference to " - . int ( $net_max_bytes / $I{bytes_mbit} ) + . int( $net_max_bytes / $I{bytes_mbit} ) . 'mbit/s'; } @@ -905,7 +906,7 @@ sub loop ($@) { $net_last_value{"$key;tper"} = $tnet_per; } - my $net_per_100 = max_100 $net_per; + my $net_per_100 = max_100 $net_per; my $tnet_per_100 = max_100 $tnet_per; %heights = ( @@ -943,18 +944,17 @@ sub loop ($@) { $app->fill( $rect_netused, Loadbars::Constants->BLACK ); $app->fill( $rect_netfree, - $net_per > 100 - ? Loadbars::Constants->GREEN - : Loadbars::Constants->LIGHT_GREEN ); + $net_per > 100 + ? Loadbars::Constants->GREEN + : Loadbars::Constants->LIGHT_GREEN ); $app->fill( $rect_tnetused, - $tnet_per > 100 - ? Loadbars::Constants->GREEN - : Loadbars::Constants->LIGHT_GREEN ); + $tnet_per > 100 + ? Loadbars::Constants->GREEN + : Loadbars::Constants->LIGHT_GREEN ); $app->fill( $rect_tnetfree, Loadbars::Constants->BLACK ); - if ( $C{showtext} ) { my $y_ = 5; $app->print( $x + $add_x, $y_, $net_int ); @@ -976,21 +976,22 @@ sub loop ($@) { ); } - # No netstats available for this host;device pair. - } else { + # No netstats available for this host;device pair. + } + else { $rect_netused->width($width); $rect_netused->height( $C{height} ); $rect_netused->x( $x + $add_x ); $rect_netused->y($y); - $app->fill( $rect_netused, Loadbars::Constants->RED ); + $app->fill( $rect_netused, Loadbars::Constants->RED ); $app->fill( $rect_tnetused, Loadbars::Constants->RED ); - $app->fill( $rect_netfree, Loadbars::Constants->RED ); + $app->fill( $rect_netfree, Loadbars::Constants->RED ); $app->fill( $rect_tnetfree, Loadbars::Constants->RED ); if ( $C{showtext} ) { my $y_ = 5; - $app->print( $x + $add_x, $y_, $net_int); + $app->print( $x + $add_x, $y_, $net_int ); $app->print( $x + $add_x, $y_ += $sdl_font_height, 'n/a' ); } |
