summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Weller <ianweller@gmail.com>2008-11-02 11:18:22 -0600
committerIan Weller <ianweller@gmail.com>2008-11-02 11:18:22 -0600
commitb52c70d07c2ebcefc0b5ec5cb964e0ae0f9974b8 (patch)
treee444e42f72537c6860284d936c654bda138448d0
parentc798f50a8f554f33777668aa57f5017197fa9040 (diff)
downloadfedora-business-cards-b52c70d07c2ebcefc0b5ec5cb964e0ae0f9974b8.zip
fedora-business-cards-b52c70d07c2ebcefc0b5ec5cb964e0ae0f9974b8.tar.gz
fedora-business-cards-b52c70d07c2ebcefc0b5ec5cb964e0ae0f9974b8.tar.xz
Modularize frontend system
-rwxr-xr-xfedora-business-cards18
-rw-r--r--fedora_business_cards/frontend/__init__.py0
-rw-r--r--fedora_business_cards/frontend/cmdline.py (renamed from fedora_business_cards/frontend.py)17
3 files changed, 17 insertions, 18 deletions
diff --git a/fedora-business-cards b/fedora-business-cards
index 5f7183f..a11d473 100755
--- a/fedora-business-cards
+++ b/fedora-business-cards
@@ -24,12 +24,12 @@ module.
"""
import sys
-try:
- from fedora_business_cards import frontend
- frontend.cmdline()
-except ImportError:
- print >> sys.stderr, """\
-There was a problem importing the fedora_business_cards module. Please make
-sure that you have fedora-business-cards installed properly.
-"""
- sys.exit(1)
+#try:
+from fedora_business_cards.frontend import cmdline
+cmdline.main()
+#except ImportError:
+# print >> sys.stderr, """\
+#There was a problem importing the fedora_business_cards module. Please make
+#sure that you have fedora-business-cards installed properly.
+#"""
+# sys.exit(1)
diff --git a/fedora_business_cards/frontend/__init__.py b/fedora_business_cards/frontend/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/fedora_business_cards/frontend/__init__.py
diff --git a/fedora_business_cards/frontend.py b/fedora_business_cards/frontend/cmdline.py
index bb7764f..1b36998 100644
--- a/fedora_business_cards/frontend.py
+++ b/fedora_business_cards/frontend/cmdline.py
@@ -18,8 +18,8 @@
###
"""
-Frontend to the business card generator. Theoretically expandable to GUI and
-whatnot, but for now just has a command-line interface.
+Command-line interface to business card generator. Takes no arguments; uses
+optparser.OptionParser instead.
"""
from optparse import OptionParser
@@ -28,10 +28,10 @@ import sys
from getpass import getpass
# local imports
-import config
-import information
-import generate
-import export
+from .. import config
+from .. import information
+from .. import generate
+from .. import export
def cmdline_card_line(data):
@@ -41,10 +41,9 @@ def cmdline_card_line(data):
return "| %s%s |" % (data, ' '*(59-len(data)))
-def cmdline():
+def main():
"""
- Command-line interface to business card generator. Takes no arguments; uses
- optparser.OptionParser instead.
+ Call this to make things happen.
"""
# setup option parser
parser = OptionParser()