コード例 #1
0
ファイル: cls_Hosts.py プロジェクト: neolf/SwitchHosts
    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()
コード例 #2
0
ファイル: cls_Hosts.py プロジェクト: shiqstone/SwitchHosts
    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()
コード例 #3
0
    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()
コード例 #4
0
ファイル: cls_Hosts.py プロジェクト: jotcmd/SwitchHosts
    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()
コード例 #5
0
ファイル: Hosts.py プロジェクト: Johnqing/SwitchHosts
    def tryToDecode(self, s):

        try:
            return co.decode(s)
        except Exception:
            return u"### 解码错误!###"
コード例 #6
0
    def tryToDecode(self, s):

        try:
            return co.decode(s)
        except Exception:
            return u"### 解码错误!###"