Subversion Repositories SmartDukaan

Rev

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

Rev 14297 Rev 14298
Line 166... Line 166...
166
            
166
            
167
    def trackOrdersForUser(self, userId, url, rawHtml):
167
    def trackOrdersForUser(self, userId, url, rawHtml):
168
        directory = "/tmp/User" + str(userId)
168
        directory = "/tmp/User" + str(userId)
169
        if not os.path.exists(directory):
169
        if not os.path.exists(directory):
170
            os.makedirs(directory)
170
            os.makedirs(directory)
171
        f = open(directory + "/" + str(datetime.now()),'w')
171
        filename = directory + "/" + str(datetime.now())
-
 
172
        print "filename---", filename
-
 
173
        f = open(filename,'w')
172
        f.write(rawHtml) # python will convert \n to os.linesep
174
        f.write(rawHtml) # python will convert \n to os.linesep
173
        f.close() # you can omit in most cases as the destructor will call if
175
        f.close() # you can omit in most cases as the destructor will call if
174
        
176
        
175
        try:
177
        try:
176
            searchMap = {'userId':userId}
178
            searchMap = {'userId':userId}
Line 275... Line 277...
275
 
277
 
276
 
278
 
277
def main():
279
def main():
278
    store = getStore(1)
280
    store = getStore(1)
279
        
281
        
280
    store.parseOrderRawHtml(1, 'saad', '212321', readSSh('/tmp/abc.html'), 'https://www.amazon.in/gp/css/summary/edit.html?orderID=12212')
282
    store.parseOrderRawHtml(1, 'saad', '2123221', readSSh('/tmp/1.html'), 'https://www.amazon.in/gp/css/summary/edit.html?orderID=12212')
281
    #store.trackOrdersForUser(2,'https://www.amazon.in/gp/css/order-history', readSSh('/tmp/order2015-02-26 11:20:18.816942'))
283
    #store.trackOrdersForUser(2,'https://www.amazon.in/gp/css/order-history', readSSh('/tmp/order2015-02-26 11:20:18.816942'))
282
 
284
 
283
def readSSh(fileName):
285
def readSSh(fileName):
284
    try:
286
    try:
285
            str1 = open(fileName).read()
287
            str1 = open(fileName).read()