summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Weller <ianweller@gmail.com>2008-09-28 23:06:54 -0500
committerIan Weller <ianweller@gmail.com>2008-09-28 23:06:54 -0500
commit2d7cffd750006341895d2f20dfa2b4892c421714 (patch)
tree2e4f76f90c6e86edafc34ae25565b2ef59d2281f
parent98c7dccc32938d3c3066c83bd5498004b68efe4a (diff)
downloadfedora-business-cards-2d7cffd750006341895d2f20dfa2b4892c421714.zip
fedora-business-cards-2d7cffd750006341895d2f20dfa2b4892c421714.tar.gz
fedora-business-cards-2d7cffd750006341895d2f20dfa2b4892c421714.tar.xz
Setup FAS login and info fetching
-rw-r--r--fedora_business_cards/frontend.py14
-rw-r--r--fedora_business_cards/generate.py4
-rw-r--r--fedora_business_cards/information.py4
3 files changed, 19 insertions, 3 deletions
diff --git a/fedora_business_cards/frontend.py b/fedora_business_cards/frontend.py
index cf162f7..59ce189 100644
--- a/fedora_business_cards/frontend.py
+++ b/fedora_business_cards/frontend.py
@@ -23,9 +23,13 @@ whatnot, but for now just has a command-line interface.
"""
from optparse import OptionParser
-import config
import os
import sys
+from getpass import getpass
+
+# local imports
+import config
+import information
def cmdline():
"""
@@ -75,3 +79,11 @@ def cmdline():
if options.template not in available_templates:
print "%s not an available template" % options.template
sys.exit(1)
+ # ask for FAS login
+ print "Login to FAS:"
+ print "Username:",
+ username = raw_input()
+ password = getpass()
+ if options.username == "":
+ options.username = username
+ infodict = information.get_information(username, password, options.username)
diff --git a/fedora_business_cards/generate.py b/fedora_business_cards/generate.py
index 5a92039..aa22485 100644
--- a/fedora_business_cards/generate.py
+++ b/fedora_business_cards/generate.py
@@ -22,7 +22,9 @@ Generates both sides of the business card.
"""
from xml.dom import minidom
-from . import config
+
+# local imports
+import config
def find_node(doc_node, tag_name, attribute_name, attribute_value):
diff --git a/fedora_business_cards/information.py b/fedora_business_cards/information.py
index 9fbaf48..8717c4a 100644
--- a/fedora_business_cards/information.py
+++ b/fedora_business_cards/information.py
@@ -24,7 +24,9 @@ Assembles information about a person from FAS and their GPG key.
from fedora.client.fas2 import AccountSystem
import gpgme
import re
-from . import exceptions
+
+# local imports
+import exceptions
def get_gpg_fingerprint(keyid):