hold data of a html page.
Bases: fbf.lib.persist.Persist
# fbf/lib/urldata.py # # """ hold data of a html page. """
from fbf.utils.name import stripname from fbf.lib.persist import Persist, PersistCollection from fbf.lib.datadir import getdatadir
import os
class UrlData(Persist): def __init__(self, url, txt=None, *args, **kwargs): Persist.__init__(self, getdatadir() + os.sep + "spider" + os.sep + "data" + os.sep + stripname(url), *args, **kwargs) self.data.url = url self.data.txt = txt or self.data.txt or ""
def UrlDataCollection(PersistCollection): def __init__(self, *args, **kwargs): self.path = getdatadir() + os.sep + "spider" + os.sep + "data" + os.sep PersistCollection.__init__(self, self.path, *args, **kwargs)