Skip to content

Commit

Permalink
Fix resources __repr__ formatting (#2935)
Browse files Browse the repository at this point in the history
  • Loading branch information
vadim-su authored and asvetlov committed Apr 13, 2018
1 parent 1dd1185 commit 55a6782
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES/2935.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A closing bracket was added to __repr__ of resources
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ Thanos Lefteris
Thijs Vermeir
Thomas Grainger
Tolga Tezel
Vadim Suharnikov
Vaibhav Sagar
Vamsi Krishna Avula
Vasiliy Faronov
Expand Down
8 changes: 4 additions & 4 deletions aiohttp/web_urldispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ def url_for(self):

def __repr__(self):
name = "'" + self.name + "' " if self.name is not None else ""
return "<PlainResource {name} {path}".format(name=name,
path=self._path)
return "<PlainResource {name} {path}>".format(name=name,
path=self._path)


class DynamicResource(Resource):
Expand Down Expand Up @@ -399,7 +399,7 @@ def url_for(self, **parts):

def __repr__(self):
name = "'" + self.name + "' " if self.name is not None else ""
return ("<DynamicResource {name} {formatter}"
return ("<DynamicResource {name} {formatter}>"
.format(name=name, formatter=self._formatter))


Expand Down Expand Up @@ -602,7 +602,7 @@ def _directory_as_html(self, filepath):

def __repr__(self):
name = "'" + self.name + "'" if self.name is not None else ""
return "<StaticResource {name} {path} -> {directory!r}".format(
return "<StaticResource {name} {path} -> {directory!r}>".format(
name=name, path=self._prefix, directory=self._directory)


Expand Down

0 comments on commit 55a6782

Please sign in to comment.