#!/usr/bin/env python
# -*- mode: python -*-
-import string, re, time, ldap, getopt, sys, pwd, os;
+import re, time, ldap, getopt, sys, pwd, os;
from userdir_gpg import *;
Output = "extrakeys.gpg";
Args = [GPGPath] + GPGBasicOptions;
for x in arguments:
Args.append("--keyring");
- if string.find(x,"/") == -1:
+ if x.find("/") == -1:
Args.append("./"+x);
else:
Args.append(x);
Args.append("--fast-list-mode");
Args.append("--list-sigs");
Args = Args + GPGSearchOptions + [" 2> /dev/null"]
-Keys = os.popen(string.join(Args," "),"r");
+Keys = os.popen(" ".join(Args),"r");
# Loop over the GPG key file
HaveKeys = {};
if Line == "":
break;
- Split = string.split(Line,":");
+ Split = Line.split(":");
if len(Split) >= 8 and Split[0] == "pub":
HaveKeys[Split[4]] = "";
continue;
Args = [GPGPath] + GPGBasicOptions;
for x in [Output]:
Args.append("--keyring");
- if string.find(x,"/") == -1:
+ if x.find("/") == -1:
Args.append("./"+x);
else:
Args.append(x);
OldArgs = Args;
Args = Args + GPGSearchOptions + [" 2> /dev/null"]
-Keys = os.popen(string.join(Args," "),"r");
+Keys = os.popen(" ".join(Args),"r");
print "Reading keys from output ring";
while(1):
if Line == "":
break;
- Split = string.split(Line,":");
+ Split = Line.split(":");
if len(Split) >= 8 and Split[0] == "pub":
HaveKeys[Split[4]] = "";
continue;
OldI = I;
I = I - 20;
if I < 0: I = 0;
- print string.join(Args+KeysToFetch[I:OldI]," ")
- Fetcher = os.popen(string.join(Args+KeysToFetch[I:OldI]," "),"r");
+ print " ".join(Args+KeysToFetch[I:OldI])
+ Fetcher = os.popen(" ".join(Args+KeysToFetch[I:OldI]),"r");
while(1):
Line = Fetcher.readline();
if Line == "":