aboutsummaryrefslogtreecommitdiffstats
path: root/readpass.py
diff options
context:
space:
mode:
Diffstat (limited to 'readpass.py')
-rwxr-xr-xreadpass.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/readpass.py b/readpass.py
index c6c50f5..b439b1f 100755
--- a/readpass.py
+++ b/readpass.py
@@ -4,10 +4,19 @@
from utils import pycsc
import utils, cards, TLV_utils, sys, binascii, time, traceback
+OPTIONS = "G"
+LONG_OPTIONS = ["no-gui"]
+
+use_gui = True
+
if __name__ == "__main__":
c = utils.CommandLineArgumentHelper()
- (options, arguments) = c.getopt(sys.argv[1:])
+ (options, arguments) = c.getopt(sys.argv[1:], OPTIONS, LONG_OPTIONS)
+
+ for option, value in options:
+ if option in ("-G","--no-gui"):
+ use_gui = False
pycsc_card = c.connect()
card = cards.new_card_object(pycsc_card)
@@ -22,3 +31,9 @@ if __name__ == "__main__":
else:
p = cards.passport_application.Passport.from_card(card)
+ if use_gui:
+ import gui
+
+ g = gui.PassportGUI()
+ g.set_passport(p)
+ g.run()