|
@@ -86,13 +86,13 @@ def main():
|
|
|
logger.info("End\n")
|
|
|
|
|
|
|
|
|
-# Create new file for writing the log
|
|
|
+# Create new log
|
|
|
def log_create(kind, user_name, date, tags, log):
|
|
|
name = hashlib.sha512((kind + user_name + date + tags + log).encode("utf-8")).hexdigest()
|
|
|
with open(DIR + "/data/" + name, "x") as f:
|
|
|
- f.write(name + "\n" + kind + "\n" + user_name + "\n" + date + "\n" + tags + "\n" + log)
|
|
|
+ f.write(name + "\n" + kind + "\n" + user_name + "\n" + date + "\n" + tags + "\n" + log) # Write the file
|
|
|
with open(DIR + "/data/.data", "a") as f:
|
|
|
- f.write(name + ":" + kind + ":" + user_name + ":" + date + ":" + tags + "\n")
|
|
|
+ f.write(name + ":" + kind + ":" + user_name + ":" + date + ":" + tags + "\n") # And add the entry to the .data file
|
|
|
return name
|
|
|
|
|
|
# Search for the requested entry
|
|
@@ -137,9 +137,9 @@ def log_check(name):
|
|
|
calc_hash = log_hash(name)
|
|
|
result = saved_hash == calc_hash
|
|
|
if not result:
|
|
|
- logger.warning(calc_hash + " hash do not correspond to saved one")
|
|
|
+ logger.warning(calc_hash + " hash does not correspond to saved one")
|
|
|
while True:
|
|
|
- print("Warning: " + calc_hash + " saved and calculated hash are different.\n" +
|
|
|
+ print("Warning: " + calc_hash + " sh does not correspond to saved one.\n" +
|
|
|
"Do you want to: print the log (p), change the saved hash (c), or leave it as it is (l)?")
|
|
|
c = input()
|
|
|
if c == "p":
|