def __call__(self): info = 'Fetch cye data by id = 1' print info logger.info('Task: '+info) d = cyeTbReflector.loadObjectsFrom('cye_tb', whereClause=[("id", reflector.EQUAL, self.id)]) print d
def __call__(self): info = 'Fetch cye data by id = 1' print info logger.info('Task: ' + info) d = cyeTbReflector.loadObjectsFrom('cye_tb', whereClause=[("id", reflector.EQUAL, self.id)]) print d
detail = JingdongFilter.handleDetail(html) ''' #print detail newItem = CyeTbRow() newItem.assignKeyAttr('id', '') newItem.key = 'test'+str(random.randint(1, 999)) newItem.title = 'test' newItem.url = 'url' newItem.product_img_url = 'product_img_url' newItem.product_img = 'product_img' newItem.detail = 'detail' newItem.utime = time.strftime('%Y-%m-%d %X', time.localtime()) cyeTbReflector.insertRow(newItem).addCallback(onInsert) d = cyeTbReflector.loadObjectsFrom("cye_tb") d.addCallback(gotCye) print 'hello' cyeDBpoool.runQuery("SELECT * FROM cye_tb").addCallback(printResult) count = testCyecursor.execute('SELECT * FROM cye_tb') print count getData().addBoth(printResult) pass
fp.close() detail = JingdongFilter.handleDetail(html) ''' #print detail newItem = CyeTbRow() newItem.assignKeyAttr('id', '') newItem.key = 'test' + str(random.randint(1, 999)) newItem.title = 'test' newItem.url = 'url' newItem.product_img_url = 'product_img_url' newItem.product_img = 'product_img' newItem.detail = 'detail' newItem.utime = time.strftime('%Y-%m-%d %X', time.localtime()) cyeTbReflector.insertRow(newItem).addCallback(onInsert) d = cyeTbReflector.loadObjectsFrom("cye_tb") d.addCallback(gotCye) print 'hello' cyeDBpoool.runQuery("SELECT * FROM cye_tb").addCallback(printResult) count = testCyecursor.execute('SELECT * FROM cye_tb') print count getData().addBoth(printResult) pass