~jdstrand/ufw/trunk

« back to all changes in this revision

Viewing changes to src/ufw

  • Committer: Jamie Strandboge
  • Date: 2008-01-20 23:02:35 UTC
  • Revision ID: jamie@ubuntu.com-20080120230235-8g7x8q3c0cikprf2
use distutils instead of install.py
 - created setup.py
 - removed install.py
 - updated run_tests.sh
 - updates README and TODO
 - updated debian/rules
bump version
moved stuff around
require python 2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import sys
27
27
from tempfile import mkstemp
28
28
 
29
 
version = "0.0"
 
29
version = "#VERSION#"
30
30
programName = os.path.basename(sys.argv[0])
31
31
 
32
 
# Make sure we are at least version 2.4
33
32
if sys.version_info[0] < 2 or sys.version_info[1] < 5:
34
33
    print >> sys.stderr, programName + ": Need at least python 2.5\n"
35
34
    sys.exit(1)
60
59
        print_help()
61
60
        sys.exit(1)
62
61
 
63
 
    allowed_cmds = ['enable', 'disable', 'help', 'default', 'logging', 
64
 
                    'status', 'version', 'allow', 'deny' ]
 
62
    allowed_cmds = ['enable', 'disable', 'help', '--help', 'default', \
 
63
                    'logging', 'status', 'version', '--version', 'allow', \
 
64
                    'deny' ]
65
65
 
66
66
    if not sys.argv[1].lower() in allowed_cmds:
67
67
        print_help()
939
939
except UFWError, e:
940
940
    error(e.value)
941
941
 
942
 
if action == "help":
 
942
if action == "help" or action == "--help":
943
943
    print_help()
944
944
    sys.exit(0)
945
 
elif action == "version":
 
945
elif action == "version" or action == "--version":
946
946
    print programName + " " + version
947
947
    print "Copyright (C) 2008 Canonical Ltd."
948
948
    sys.exit(0)