Subversion Repositories SmartDukaan

Rev

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

Rev 18194 Rev 18195
Line 6... Line 6...
6
parser = optparse.OptionParser()
6
parser = optparse.OptionParser()
7
parser.add_option("-m", "--m", dest="mongoHost",
7
parser.add_option("-m", "--m", dest="mongoHost",
8
                      default="localhost",
8
                      default="localhost",
9
                      type="string", help="The HOST where the mongo server is running",
9
                      type="string", help="The HOST where the mongo server is running",
10
                      metavar="HOST")
10
                      metavar="HOST")
-
 
11
parser.add_option("-e", "--e", dest="elastic_search_host",
-
 
12
                      default="localhost",
-
 
13
                      type="string", help="The HOST where the elastic server is running",
-
 
14
                      metavar="HOST")
-
 
15
parser.add_option("-p", "--p", dest="elastic_search_port",
-
 
16
                      default="localhost",
-
 
17
                      type="string", help="The PORT where the elastic server is running",
-
 
18
                      metavar="HOST")
11
 
19
 
12
(options, args) = parser.parse_args()
-
 
13
 
20
 
-
 
21
(options, args) = parser.parse_args()
14
 
22
 
15
config_client = ConfigClient()
-
 
16
elastic_search_host = config_client.get_property('elastic_search_host')
-
 
17
elastic_search_port = config_client.get_property('elastic_search_port')
-
 
18
 
23
 
19
subCategoryList = [19, 20, 27]
24
subCategoryList = [19, 20, 27]
20
es = Elasticsearch([{'host': elastic_search_host, 'port': elastic_search_port}])
25
es = Elasticsearch([{'host': options.elastic_search_host, 'port': options.elastic_search_port}])
21
xstr = lambda s: s or ""
26
xstr = lambda s: s or ""
22
 
27
 
23
class __SkuInfo:
28
class __SkuInfo:
24
    
29
    
25
    def __init__(self, id, title, category_id, subCategoryId, subCategory):
30
    def __init__(self, id, title, category_id, subCategoryId, subCategory):