Subversion Repositories SmartDukaan

Rev

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

Rev 14243 Rev 14244
Line 1... Line 1...
1
import pysolr
1
import pysolr
2
import pymongo
2
import pymongo
3
import shutil
-
 
4
import json
3
import json
5
import os
4
import os
6
import optparse
5
import optparse
7
 
6
 
8
con=None
7
con=None
Line 70... Line 69...
70
        except OSError:
69
        except OSError:
71
            pass
70
            pass
72
    output = open(filePath, 'ab+')
71
    output = open(filePath, 'ab+')
73
    json.dump(autoSuggestList, output)
72
    json.dump(autoSuggestList, output)
74
    output.close()
73
    output.close()
-
 
74
    if options.host !='localhost':
-
 
75
        try:
75
    shutil.copy2(filePath, destFilePath)
76
            os.system("scp "+filePath +" root@dtr:"+destFilePath)
-
 
77
        except:
-
 
78
            pass
76
    
79
    
77
    
80
    
78
 
81
 
79
def get_mongo_connection(host='localhost', port=27017):
82
def get_mongo_connection(host='localhost', port=27017):
80
    global con
83
    global con