mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Add __repr__ method to File class (#2550)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user