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]
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))