def __init__(self, index=0, path=None, icon_idx=0): self.index = index self.path = path self.dc_path = co.decode(path) self.folder, self.fn = os.path.split(path) # self.fn = co.decode(self.fn) # if os.name == "nt": # self.fn = self.fn.decode("GB18030") self.title = None self.icon_idx = icon_idx self.content = "" self.is_selected = False self.read()
def __init__(self, index=0, path=None, icon_idx=0): self.index = index self.path = path self.dc_path = co.decode(path) self.folder, self.fn = os.path.split(path) # self.fn = co.decode(self.fn) # if os.name == "nt": # self.fn = self.fn.decode("GB18030") self.title = None self.icon_idx = icon_idx self.content = "" self.is_selected = False self.url = None # 如果是在线hosts方案,则此项不为空 self.last_fetch_dt = None # 如果是在线hosts方案,则此项为最后更新时间 self.read()
def tryToDecode(self, s): try: return co.decode(s) except Exception: return u"### 解码错误!###"