Skip to content

Commit

Permalink
Merge pull request #860 from praw-dev/remove_permalink
Browse files Browse the repository at this point in the history
Remove permalink for PRAW3.
  • Loading branch information
bboe committed Oct 29, 2017
2 parents 84ba803 + aec47aa commit 8b53280
Show file tree
Hide file tree
Showing 273 changed files with 27,076 additions and 56,646 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
after_success: coveralls
cache: pip
install: pip install coveralls flake8 pydocstyle
install: pip install coveralls
language: python
matrix:
allow_failures:
Expand All @@ -14,6 +14,4 @@ python:
- nightly
sudo: false
script:
- flake8 --exclude=docs
- pydocstyle praw
- coverage run --source=praw setup.py test
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ upstream changes.
.. begin_changelog_body
3.6.2 (2017-10-28)
------------------

* **[BUGFIX]** ``Comment.permalink`` is no longer a PRAW provided property as
Reddit as officially added it.

3.6.1 (2017-01-09)
------------------

Expand Down
2 changes: 1 addition & 1 deletion praw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
from warnings import warn_explicit


__version__ = '3.6.1'
__version__ = '3.6.2'


class Config(object): # pylint: disable=R0903
Expand Down
9 changes: 3 additions & 6 deletions praw/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ def refresh(self):
other = Redditor(self.reddit_session, self._case_name, fetch=True,
uniq=unique)
elif isinstance(self, Comment):
sub = Submission.from_url(self.reddit_session, self.permalink,
url = urljoin(self.reddit_session.config.api_url,
getattr(self, 'permalink', self._fast_permalink))
sub = Submission.from_url(self.reddit_session, url,
params={'uniq': unique})
if sub.comments:
other = sub.comments[0]
Expand Down Expand Up @@ -673,11 +675,6 @@ def is_root(self):
sub_prefix = self.reddit_session.config.by_object[Submission]
return self.parent_id.startswith(sub_prefix)

@property
def permalink(self):
"""Return a permalink to the comment."""
return urljoin(self.submission.permalink, self.id)

@property
def replies(self):
"""Return a list of the comment replies to this comment.
Expand Down
2 changes: 1 addition & 1 deletion tests/cassettes/test__to_reddit_list_with_object.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@
}
],
"recorded_with": "betamax/0.4.1"
}
}
4 changes: 2 additions & 2 deletions tests/cassettes/test_accept_moderator_invite_fail.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"request": {
"body": {
"encoding": "utf-8",
"string": "passwd=1111&user=PyAPITestUser2&api_type=json"
"string": "passwd=111111&user=PyAPITestUser2&api_type=json"
},
"headers": {
"Accept": [
Expand Down Expand Up @@ -191,4 +191,4 @@
}
],
"recorded_with": "betamax/0.4.2"
}
}
4 changes: 2 additions & 2 deletions tests/cassettes/test_add_and_remove_subreddit.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"request": {
"body": {
"encoding": "utf-8",
"string": "passwd=1111&user=PyAPITestUser2&api_type=json"
"string": "passwd=111111&user=PyAPITestUser2&api_type=json"
},
"headers": {
"Accept": [
Expand Down Expand Up @@ -583,4 +583,4 @@
}
],
"recorded_with": "betamax/0.4.2"
}
}
4 changes: 2 additions & 2 deletions tests/cassettes/test_add_comment.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"request": {
"body": {
"encoding": "utf-8",
"string": "passwd=1111&user=PyAPITestUser2&api_type=json"
"string": "passwd=111111&user=PyAPITestUser2&api_type=json"
},
"headers": {
"Accept": [
Expand Down Expand Up @@ -390,4 +390,4 @@
}
],
"recorded_with": "betamax/0.4.2"
}
}
4 changes: 2 additions & 2 deletions tests/cassettes/test_add_link_flair.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"request": {
"body": {
"encoding": "utf-8",
"string": "passwd=1111&user=PyAPITestUser2&api_type=json"
"string": "passwd=111111&user=PyAPITestUser2&api_type=json"
},
"headers": {
"Accept": [
Expand Down Expand Up @@ -487,4 +487,4 @@
}
],
"recorded_with": "betamax/0.4.2"
}
}
4 changes: 2 additions & 2 deletions tests/cassettes/test_add_link_flair_to_invalid_subreddit.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"request": {
"body": {
"encoding": "utf-8",
"string": "passwd=1111&user=PyAPITestUser2&api_type=json"
"string": "passwd=111111&user=PyAPITestUser2&api_type=json"
},
"headers": {
"Accept": [
Expand Down Expand Up @@ -388,4 +388,4 @@
}
],
"recorded_with": "betamax/0.4.2"
}
}
4 changes: 2 additions & 2 deletions tests/cassettes/test_add_link_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"request": {
"body": {
"encoding": "utf-8",
"string": "passwd=1111&user=PyAPITestUser2&api_type=json"
"string": "passwd=111111&user=PyAPITestUser2&api_type=json"
},
"headers": {
"Accept": [
Expand Down Expand Up @@ -571,4 +571,4 @@
}
],
"recorded_with": "betamax/0.4.2"
}
}
4 changes: 2 additions & 2 deletions tests/cassettes/test_add_moderator__failure.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"request": {
"body": {
"encoding": "utf-8",
"string": "passwd=1111&user=PyAPITestUser2&api_type=json"
"string": "passwd=111111&user=PyAPITestUser2&api_type=json"
},
"headers": {
"Accept": [
Expand Down Expand Up @@ -479,4 +479,4 @@
}
],
"recorded_with": "betamax/0.4.2"
}
}
4 changes: 2 additions & 2 deletions tests/cassettes/test_add_remove_friends.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"request": {
"body": {
"encoding": "utf-8",
"string": "user=PyAPITestUser2&api_type=json&passwd=1111"
"string": "user=PyAPITestUser2&api_type=json&passwd=111111"
},
"headers": {
"Accept": [
Expand Down Expand Up @@ -697,4 +697,4 @@
}
],
"recorded_with": "betamax/0.4.1"
}
}
Loading

0 comments on commit 8b53280

Please sign in to comment.