Rename log_entry.py -> LogEntry.py
This commit is contained in:
parent
7239ea649e
commit
8734f808ad
|
@ -1,7 +1,8 @@
|
|||
from datetime import *
|
||||
import re
|
||||
|
||||
class log_entry(object):
|
||||
|
||||
class logEntry(object):
|
||||
|
||||
def __init__(self, name, fingerprint, datetime_string, duration,
|
||||
file_count):
|
||||
|
@ -11,8 +12,20 @@ class log_entry(object):
|
|||
self.duration = duration
|
||||
self.file_count = file_count
|
||||
|
||||
def set_datetime(self, datetime_string):
|
||||
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()
|
||||
|
||||
|
||||
def set_datetime(datetime_string):
|
||||
date = re.search(r"....-..-..", datetime_string).group()
|
||||
time = re.search(r"..:..:..", datetime_string).group()
|
||||
|
||||
|
@ -27,15 +40,3 @@ 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()
|
Loading…
Reference in New Issue
Block a user