コード例 #1
0
ファイル: curseshosts.py プロジェクト: ruling/huhamhire-hosts
    def set_info(self):
        """Set data file info - Public Method

        Set the information of the current local data file.
        """
        info = RetrieveData.get_info()
        ver = info["Version"]
        build = info["Buildtime"]
        build = Utilities.timestamp_to_date(build)
        self.hostsinfo = [ver, build]
コード例 #2
0
 def write_info(self):
     """
     Write the information part into the new hosts file.
     """
     info = RetrieveData.get_info()
     info_lines = [
         "#",
         "# %s: %s" % ("Version", info["Version"]),
         "# %s: %s" % ("BuildTime", info["Buildtime"]),
         "# %s: %s" % ("ApplyTime", int(self.make_time)), "#"
     ]
     for line in info_lines:
         self.hosts_file.write("%s%s" % (line, self.eol))
コード例 #3
0
ファイル: makehosts.py プロジェクト: 100Mbps/huhamhire-hosts
 def write_info(self):
     """
     Write the information part into the new hosts file.
     """
     info = RetrieveData.get_info()
     info_lines = [
         "#",
         "# %s: %s" % ("Version", info["Version"]),
         "# %s: %s" % ("BuildTime", info["Buildtime"]),
         "# %s: %s" % ("ApplyTime", int(self.make_time)),
         "#"
     ]
     for line in info_lines:
         self.hosts_file.write("%s%s" % (line, self.eol))