# ამიტომ, მოთხოვნები "რა და როგორ უნდა გააკეთოს ეს კოდი" უნდა მიიღოს როგორც ახლა მუშაობს.
db = Model()
def processa(მონაცემები):
print("ფაილის ზომა: " + str(len(მონაცემები)))
მომხმარებელთა ხაზები = open("/opt/data/users.txt").read().splitlines()
შედეგი = []
for ხაზი in მომხმარებელთა ხაზები:
ტრანზაქციის ხაზი = open("/opt/data/transactions.txt").read().splitlines()
processa(ტრანზაქციის ხაზი)
for ხაზი2 in ტრანზაქციის ხაზი:
ნაწილები = ხაზი2.split()
ვალიდურია = db.check_transaction(
user_id=ნაწილები[3],
change=ნაწილები[4],
)
if not re.search("\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\s+\d+\s+\w+\s+\d+.\d+", ხაზი2):
continue
user_id = ხაზი.split()[0]
regdate = db.get_regdate(user_id)
if re.search("\d{4}-\d{2}-\d{2}", regdate) and re.search("\d+.\d+", ნაწილები[4]):
შედეგი.append(ხაზი2)
if len(შედეგი) > 0:
print("მოესადაგება")