Subversion Repositories SmartDukaan

Rev

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

Rev 3260 Rev 4016
Line 1... Line 1...
1
#!/usr/bin/python
1
#!/usr/bin/python
2
 
2
 
-
 
3
import optparse
3
import time
4
import time
4
import datetime
5
import datetime
5
import sys
6
import sys
6
from elixir import session
7
from elixir import session
7
 
8
 
Line 222... Line 223...
222
    time_format = "%Y-%m-%d %H%M"
223
    time_format = "%Y-%m-%d %H%M"
223
    mytime = time.strptime(time_string, time_format)
224
    mytime = time.strptime(time_string, time_format)
224
    return datetime.datetime(*mytime[:6])
225
    return datetime.datetime(*mytime[:6])
225
 
226
 
226
def main():
227
def main():
-
 
228
    parser = optparse.OptionParser()
-
 
229
    parser.add_option("-H", "--host", dest="hostname",
-
 
230
                      default="localhost",
-
 
231
                      type="string", help="The HOST where the DB server is running",
-
 
232
                      metavar="HOST")
-
 
233
    (options, args) = parser.parse_args()
-
 
234
    if len(args) != 0:
-
 
235
        parser.error("You've supplied extra arguments. Are you sure you want to run this program?")
227
    DataService.initialize(echoOn=False)
236
    DataService.initialize(db_hostname=options.hostname, echoOn=False)
228
    raw_order_id = raw_input("Enter Order Id which you want to modify:")
237
    raw_order_id = raw_input("Enter Order Id which you want to modify:")
229
    try:
238
    try:
230
        order_id = int(raw_order_id)
239
        order_id = int(raw_order_id)
231
        print("You want to modify: " + str(order_id))
240
        print("You want to modify: " + str(order_id))
232
    except ValueError:
241
    except ValueError: