Subversion Repositories SmartDukaan

Rev

Rev 13735 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13735 Rev 13812
Line 17... Line 17...
17
categoryMap ={}
17
categoryMap ={}
18
itemMap = {} 
18
itemMap = {} 
19
 
19
 
20
con = None
20
con = None
21
BASE_URL = "http://saholic.com/"
21
BASE_URL = "http://saholic.com/"
-
 
22
AFF_TRACK = "?afid=109&utm_source=Idealo&utm_medium=affiliate_CPC"
22
xstr = lambda s: s or ""
23
xstr = lambda s: s or ""
23
 
24
 
24
db = MySQLdb.connect(host_warehouse,"root","shop2020","warehouse" )
25
db = MySQLdb.connect(host_warehouse,"root","shop2020","warehouse" )
25
cursor = db.cursor()
26
cursor = db.cursor()
26
 
27
 
Line 109... Line 110...
109
    Manufacturer\tProduct Name\tDescription\tProduct Group\tPrice INR\tDelivery status\tProduct URL\tPicture URL\tDelivery Costs\n')
110
    Manufacturer\tProduct Name\tDescription\tProduct Group\tPrice INR\tDelivery status\tProduct URL\tPicture URL\tDelivery Costs\n')
110
    for v in itemMap.itervalues():
111
    for v in itemMap.itervalues():
111
        if v.url is None:
112
        if v.url is None:
112
            continue
113
            continue
113
        try:
114
        try:
114
            f.write(str(v.itemId)+'\t'+str(v.ean)+'\t'+""'\t'+v.brand+'\t'+getProductName(v)+'\t'+getShortDesc(v.shortDesc)+'\t'+v.productGroup+'\t'+str(v.price)+'\t'+'In Stock'+'\t'+BASE_URL+v.url+'\t'+v.imageUrl+'\t'+'0.00'+'\n')
115
            f.write(str(v.itemId)+'\t'+str(v.ean)+'\t'+""'\t'+v.brand+'\t'+getProductName(v)+'\t'+getShortDesc(v.shortDesc)+'\t'+v.productGroup+'\t'+str(v.price)+'\t'+'In Stock'+'\t'+BASE_URL+v.url+AFF_TRACK+'\t'+v.imageUrl+'\t'+'0.00'+'\n')
115
        except Exception as e:
116
        except Exception as e:
116
            print e
117
            print e
117
            print "Exception in writing ",v.itemId
118
            print "Exception in writing ",v.itemId
118
    f.close()
119
    f.close()
119
 
120