[geneagrapher] 147/226: Cleaned up entry point by migrating it to geneagrapher.py.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sat Jul 11 17:10:56 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository geneagrapher.

commit 3bd0e675e74008f3cd5514e18457a2b6a9ad5c0f
Author: David Alber <alber.david at gmail.com>
Date:   Sun Oct 30 10:03:54 2011 -0700

    Cleaned up entry point by migrating it to geneagrapher.py.
---
 geneagrapher/geneagrapher.py | 14 ++++++++------
 geneagrapher/ggrapher.py     | 13 -------------
 setup.py                     |  2 +-
 3 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/geneagrapher/geneagrapher.py b/geneagrapher/geneagrapher.py
index af1b990..f94caa8 100644
--- a/geneagrapher/geneagrapher.py
+++ b/geneagrapher/geneagrapher.py
@@ -122,12 +122,14 @@ class Geneagrapher:
         else:
             print dotfile
         
-if __name__ == "__main__":
-    geneagrapher = Geneagrapher()
+def ggrapher():
+    """Function to run the Geneagrapher. This is the function called when
+    the ggrapher script is run."""
+    ggrapher = Geneagrapher()
     try:
-        geneagrapher.parse_input()
+        ggrapher.parse_input()
     except SyntaxError, e:
-        print geneagrapher.parser.get_usage()
+        print ggrapher.parser.get_usage()
         print e
-    geneagrapher.build_graph()
-    geneagrapher.generate_dot_file()
+    ggrapher.build_graph()
+    ggrapher.generate_dot_file()
diff --git a/geneagrapher/ggrapher.py b/geneagrapher/ggrapher.py
deleted file mode 100644
index bb17024..0000000
--- a/geneagrapher/ggrapher.py
+++ /dev/null
@@ -1,13 +0,0 @@
-import geneagrapher
-
-def ggrapher():
-    """Function to run the Geneagrapher. This is the function called when
-    the ggrapher script is run."""
-    ggrapher = geneagrapher.Geneagrapher()
-    try:
-        ggrapher.parse_input()
-    except SyntaxError, e:
-        print ggrapher.parser.get_usage()
-        print e
-    ggrapher.build_graph()
-    ggrapher.generate_dot_file()
diff --git a/setup.py b/setup.py
index c3f54ac..1b7b1df 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ genealogies using data from the Math Genealogy Project's website.
       install_requires=[],
       entry_points = {
         'console_scripts': [
-            'ggrapher = geneagrapher.ggrapher:ggrapher'
+            'ggrapher = geneagrapher.geneagrapher:ggrapher'
         ]
       },
       test_suite = "tests.tests"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/geneagrapher.git



More information about the debian-science-commits mailing list