Subversion Repositories SmartDukaan

Rev

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

Rev 14725 Rev 14960
Line 73... Line 73...
73
                'Could not decode the request body. The '
73
                'Could not decode the request body. The '
74
                'JSON was incorrect.')
74
                'JSON was incorrect.')
75
        try:
75
        try:
76
            store = main.getStore(req.get_param_as_int("storeId"))
76
            store = main.getStore(req.get_param_as_int("storeId"))
77
            if req.get_param_as_int("storeId") == 1:
77
            if req.get_param_as_int("storeId") == 1:
78
                f = open("/tmp/order"+str(datetime.datetime.now()),'w')
-
 
79
                f.write(req_obj['html'][0]) # python will convert \n to os.linesep
-
 
80
                f.close() # you can omit in most cases as the destructor will call if
-
 
81
 
-
 
82
                result = store.trackOrdersForUser(int(userId),req_obj['url'][0],req_obj['html'][0])
78
                result = store.trackOrdersForUser(int(userId),req_obj['url'][0],req_obj['html'][0])
83
                resp.body = json.dumps({'result':result}, encoding='utf-8')
79
                resp.body = json.dumps({'result':result}, encoding='utf-8')
84
            else:
80
            else:
85
                resp.body = json.dumps({'result':'NOT_IMPLEMENTED'}, encoding='utf-8')
81
                resp.body = json.dumps({'result':'NOT_IMPLEMENTED'}, encoding='utf-8')
86
        except:
82
        except: