|
From: <pf...@us...> - 2012-04-13 05:47:27
|
Revision: 748
http://openautomation.svn.sourceforge.net/openautomation/?rev=748&view=rev
Author: pfry
Date: 2012-04-13 05:47:21 +0000 (Fri, 13 Apr 2012)
Log Message:
-----------
dieses kleine Plugin hat sich f?\195?\131?\197?\146r mich als hilfreich erwiesen: es analysiert regelm?\195?\131?\226?\130?\172?\195?\131ig zu ALLEN Plugins die Namen der abonnierten GAs und zeigt sie ?\195?\131?\197?\146bersichtlich in der Webmin-Oberfl?\195?\131?\226?\130?\172che (unten bei den plugin_info-Variablen) an.
Dabei werden die Namen der GAs angezeigt, soweit definiert, ansonsten die numerischen GAs (ich pers?\195?\131?\194?\182nlich bevorzuge lesbare Namen!)
Falls sich bei einem Plugin die Liste der abonnierten GAs seit dem letzten Mal ge?\195?\131?\226?\130?\172ndert hat, gibt subscriptions.pl diese Liste zus?\195?\131?\226?\130?\172tzlich als return-Wert zur?\195?\131?\197?\146ck, so dass sie im plugin_log erscheint. Hilft beim Debuggen.
Added Paths:
-----------
wiregate/plugin/generic/Subscriptions.pl
Added: wiregate/plugin/generic/Subscriptions.pl
===================================================================
--- wiregate/plugin/generic/Subscriptions.pl (rev 0)
+++ wiregate/plugin/generic/Subscriptions.pl 2012-04-13 05:47:21 UTC (rev 748)
@@ -0,0 +1,57 @@
+#################
+# Subscriptions #
+#################
+# Wiregate-Plugin
+# (c) 2012 Fry under the GNU Public License version 2 or later
+
+# $plugin_info{$plugname.'_cycle'}=0; return "Subscriptions deaktiviert.";
+
+my %eibshort;
+
+for my $ga (keys %eibgaconf)
+{
+ next unless $eibgaconf{$ga}{name}=~/^(\S+)/;
+ my $short=$1;
+ $eibshort{$short}=$eibgaconf{$ga};
+ $eibshort{$short}{ga}=$ga;
+ $eibshort{$ga}=$short;
+}
+
+my %plugins=();
+
+delete $plugin_subscribe{''}; # delete stale subscriptions
+
+for my $ga (keys %plugin_subscribe)
+{
+ my $sh=$ga;
+ $sh=$eibshort{$ga} if defined $eibshort{$ga};
+
+ for my $pl (keys %{$plugin_subscribe{$ga}})
+ {
+ $plugins{$pl}{$sh}=1 if $plugin_subscribe{$ga}{$pl};
+ }
+}
+
+my @changedplugins=();
+
+for my $pl (keys %plugins)
+{
+ my $pluglist=join(',', sort grep { $plugins{$pl}{$_} } keys %{$plugins{$pl}});
+
+ $pluglist.=" => $pl";
+
+ unless($plugin_info{$plugname.'_'.$pl} eq $pluglist)
+ {
+ $plugin_info{$plugname.'_'.$pl} = $pluglist;
+ push @changedplugins, $pl;
+ }
+}
+
+my $retval="(".(join ") (", map { $plugin_info{$plugname."_".$_} } @changedplugins).")";
+
+$plugin_info{$plugname.'_cycle'}=10;
+
+return if $retval eq '()';
+
+return $retval;
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|