lists.arthurdejong.org
RSS feed

webcheck commit: r467 - webcheck

[Date Prev][Date Next] [Thread Prev][Thread Next]

webcheck commit: r467 - webcheck



Author: devin
Date: Wed Nov 16 12:40:39 2011
New Revision: 467
URL: http://arthurdejong.org/viewvc/webcheck?revision=467&view=revision

Log:
add entry_point webcheck

Added:
   webcheck/cmd.py
Modified:
   webcheck/setup.py

Added: webcheck/cmd.py
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ webcheck/cmd.py     Wed Nov 16 12:40:39 2011        (r467)
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+
+# cmd.py - command-line front-end for webcheck
+#
+# Copyright (C) 1998, 1999 Albert Hopkins (marduk)
+# Copyright (C) 2002 Mike W. Meyer
+# Copyright (C) 2005, 2006, 2007, 2008, 2010, 2011 Arthur de Jong
+#
+# This program 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 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# The files produced as output from the software do not automatically fall
+# under the copyright of the software, unless explicitly stated otherwise.
+
+"""This is the main webcheck module."""
+
+from webcheck.cmd import entry_point
+
+if __name__ == '__main__':
+    try:
+        if PROFILE:
+            fname = os.path.join(config.OUTPUT_DIR, 'webcheck.prof')
+            try:
+                import cProfile
+            except ImportError:
+                import profile as cProfile
+            try:
+                import sqltap
+                sqltap.start()
+            except ImportError:
+                pass
+            cProfile.run('entry_point()', fname)
+            if 'sqltap' in locals():
+                statistics = sqltap.collect()
+                sqltap.report(statistics, os.path.join(config.OUTPUT_DIR, 
'sqltap.html'))
+        else:
+            entry_point()
+    except KeyboardInterrupt:
+        sys.stderr.write('Interrupted\n')
+        sys.exit(1)

Modified: webcheck/setup.py
==============================================================================
--- webcheck/setup.py   Wed Nov 16 12:40:16 2011        (r466)
+++ webcheck/setup.py   Wed Nov 16 12:40:39 2011        (r467)
@@ -3,8 +3,12 @@
     name = 'webcheck',
     version = '1.10.5a',
     packages = find_packages(),
-    scripts = ['cmd.py'],
-    install_requires = ['distribute', 'sqlalchemy'],
+    entry_points = {
+        'console_scripts': [
+            'webcheck = webcheck.cmd:entry_point',
+        ],
+    },
+    install_requires = ['setuptools', 'sqlalchemy'],
     extras_require = {
         'tidy': ['utidylib'],
         'soup': ['beautifulsoup'],
-- 
To unsubscribe send an email to
webcheck-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/webcheck-commits/