Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resources __repr__ formatting #2935

Merged
merged 1 commit into from
Apr 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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