當前位置: 首頁>>代碼示例>>Python>>正文


Python Bank.name方法代碼示例

本文整理匯總了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;
開發者ID:ufo22940268,項目名稱:PromotionScrachServer,代碼行數:28,代碼來源:ecitic.py

示例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;
開發者ID:ufo22940268,項目名稱:PromotionScrachServer,代碼行數:31,代碼來源:db.py

示例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;
開發者ID:ufo22940268,項目名稱:PromotionScrachServer,代碼行數:14,代碼來源:cmb.py


注:本文中的bank.Bank.name方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。