all symbols except last, not last symbol
Browse files
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[
|
| 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
|