Permalink
Browse files

SignKey: install gnome-keysign-sign-key

We intend to have this script installed by setuptools, so that the user
can run it. The old filename prevented that, because it's not possible
to import modules with a hyphen. At least not easily.
  • Loading branch information...
muelli committed Jun 26, 2018
1 parent d2cc5b3 commit e109081a33825a8e4f8aa9f214308bb4fdbbc188
Showing with 14 additions and 10 deletions.
  1. +11 −7 keysign/{gnome-keysign-sign-key.py → SignKey.py}
  2. +3 −3 setup.py
@@ -25,14 +25,18 @@
input = raw_input
def main(args):
def main():
import argparse
parser = argparse.ArgumentParser(description="Sign an OpenPGP key from a file. The program will open each file, exrtact exactly one OpenPGP key, sign each UID separately, encrypt and send each signed UID using xdg-email.")
parser.add_argument("file", nargs='+', type=argparse.FileType('rb'),
help="File containing OpenPGP keys")
args = parser.parse_args()
log = logging.getLogger(__name__)
log.debug('Running main with args: %s', args)
if not args:
raise ValueError("You need to give filesnames as args: %s" % args)
for fname in args:
data = open(fname, 'rb').read()
log.info("Calling %r to sign %s", sign_keydata_and_send, fname)
for fhandle in args.file:
data = fhandle.read()
log.info("Calling %r to sign %s", sign_keydata_and_send, fhandle.name)
tmpfiles = list(sign_keydata_and_send(keydata=data))
log.info("Finished signing. " +
"We're only waiting for the signature " +
@@ -44,4 +48,4 @@ def main(args):
if __name__ == '__main__':
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG,
format='%(name)s (%(levelname)s): %(message)s')
sys.exit(main(sys.argv[1:]))
sys.exit(main())
View
@@ -240,9 +240,9 @@ def run_tests(self):
long_description=open('README.rst').read(),
entry_points = {
#'console_scripts': [
# 'keysign = keysign.main'
#],
'console_scripts': [
'gnome-keysign-sign-key = keysign.SignKey:main'
],
'gui_scripts': [
'gnome-keysign = keysign:main',
'gks-qrcode = keysign.GPGQRCode:main',

0 comments on commit e109081

Please sign in to comment.