Skip to content

Commit fc59f94

Browse files
parsing fix
1 parent 509a533 commit fc59f94

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

logger_setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
file_handler.setFormatter(formatter)
2525
# add the first handler to the logger
2626
logger.addHandler(file_handler)
27-
2827
# creation of a second handler which redirect traces to the console
2928
stream_handler = logging.StreamHandler()
3029
# # set level of the second handler to DEBUG

main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
logging.error("The program ended unexpectedly !")
3030
logging.error("Error: " + str(e))
3131

32-
logger_script()
33-
34-
alm = Alerts()
35-
alm.run_script()
32+
# TODO
33+
# logger_script()
34+
#
35+
# alm = Alerts()
36+
# alm.run_script()

slimer_script.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ def slimer_script():
1212
SLIMER_SCRIPT_BACKUP_FILE_END_NAME), "w",
1313
encoding="utf-8")
1414

15+
logging.info(f"COMPUTER NAME : {computer_name}")
16+
backup_file.write(f"COMPUTER NAME : {computer_name}")
17+
1518
logging.info("SLIMER SCRIPT is currently running : creation of the backup file. "
1619
"This can take up a few minutes...")
1720

18-
logging.info(f"Computer name : {computer_name}")
19-
2021
for path in DIRECTORIES_TO_BE_SCANNED_FOR_BACKUP.values():
21-
backup_file.write(f"Computer name : {computer_name}")
2222
backup_file.write(f"\n\nList of directories, subdirectories and descendants of the folder {path} \n")
2323
parse_directories(path, backup_file)
2424
backup_file.write("\n\n################################################################################ \n")
@@ -29,9 +29,10 @@ def slimer_script():
2929
backup_file.close()
3030
logging.info("All paths have been scanned. The backup file is saved")
3131

32+
# TODO
3233
# opens the file for reading only in binary format in order to upload
33-
file = open(backup_file.name, "rb")
34-
35-
upload_file_to_server_ftp(file, file.name)
36-
37-
file.close()
34+
# file = open(backup_file.name, "rb")
35+
#
36+
# upload_file_to_server_ftp(file, file.name)
37+
#
38+
# file.close()

utilities.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def parse_all_folders_and_files(path, backup_file):
5757
time_format = time.strftime("%x %X", time_format_temp)
5858
backup_file.write("\n" + "--- " + path_name + " *** " + time_format + " *** " + str(size) + " Ko")
5959
number_of_files += 1
60+
6061
backup_file.write("\n\nNumber of files in the directory " + path + " : " + str(number_of_files))
6162

6263

0 commit comments

Comments
 (0)