Subversion Repositories SmartDukaan

Rev

Rev 7055 | Rev 7149 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7055 Rev 7056
Line 127... Line 127...
127
    parser.add_option("-H", "--host", dest="hostname",
127
    parser.add_option("-H", "--host", dest="hostname",
128
                      default="localhost",
128
                      default="localhost",
129
                      type="string", help="The HOST where the DB server is running",
129
                      type="string", help="The HOST where the DB server is running",
130
                      metavar="HOST")
130
                      metavar="HOST")
131
    parser.add_option("-O", "--order", dest="orderId",
131
    parser.add_option("-O", "--order", dest="orderId",
-
 
132
                      default =0,
132
                      type="int", help="A110 OrderId to be processed",
133
                      type="int", help="A110 OrderId to be processed",
133
                      metavar="NUM")
134
                      metavar="NUM")
134
    (options, args) = parser.parse_args()
135
    (options, args) = parser.parse_args()
135
    if len(args) != 0:
136
    if len(args) != 0:
136
        parser.error("You've supplied extra arguments. Are you sure you want to run this program?")
137
        parser.error("You've supplied extra arguments. Are you sure you want to run this program?")
-
 
138
    
-
 
139
    if options.orderId == 0:
-
 
140
        print "Usage : -O OrderId -H Hostname"
-
 
141
        return
137
    DataService.initialize(db_hostname=options.hostname, echoOn=False)
142
    DataService.initialize(db_hostname=options.hostname, echoOn=False)
138
    
143
    
139
    orderId = options.orderId
144
    orderId = options.orderId
140
    try:
145
    try:
141
        order = get_order(orderId)
146
        order = get_order(orderId)