From 1dc66b76b480e3f8ce3e879951269abe4e8ee5a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?= Date: Mon, 30 Aug 2021 14:32:54 +0200 Subject: [PATCH] Add __repr__ method to File class (#2550) --- mkdocs/structure/files.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mkdocs/structure/files.py b/mkdocs/structure/files.py index 74e1f029..26264625 100644 --- a/mkdocs/structure/files.py +++ b/mkdocs/structure/files.py @@ -141,6 +141,11 @@ class File: def __ne__(self, other): return not self.__eq__(other) + def __repr__(self): + return "File(src_path='{}', dest_path='{}', name='{}', url='{}')".format( + self.src_path, self.dest_path, self.name, self.url + ) + def _get_stem(self): """ Return the name of the file without it's extension. """ filename = os.path.basename(self.src_path)