Subversion Repositories SmartDukaan

Rev

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

Rev 17655 Rev 17659
Line 1... Line 1...
1
'''
1
'''
2
Created on Feb 12, 2015
2
Created on Feb 12, 2015
3
 
3
 
4
@author: amit
4
@author: amit
5
'''
5
'''
6
from dtr import main
-
 
7
from datetime import datetime
6
from datetime import datetime
-
 
7
from dtr import main
8
from dtr.main import tprint
8
from dtr.main import tprint
9
from dtr.storage import Mongo, Mysql
9
from dtr.storage import Mongo, Mysql
10
from dtr.utils import utils
10
from dtr.utils import utils
-
 
11
from dtr.utils.utils import find_between
-
 
12
import cgi
11
import falcon
13
import falcon
12
import json
14
import json
-
 
15
import logging
13
import os.path
16
import os.path
14
import re
17
import re
15
import traceback
18
import traceback
16
import urlparse
19
import urlparse
17
import xlrd
20
import xlrd
18
import cgi
21
 
19
from dtr.utils.utils import find_between
22
logging.basicConfig(filename='/var/log/uwsgi/order.log',level=logging.DEBUG)
20
 
23
 
21
 
24
 
22
order_fliters = {
25
order_fliters = {
23
                 "monitor":{
26
                 "monitor":{
24
                    "trackingurlmissing":  {
27
                    "trackingurlmissing":  {
Line 115... Line 118...
115
class Track():
118
class Track():
116
    def on_post(self, req, resp, userId):
119
    def on_post(self, req, resp, userId):
117
        try:
120
        try:
118
            string1 = req.stream.read()
121
            string1 = req.stream.read()
119
            req_obj = urlparse.parse_qs(string1)
122
            req_obj = urlparse.parse_qs(string1)
-
 
123
            logging.info(string1)
120
        except ValueError:
124
        except ValueError:
121
            raise falcon.HTTPError(falcon.HTTP_400,
125
            raise falcon.HTTPError(falcon.HTTP_400,
122
                'Malformed JSON',
126
                'Malformed JSON',
123
                'Could not decode the request body. The '
127
                'Could not decode the request body. The '
124
                'JSON was incorrect.')
128
                'JSON was incorrect.')