Subversion Repositories SmartDukaan

Rev

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

Rev 16820 Rev 16821
Line 14... Line 14...
14
import re
14
import re
15
import traceback
15
import traceback
16
import urlparse
16
import urlparse
17
import xlrd
17
import xlrd
18
import cgi
18
import cgi
-
 
19
from dtr.utils.utils import find_between
19
class StoreOrder():
20
class StoreOrder():
20
    def on_post(self, req, resp):
21
    def on_post(self, req, resp):
21
        
22
        
22
        try:
23
        try:
23
            string1 = req.stream.read()
24
            string1 = req.stream.read()
Line 177... Line 178...
177
                    if not chunk:
178
                    if not chunk:
178
                        break
179
                        break
179
                    chunks.append(chunk) 
180
                    chunks.append(chunk) 
180
                
181
                
181
                chunk = "".join(chunks)
182
                chunk = "".join(chunks)
182
                print "Chunk1"
183
            nextpart = "--" + boundary
183
                print chunk
184
            lastpart = "--" + boundary + "--"
184
 
185
            
185
            print cgi.parse_multipart(request.stream, pdict)
186
            chunk = find_between(chunk, nextpart, lastpart)
-
 
187
            chunk = chunk.split("\n\n")[1]
186
            #rejectCount = process_rejects(filepath) #this function is not yet implemented
188
            #rejectCount = process_rejects(filepath) #this function is not yet implemented
187
            rejectCount = 1
189
            rejectCount = 1
188
            resp.content_type = 'text/html'
190
            resp.content_type = 'text/html'
189
            resp.body = """
191
            resp.body = """
190
                <html><head><title>Upload Rejects</title></head><body>
192
                <html><head><title>Upload Rejects</title></head><body>