-
Notifications
You must be signed in to change notification settings - Fork 14
/
pyrite.py
executable file
·91 lines (72 loc) · 3.13 KB
/
pyrite.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of Pyrite.
# Last file mod: 2013/09/15
# Latest version at <http://github.com/ryran/pyrite>
# Copyright 2012, 2013 Ryan Sawhill Aroha <[email protected]>
#
# License:
#
# Pyrite is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrite is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Pyrite. If not, see <http://gnu.org/licenses/gpl.html>.
#
#------------------------------------------------------------------------------
#
# TODO:
# * Icons for for encrypt, decrypt, sign, verify buttons, application
# * Undo stack. Blech. Kill me.
# * Update notifications
# * BUG: First drag/drop onto FileChooserButton fails; 2nd, 3rd, etc succeed.
# It's a GTK+ issue. Reported. bugzilla.gnome.org/show_bug.cgi?id=669718
#
#------------------------------------------------------------------------------
import argparse
from sys import argv
import modules.core
# Parse command-line arguments
parser = argparse.ArgumentParser(
prog='pyrite',
description="GnuPG/OpenSSL GUI to encrypt, decrypt, sign, or verify files/"
"ASCII text input.")
parser.add_argument('input', metavar='INPUT', nargs='?',
help="ascii input file to populate Message area with (NOTE"
": treatment of INPUT is modified by '-t' & '-d')")
g2 = parser.add_mutually_exclusive_group()
g2.add_argument('-d', '--direct-file', action='store_true',
help="flag INPUT as a file path to open in direct-mode")
g2.add_argument('-t', '--text-input', action='store_true',
help="flag INPUT as text instead of a file path")
g1 = parser.add_mutually_exclusive_group()
g1.add_argument('-e', '--encdec', action='store_true',
help="enable encrypt/decrypt mode")
g1.add_argument('-s', '--signverify', action='store_true',
help="enable sign/verify mode")
parser.add_argument('-c', '--symmetric', action='store_true',
help="enable symmetric encryption mode")
parser.add_argument('-r', '--recipients', metavar='RECIP',
help="recipients for asymmetric mode (semicolon-separated)")
parser.add_argument('-k', '--defaultkey', metavar='KEYUID',
help="override default gpg private key")
parser.add_argument('-b', '--backend', choices=('gpg', 'openssl'),
help="backend program to use as encryption engine")
args = parser.parse_args()
# If no cmdline options specified, let's save some cycles later
if len(argv) == 1: args = None
if __name__ == "__main__":
FeS2 = modules.core.Pyrite(args)
try:
FeS2.main()
except KeyboardInterrupt:
print
exit()