From d4b0f02ec72533e1b047cbf7c806ecfa33a7a434 Mon Sep 17 00:00:00 2001 From: Ilia Miheev Date: Thu, 13 Nov 2025 16:07:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20exists?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ipars/ParsManagerCode.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ipars/ParsManagerCode.py b/ipars/ParsManagerCode.py index d4dd273..ed33f4b 100644 --- a/ipars/ParsManagerCode.py +++ b/ipars/ParsManagerCode.py @@ -21,6 +21,15 @@ class Pars: raise ValueError(v.errors) + def exists(self, path: str) -> dict: + '''Возвращает True если указанный файл или папка сущуствует, иначе — False''' + schema = {'path': {'type': 'string'}} + expected = {'path': path} + self.__validation(schema, expected) + + return exists(path) + + def listdir(self, path: str) -> dict: '''Возвращает список файлов в указанной директории''' schema = {'path': {'type': 'string'}}