/ Published in: Python

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
class itemDict: """ ******************************************** *Description : Aggregator for items ******************************************* """ def __init__(self, init_items = {}): """ ******************************************** * Description : constructor. Optionally initializes * the item dictionary ******************************************* """ self.items = init_items self.dictConf() def dictConf(self): """ ******************************************** *Description : Generic post-constructor function ******************************************* """ pass def add_item(self, item): """ ******************************************** *Description : adds an item to the dictionary * or reassigns an item already present ******************************************* """ self.items[item["public_name"]] = item def del_item(self, name): """ ******************************************** *Description : deletes an item from the dictionary ******************************************* """ del self.items[name]
Comments
