示例#1
0
    def _loadInventory(self, usr, pg, pgno):
        rows = pg.find(
            "form",
            action="process_safetydeposit.phtml?checksub=scan").find_all("tr")
        rows.pop(-1)  # Last row contains no item

        for item in rows:
            stats = item.find_all("td")

            itemName = stats[1].b.text

            if itemName.find("(") != -1:
                itemName = itemName.split("(")[0]

            tmpItem = Item(itemName)

            tmpItem.img = stats[0].img['src']
            tmpItem.desc = stats[2].text
            tmpItem.type = stats[3].text
            tmpItem.stock = stats[4].text
            tmpItem.id = stats[5].input['name'].split("[")[1].replace("]", "")

            tmpItem.pg = pgno
            tmpItem.usr = usr

            self.items[itemName] = tmpItem
示例#2
0
 def _loadInventory(self, usr, pg, pgno):
     rows = pg.find("form", action = "process_safetydeposit.phtml?checksub=scan").find_all("tr")
     rows.pop(-1) # Last row contains no item
     
     for item in rows:
         stats = item.find_all("td")
         
         itemName = stats[1].b.text
         
         if itemName.find("(") != -1:
             itemName = itemName.split("(")[0]
             
         tmpItem = Item(itemName)
         
         tmpItem.img = stats[0].img['src']
         tmpItem.desc = stats[2].text
         tmpItem.type = stats[3].text
         tmpItem.stock = stats[4].text
         tmpItem.id = stats[5].input['name'].split("[")[1].replace("]", "")
         
         tmpItem.pg = pgno
         tmpItem.usr = usr
         
         self.items[itemName] = tmpItem