mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
27 lines
771 B
Python
27 lines
771 B
Python
# This Python file uses the following encoding: utf-8
|
|
"""This module contains utility scripts used by musi radiostation Conjurer"""
|
|
import time
|
|
import re
|
|
|
|
NAME = "/home/pi/Conjurer/persistence.log"
|
|
|
|
def print_top():
|
|
"""
|
|
Prints the top 65 lines from a file specified by the NAME variable.
|
|
"""
|
|
while True:
|
|
line = ""
|
|
buffer = ""
|
|
with open(NAME, "r", encoding="utf-8") as f:
|
|
for _ in range (45):
|
|
line = f.readline()
|
|
if re.match(".*mp3", line):
|
|
buffer += line
|
|
print("=====================================")
|
|
print(buffer)
|
|
print("=====================================")
|
|
time.sleep(180)
|
|
|
|
if __name__ == "__main__":
|
|
print_top()
|