Commit ecd9de84 authored by Michael Weinrich's avatar Michael Weinrich
Browse files

former start script removed

parent 18d769e6
#! /usr/bin/env python
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2007, Michael Weinrich <testsuite@michael-weinrich.de>
import os, sys
from twisted.internet import reactor
from twisted.python import usage
from upntest.base import UPnT
from configobj import ConfigObj
class Options(usage.Options):
optParameters = [['configfile', 'c', '', 'path to configfile'],
]
def main(options):
# get settings or options
def setConfigFile(filename):
def findConfigDir():
try:
configDir = os.path.expanduser('~')
except:
configDir = os.getcwd()
return configDir
if filename is '':
filename = os.path.join( findConfigDir(), '.upntest')
return filename
config = ConfigObj( setConfigFile( options['configfile']))
u = UPnT()
u.setup(config)
if __name__ == '__main__':
options = Options()
try:
options.parseOptions()
except usage.UsageError, errortext:
print '%s: %s' % (sys.argv[0], errortext)
print '%s: Try --help for usage details.' % (sys.argv[0])
sys.exit(1)
reactor.callWhenRunning(main, options)
reactor.run()
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment