Subversion Repositories SmartDukaan

Rev

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

Rev 14284 Rev 14285
Line 11... Line 11...
11
from dtr.main import getStore, Store as MStore, ParseException
11
from dtr.main import getStore, Store as MStore, ParseException
12
from dtr.sources.flipkart import todict
12
from dtr.sources.flipkart import todict
13
from paramiko import sftp
13
from paramiko import sftp
14
from paramiko.client import SSHClient
14
from paramiko.client import SSHClient
15
from paramiko.sftp_client import SFTPClient
15
from paramiko.sftp_client import SFTPClient
-
 
16
import os.path
16
import paramiko
17
import paramiko
17
import re
18
import re
18
import time
19
import time
19
import traceback
20
import traceback
20
 
21
 
Line 147... Line 148...
147
            return missingOrderUrls + ['https://www.amazon.in/gp/css/order-history', 'https://www.amazon.in/gp/css/order-history/?orderFilter=cancelled']
148
            return missingOrderUrls + ['https://www.amazon.in/gp/css/order-history', 'https://www.amazon.in/gp/css/order-history/?orderFilter=cancelled']
148
        else: 
149
        else: 
149
            return missingOrderUrls
150
            return missingOrderUrls
150
            
151
            
151
    def trackOrdersForUser(self, userId, url, rawHtml):
152
    def trackOrdersForUser(self, userId, url, rawHtml):
-
 
153
        directory = "/tmp/User" + str(userId)
-
 
154
        if not os.path.exists(directory):
152
        
155
            os.makedirs(directory)
153
        f = open("/tmp/User" + str(userId) + "/" + str(datetime.now()),'w')
156
        f = open(directory + "/" + str(datetime.now()),'w')
154
        f.write(rawHtml) # python will convert \n to os.linesep
157
        f.write(rawHtml) # python will convert \n to os.linesep
155
        f.close() # you can omit in most cases as the destructor will call if
158
        f.close() # you can omit in most cases as the destructor will call if
156
        
159
        
157
        try:
160
        try:
158
            searchMap = {'userId':userId}
161
            searchMap = {'userId':userId}