本文整理汇总了Python中bank.Bank.name方法的典型用法代码示例。如果您正苦于以下问题:Python Bank.name方法的具体用法?Python Bank.name怎么用?Python Bank.name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bank.Bank
的用法示例。
在下文中一共展示了Bank.name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fetchBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import name [as 别名]
def fetchBankList(self):
f = self.openUrl("http://cards.ecitic.com/youhui/shuakahuodong.shtml");
if f == None:
return;
soup = BeautifulSoup(f);
lis = soup.find_all("li", class_="emb4 item-n");
banks = [];
for li in lis:
b = Bank();
h2 = li.find_all("h2")[0];
title = h2.string.encode("utf-8");
b.title = re.sub(r"\[.*\]", "", title);
m = re.match(r".*\[(.*)\].*", title);
if m:
b.city = m.group(1);
b.name = self.getName();
b.url = "http://cards.ecitic.com/youhui/" +li.find("a", class_="a-h")["href"].encode("utf-8");
ds = li.find("span", class_="date")
if ds and ds.string:
ds = ds.string.encode("utf-8");
m = re.match(r".*-(.*)", ds)
if m:
b.endDate = date_parser.parseSlashStyle(m.group(1).strip());
banks.append(b);
return banks;
示例2: getBankList
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import name [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;
示例3: inflateBank
# 需要导入模块: from bank import Bank [as 别名]
# 或者: from bank.Bank import name [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;