def get_item(self, name): return Item(self, name)
def create_item(self, itemname): if not isinstance(itemname, (str, unicode)): raise TypeError("Item names must have string type, not %s" % (type(itemname))) elif self.has_item(itemname): raise ItemAlreadyExistsError("An Item with the name %r already exists!" % (itemname)) return Item(self, itemname)
def iteritems(self): filenames = os.listdir(self._path) for filename in filenames: yield Item(self, self._unquote(filename))
def get_item(self, itemname): if not self._exists(itemname): raise NoSuchItemError("No such item, %r" % (itemname)) return Item(self, itemname)