mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 22:09:26 +01:00
Sort Dumper output by keys
This commit is contained in:
parent
54f025e483
commit
55347ea463
@ -18,6 +18,7 @@ use strict;
|
|||||||
use Time::HiRes qw/gettimeofday/;
|
use Time::HiRes qw/gettimeofday/;
|
||||||
use Time::Duration;
|
use Time::Duration;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
$Data::Dumper::Sortkeys = 1;
|
||||||
use Carp ();
|
use Carp ();
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
@ -60,11 +61,12 @@ sub get_banlist {
|
|||||||
my ($self, $event_type, $event) = @_;
|
my ($self, $event_type, $event) = @_;
|
||||||
my $channel = lc $event->{event}->{args}[1];
|
my $channel = lc $event->{event}->{args}[1];
|
||||||
|
|
||||||
|
return 0 if not $self->{pbot}->{chanops}->can_gain_ops($channel);
|
||||||
|
|
||||||
delete $self->{banlist}->{$channel};
|
delete $self->{banlist}->{$channel};
|
||||||
|
|
||||||
$self->{pbot}->{logger}->log("Retrieving banlist for $channel.\n");
|
$self->{pbot}->{logger}->log("Retrieving banlist for $channel.\n");
|
||||||
$event->{conn}->sl("mode $channel +b");
|
$event->{conn}->sl("mode $channel +bq");
|
||||||
$event->{conn}->sl("mode $channel +q");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ sub add {
|
|||||||
my ($self, $index_key, $hash) = @_;
|
my ($self, $index_key, $hash) = @_;
|
||||||
|
|
||||||
if($self->load_hash_add($index_key, $hash, 0)) {
|
if($self->load_hash_add($index_key, $hash, 0)) {
|
||||||
$self->save_();
|
$self->save();
|
||||||
} else {
|
} else {
|
||||||
return "Error occurred adding new $self->{name} object.";
|
return "Error occurred adding new $self->{name} object.";
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ use strict;
|
|||||||
use Carp();
|
use Carp();
|
||||||
use Time::HiRes qw(gettimeofday);
|
use Time::HiRes qw(gettimeofday);
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
$Data::Dumper::Sortkeys = 1;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
if(ref($_[1]) eq 'HASH') {
|
if(ref($_[1]) eq 'HASH') {
|
||||||
|
@ -16,6 +16,7 @@ use strict;
|
|||||||
|
|
||||||
use Text::Levenshtein qw/fastdistance/;
|
use Text::Levenshtein qw/fastdistance/;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
$Data::Dumper::Sortkeys = 1;
|
||||||
use Carp ();
|
use Carp ();
|
||||||
use Time::HiRes qw/gettimeofday/;
|
use Time::HiRes qw/gettimeofday/;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user