IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 3, 2011, 11:58:35 AM (15 years ago)
Author:
rhenders
Message:

improved handling of single command line arg for config; removed some redundant commented-out code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/metrics.py

    r31993 r31995  
    3030
    3131
    32 #SERVER = "localhost"
    33 
    34 #FROM = "ippToPsps@example.com"
    35 #TO = ["roydhenderson@gmail.com"]
    36 
    37 #SUBJECT = "IPP to PSPS loading status"
    38 
    39 #TEXT = "This message was sent with Python's smtplib."
    40 
    41 # Prepare actual message
    42 
    43 #message = """\
    44 #           From: %s
    45 #           To: %s
    46 #           Subject: %s
    47 #
    48 #           %s
    49 #           """ % (FROM, ", ".join(TO), SUBJECT, TEXT)
    50 #
    51 # Send the mail
    52 #
    53 #server = smtplib.SMTP(SERVER)
    54 #server.sendmail(FROM, TO, message)
    55 #server.quit()
    56 
    57 logging.config.fileConfig("logging.conf")
    58 logging.setLoggerClass(PSLogger)
    59 logger = logging.getLogger("ippToPspsLog")
    60 logger.setLevel(logging.INFO)
     32'''
     33Start of program.
     34'''
    6135
    6236if len(sys.argv) > 1: CONFIG  = sys.argv[1]
     
    6539    sys.exit(1)
    6640
     41# open config file
    6742configDoc = ElementTree(file=CONFIG)
     43
     44
     45logging.config.fileConfig("logging.conf")
     46logging.setLoggerClass(PSLogger)
     47logger = logging.getLogger("ippToPspsLog")
     48logger.setLevel(logging.INFO)
    6849
    6950ippToPspsDb = IppToPspsDb(logger, configDoc)
Note: See TracChangeset for help on using the changeset viewer.