Beispiel #1
0
 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
     
Beispiel #2
0
 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
Beispiel #3
0
 
 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
Beispiel #4
0
    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