def insert_pagelength(self, source_article_id, screen_positions_1920_1080, zip_file_path):
data={}
data['source_article_id'] = source_article_id
if screen_positions_1920_1080 is not None:
data['page_length_1920_1080'] = screen_positions_1920_1080
else:
data['page_length_1920_1080'] = None
#print data
sql = "INSERT INTO page_length (id, page_length_1920_1080) VALUES" \
"(%(source_article_id)s, %(page_length_1920_1080)s);"
try:
self.cursor.execute(sql, data)
except (MySQLdb.Error, MySQLdb.Warning), e:
print ('FAIL: Data caused warning or error "%s" for source_article_id: "%s"', data, source_article_id)
print 'FAIL: EXCEPTION:', e
print zip_file_path
评论列表
文章目录