more splitting done

This commit is contained in:
Data-Monkey
2023-05-21 21:22:51 +10:00
parent d5b7023927
commit 03163e424f
10 changed files with 1314 additions and 1194 deletions

View File

@@ -1,6 +1,8 @@
""" Colection of functions to support all logging for Pi.Alert """
import sys
import io
import datetime
from const import *
@@ -77,3 +79,14 @@ def logResult (stdout, stderr):
if stdout != None:
append_file_binary (logPath + '/stdout.log', stdout)
#-------------------------------------------------------------------------------
def append_line_to_file (pPath, pText):
# append the line depending using the correct python version
if sys.version_info < (3, 0):
file = io.open (pPath , mode='a', encoding='utf-8')
file.write ( pText.decode('unicode_escape') )
file.close()
else:
file = open (pPath, 'a', encoding='utf-8')
file.write (pText)
file.close()