pup-py commited on
Commit
1594f3a
·
1 Parent(s): 6d90cda

all symbols except last, not last symbol

Browse files
Files changed (1) hide show
  1. fetch.py +1 -1
fetch.py CHANGED
@@ -107,7 +107,7 @@ def get_analytics(n: int = 5):
107
  else:
108
  cmd = f"tail -n {n} {LOGFILE.as_posix()} | tac"
109
  _subprocess = subprocess.run(cmd, shell=True, text=True, capture_output=True)
110
- json_lines, stderr = _subprocess.stdout[-1], _subprocess.stderr
111
  try:
112
  content = json.loads(f"[ {json_lines.replace("\n", ",")} ]")
113
  return content
 
107
  else:
108
  cmd = f"tail -n {n} {LOGFILE.as_posix()} | tac"
109
  _subprocess = subprocess.run(cmd, shell=True, text=True, capture_output=True)
110
+ json_lines, stderr = _subprocess.stdout[:-1], _subprocess.stderr
111
  try:
112
  content = json.loads(f"[ {json_lines.replace("\n", ",")} ]")
113
  return content