Add print_to_file()

Class can print it's attributes to file now
This commit is contained in:
George Lacey 2016-09-20 15:04:22 +01:00
parent 560e118bf7
commit ff8be8b90f

View File

@ -27,3 +27,15 @@ class log_entry(object):
converted_datetime = datetime(year, month, day, hour, minute, second)
return converted_datetime
def print_to_file(self, filename):
x = open(filename, "w")
x.write("name: %s\n" % self.name)
x.write("fingerprint: %s\n" % self.fingerprint)
x.write("date: %s time: %s\n" % \
(self.datetime.date(), self.datetime.time()))
x.write("duration: %s\n" % self.duration)
x.write("file_count: %s\n" % self.file_count)
x.close()