[Pkg-privacy-commits] [msva-perl] 138/356: successfully deal with at least one prompt per msva run :/
Ximin Luo
infinity0 at moszumanska.debian.org
Mon Aug 24 07:41:49 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository msva-perl.
commit 06658961bc7ff223dd6a9ca42c21ea3233bcba2a
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date: Sun Oct 3 22:13:45 2010 -0400
successfully deal with at least one prompt per msva run :/
---
Crypt/Monkeysphere/MSVA/MarginalUI.glade | 4 +-
Crypt/Monkeysphere/MSVA/MarginalUI.pm | 66 +++++++++++++-------------------
msva-perl | 6 +++
3 files changed, 35 insertions(+), 41 deletions(-)
diff --git a/Crypt/Monkeysphere/MSVA/MarginalUI.glade b/Crypt/Monkeysphere/MSVA/MarginalUI.glade
index c8f2003..fe3bb9e 100644
--- a/Crypt/Monkeysphere/MSVA/MarginalUI.glade
+++ b/Crypt/Monkeysphere/MSVA/MarginalUI.glade
@@ -32,7 +32,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
- <signal name="clicked" handler="Crypt::Monkeysphere::MSVA::MarginalUI::on_yesButton_clicked"/>
+ <signal name="clicked" handler="on_yesButton_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -47,7 +47,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
- <signal name="clicked" handler="Crypt::Monkeysphere::MSVA::MarginalUI::on_noButton_clicked" object="no"/>
+ <signal name="clicked" handler="on_noButton_clicked" object="no"/>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/Crypt/Monkeysphere/MSVA/MarginalUI.pm b/Crypt/Monkeysphere/MSVA/MarginalUI.pm
index 8bcfec7..d544c24 100755
--- a/Crypt/Monkeysphere/MSVA/MarginalUI.pm
+++ b/Crypt/Monkeysphere/MSVA/MarginalUI.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl -w
-
#----------------------------------------------------------------------
# marginalUI
#
@@ -11,51 +9,41 @@
{ package Crypt::Monkeysphere::MSVA::MarginalUI;
-use strict;
-use warnings;
-
-use Gtk2 '-init'; # auto-initializes Gtk2
-use Gtk2::GladeXML;
+ use strict;
+ use warnings;
-my $glade;
-my $label;
+ my $resp = 0;
-# populate UI from
-$glade = Gtk2::GladeXML->new("Crypt/Monkeysphere/MSVA/MarginalUI.glade");
+ sub prompt {
+ use Gtk2 '-init'; # auto-initializes Gtk2
+ use Gtk2::GladeXML;
-# Connect the signals
-$glade->signal_autoconnect_from_package('main');
+ my $glade;
+ my $label;
-$label = $glade->get_widget('messageLabel');
-my $labeltxt = <<'END';
-pub 4096R/E27BAABC 2007-01-08 [expires: 2012-01-07]
-uid [ full ] Jameson Graef Rollins <jrollins at finestructure.net>
-uid [ full ] Jameson Graef Rollins <jrollins at phys.columbia.edu>
-uid [ full ] Jameson Graef Rollins <jrollins at fifthhorseman.net>
-uid [ full ] Jameson Graef Rollins <jrollins at astro.columbia.edu>
-uid [ full ] Jameson Rollins <jrollins at fifthhorseman.net>
-uid [ full ] Jameson Graef Rollins <jameson.rollins at ligo.org>
-uid [ full ] [jpeg image of size 4097]
-uid [marginal] Jameson Rollins <jrollins at finestructure.net>
-sub 4096R/1321E689 2007-01-09 [expires: 2012-01-08]
-sub 2048R/4414A10A 2008-06-18 [expires: 2013-06-17]
+ # populate UI from
+ $glade = Gtk2::GladeXML->new("Crypt/Monkeysphere/MSVA/MarginalUI.glade");
-Do you trust this dude?
-END
-$label->set_text($labeltxt);
+ # Connect the signals
+ $glade->signal_autoconnect_from_package('Crypt::Monkeysphere::MSVA::MarginalUI');
+ $label = $glade->get_widget('messageLabel');
-# Start it up
-Gtk2->main;
+ my $labeltxt = shift;
+ $label->set_text($labeltxt);
-exit 0;
+ # Start it up
+ Gtk2->main;
-sub on_yesButton_clicked {
- exit 0;
-}
-sub on_noButton_clicked {
- exit 1;
-}
+ return $resp;
+ }
-1;
+ sub on_yesButton_clicked {
+ $resp = 1;
+ Gtk2->main_quit;
+ }
+ sub on_noButton_clicked {
+ Gtk2->main_quit;
+ }
+ 1;
}
diff --git a/msva-perl b/msva-perl
index 45f1ce7..df5e548 100755
--- a/msva-perl
+++ b/msva-perl
@@ -573,6 +573,12 @@ use strict;
$certifier_list,
);
msvalog('info', "%s\n", $msg);
+ my $resp = Crypt::Monkeysphere::MSVA::MarginalUI::prompt($msg);
+ msvalog('info', "response: %s\n", $resp);
+ if ($resp) {
+ $ret->{valid} = JSON::true;
+ $ret->{message} = sprintf('Manually validated "%s" through the OpenPGP Web of Trust.', $uid);
+ }
}
# FIXME: not doing anything with @marginal_certifiers
# -- that'd be yet more queries to gpg :(
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/msva-perl.git
More information about the Pkg-privacy-commits
mailing list