Skip to content

Commit

Permalink
Add __repr__ method to File class (#2550)
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed Aug 30, 2021
1 parent c93c053 commit 1dc66b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mkdocs/structure/files.py
Expand Up @@ -141,6 +141,11 @@ def __eq__(self, other):
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)
Expand Down

0 comments on commit 1dc66b7

Please sign in to comment.