Show
Ignore:
Timestamp:
01/18/08 23:39:41 (16 years ago)
Author:
jerome
Message:

Added modules to store utility functions and application
intialization code, which has nothing to do in classes.
Modified tool.py accordingly (far from being finished)
Use these new modules where necessary.
Now converts all command line arguments to unicode before
beginning to work. Added a proper logging method for already
encoded query strings.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pkturnkey

    r3288 r3294  
    2929import signal 
    3030 
     31import pykota.appinit 
     32from pykota.utils import * 
     33 
    3134from pykota.errors import PyKotaToolError, PyKotaCommandLineError 
    3235from pykota.tool import Tool, crashed, N_ 
     
    226229                from pysnmp.proto.api import alpha 
    227230            except ImportError :     
    228                 sys.stderr.write("pysnmp doesn't seem to be installed. SNMP checks will be ignored !\n") 
     231                logerr("pysnmp doesn't seem to be installed. SNMP checks will be ignored !\n") 
    229232                return 0 
    230233        else :         
     
    528531            retcode = manager.main(args, options) 
    529532    except KeyboardInterrupt :         
    530         sys.stderr.write("\nInterrupted with Ctrl+C !\n") 
     533        logerr("\nInterrupted with Ctrl+C !\n") 
    531534        retcode = -3 
    532535    except PyKotaCommandLineError, msg :     
    533         sys.stderr.write("%s : %s\n" % (sys.argv[0], msg)) 
     536        logerr("%s : %s\n" % (sys.argv[0], msg)) 
    534537        retcode = -2 
    535538    except SystemExit :