parser.add_option("--dbhost", dest="dbhost", default="127.0.0.1", help="Reference data database host") parser.add_option("--dbport", dest="dbport", type="int", default=basePort, help="Reference data database port") parser.add_option("--gwhost", dest="gwhost", default="127.0.0.1", help="Gateway host") parser.add_option("--gwport", dest="gwport", type="int", default=basePort + 6, help="Gateway port") parser.add_option("--ofihost", dest="ofihost", default="127.0.0.1", help="OutboundFeedInterface host") parser.add_option("--ofiport", dest="ofiport", type="int", default=basePort + 5, help="OutboundFeedInterface port") parser.add_option("--bbo-offer-price", dest="offerPrice", type="int", default=None, help="Best offer price") parser.add_option("--bbo-bid-price", dest="bidPrice", type="int", default=60, help="Best bid price") parser.add_option("--business-date", dest="businessDate", type="str", default=None, help="Set current business date (dd-mm-yyyy)") parser.add_option("--show-business-dates", dest="showBusinessDates", action="store_true", default=False, help="Show business dates in the database") parser.add_option("--passwords", dest="passwords", help="Passwords file for GW and OFI", default = None) parser.add_option("--conngateway", dest="conngateway", action="store_true", help="Use this flag when using a connection gateway", default = False) (options, args) = parser.parse_args() if options.showBusinessDates: refdata = ReferenceData(dbhost=options.dbhost, dbport=options.dbport) refdata.showBusinessDates() sys.exit(0) if options.partition: options.partition = [options.partition] startOfDay = StartOfDay(bidPrice=options.bidPrice, offerPrice=options.offerPrice, businessDate=options.businessDate, partitions=options.partition, gwHost=options.gwhost, gwPort=options.gwport, ofiHost=options.ofihost, ofiPort=options.ofiport) startOfDay.run() startOfDay.printResults() if startOfDay.successful > 0: sys.exit(0) else: sys.exit(1)
help="Show business dates in the database") parser.add_option("--passwords", dest="passwords", help="Passwords file for GW and OFI", default=None) parser.add_option("--conngateway", dest="conngateway", action="store_true", help="Use this flag when using a connection gateway", default=False) (options, args) = parser.parse_args() if options.showBusinessDates: refdata = ReferenceData(dbhost=options.dbhost, dbport=options.dbport) refdata.showBusinessDates() sys.exit(0) if options.partition: options.partition = [options.partition] startOfDay = StartOfDay(bidPrice=options.bidPrice, offerPrice=options.offerPrice, businessDate=options.businessDate, partitions=options.partition, gwHost=options.gwhost, gwPort=options.gwport, ofiHost=options.ofihost, ofiPort=options.ofiport) startOfDay.run() startOfDay.printResults()