本文整理汇总了Python中bank.Bank.fetchTime方法的典型用法代码示例。如果您正苦于以下问题:Python Bank.fetchTime方法的具体用法?Python Bank.fetchTime怎么用?Python Bank.fetchTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bank.Bank
的用法示例。
在下文中一共展示了Bank.fetchTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import fetchTime [as 别名]
def getBankList(whereDict, city="all"):
conn = getConnection();
c = conn.cursor();
where = buildWhereClause(whereDict);
if city and city != "all":
where += " and ct_name = '%s'" % city;
c.execute("SELECT * FROM " + BankTable.TABLE_NAME
+ " LEFT OUTER JOIN "
+ " (SELECT _id AS ct_id, name AS ct_name FROM city) "
+ " ON ct_id == " + BankTable.COL_CITY_ID + " "
+ where + "ORDER BY _id DESC", list(whereDict.viewvalues()))
conn.commit();
banks = [];
for row in c.fetchall():
bank = Bank();
bank.name = row[BankTable.COL_NAME];
bank.title = row[BankTable.COL_TITLE];
bank.fetchTime = row[BankTable.COL_FETCH_TIME];
bank.accepted = row[BankTable.COL_ACCEPTED];
bank.url = row[BankTable.COL_URL];
bank.id = row[BankTable.COL_ID];
city = row["ct_name"];
if city:
bank.city = city;
banks.append(bank);
return banks;
示例2: inflateBank
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import fetchTime [as 别名]
def inflateBank(self, jo):
b = Bank();
url = jo["LinkUrl"].encode("utf-8");
if url.find("http:") == -1:
b.url = "http://cc.cmbchina.com" + url;
else:
b.url = url;
b.title = jo["Title"].encode("utf-8");
b.name = "招商银行";
b.fetchTime = strftime("%Y-%m-%d %H:%M:%S", gmtime());
return b;