Skip to content

Commit adaf89f

Browse files
committed
Update file contents for the new package name.
1 parent add35a9 commit adaf89f

13 files changed

+230
-231
lines changed

.gitignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
tags
2-
.coverage
3-
*.pyc
41
*~
2+
*.egg
3+
*.pyc
4+
.coverage
5+
*.egg-info/
56
_build/
67
build/
78
dist/
8-
reddit.egg-info/

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
include COPYING
2-
include reddit/*.cfg
2+
include praw/praw.ini

deploy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if [ $lines -ne 2 ]; then
1212
exit 1
1313
fi
1414

15-
version=$(python -c "import reddit; print reddit.__version__")
15+
version=$(python -c "import praw; print praw.__version__")
1616

1717
read -p "Do you want to deploy $version? [y/n] " input
1818
case $input in

lint.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
dir=$(dirname $0)
44

55
# pep8
6-
output=$(find $dir/reddit -name [A-Za-z_]\*.py -exec pep8 {} \;)
6+
output=$(find $dir/praw -name [A-Za-z_]\*.py -exec pep8 {} \;)
77
if [ -n "$output" ]; then
88
echo "---pep8---"
99
echo -e "$output"
1010
exit 1
1111
fi
1212

1313
# pylint
14-
output=$(pylint --rcfile=$dir/.pylintrc $dir/reddit 2> /dev/null)
14+
output=$(pylint --rcfile=$dir/.pylintrc $dir/praw 2> /dev/null)
1515
if [ -n "$output" ]; then
1616
echo "--pylint--"
1717
echo -e "$output"
1818
fi
1919

2020
echo "---pyflakes---"
21-
find $dir/reddit -name [A-Za-z_]\*.py -exec pyflakes {} \;
21+
find $dir/praw -name [A-Za-z_]\*.py -exec pyflakes {} \;
2222

2323
exit 0

praw/__init__.py

+98-100
Large diffs are not rendered by default.

praw/backport.py

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# This file is part of reddit_api.
1+
# This file is part of PRAW.
22
#
3-
# reddit_api is free software: you can redistribute it and/or modify
4-
# it under the terms of the GNU General Public License as published by
5-
# the Free Software Foundation, either version 3 of the License, or
6-
# (at your option) any later version.
3+
# PRAW is free software: you can redistribute it and/or modify it under the
4+
# terms of the GNU General Public License as published by the Free Software
5+
# Foundation, either version 3 of the License, or (at your option) any later
6+
# version.
77
#
8-
# reddit_api is distributed in the hope that it will be useful,
9-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-
# GNU General Public License for more details.
8+
# PRAW is distributed in the hope that it will be useful, but WITHOUT ANY
9+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
10+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1211
#
13-
# You should have received a copy of the GNU General Public License
14-
# along with reddit_api. If not, see <http://www.gnu.org/licenses/>.
12+
# You should have received a copy of the GNU General Public License along with
13+
# PRAW. If not, see <http://www.gnu.org/licenses/>.
1514

1615
from six import MovedAttribute, add_move
1716

praw/decorators.py

+17-18
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
# This file is part of reddit_api.
1+
# This file is part of PRAW.
22
#
3-
# reddit_api is free software: you can redistribute it and/or modify
4-
# it under the terms of the GNU General Public License as published by
5-
# the Free Software Foundation, either version 3 of the License, or
6-
# (at your option) any later version.
3+
# PRAW is free software: you can redistribute it and/or modify it under the
4+
# terms of the GNU General Public License as published by the Free Software
5+
# Foundation, either version 3 of the License, or (at your option) any later
6+
# version.
77
#
8-
# reddit_api is distributed in the hope that it will be useful,
9-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-
# GNU General Public License for more details.
8+
# PRAW is distributed in the hope that it will be useful, but WITHOUT ANY
9+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
10+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1211
#
13-
# You should have received a copy of the GNU General Public License
14-
# along with reddit_api. If not, see <http://www.gnu.org/licenses/>.
12+
# You should have received a copy of the GNU General Public License along with
13+
# PRAW. If not, see <http://www.gnu.org/licenses/>.
1514

16-
import reddit.backport # pylint: disable-msg=W0611
15+
from . import backport # pylint: disable-msg=W0611
1716

1817
import six
1918
import sys
@@ -22,7 +21,7 @@
2221
from functools import wraps
2322
from six.moves import urljoin
2423

25-
from reddit import errors
24+
from . import errors
2625

2726

2827
class Memoize(object):
@@ -153,9 +152,9 @@ def function_wrapper(self, *args, **kwargs):
153152

154153

155154
def parse_api_json_response(function): # pylint: disable-msg=R0912
156-
"""Decorator to look at the Reddit API response to an API POST request like
157-
vote, subscribe, login, etc. Basically, it just looks for certain errors in
158-
the return string. If it doesn't find one, then it just returns True.
155+
"""Decorator to look at the response to an API POST request like vote,
156+
subscribe, login, etc. Basically, it just looks for certain errors in the
157+
return string. If it doesn't find one, then it just returns True.
159158
"""
160159
@wraps(function)
161160
def error_checked_function(self, *args, **kwargs):
@@ -229,5 +228,5 @@ def moderator_required_function(self, subreddit, *args, **kwargs):
229228

230229

231230
# Avoid circular import: http://effbot.org/zone/import-confusion.htm
232-
from reddit.objects import RedditContentObject
233-
from reddit.helpers import _request
231+
from .objects import RedditContentObject
232+
from .helpers import _request

praw/errors.py

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# This file is part of reddit_api.
1+
# This file is part of PRAW.
22
#
3-
# reddit_api is free software: you can redistribute it and/or modify
4-
# it under the terms of the GNU General Public License as published by
5-
# the Free Software Foundation, either version 3 of the License, or
6-
# (at your option) any later version.
3+
# PRAW is free software: you can redistribute it and/or modify it under the
4+
# terms of the GNU General Public License as published by the Free Software
5+
# Foundation, either version 3 of the License, or (at your option) any later
6+
# version.
77
#
8-
# reddit_api is distributed in the hope that it will be useful,
9-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-
# GNU General Public License for more details.
8+
# PRAW is distributed in the hope that it will be useful, but WITHOUT ANY
9+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
10+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1211
#
13-
# You should have received a copy of the GNU General Public License
14-
# along with reddit_api. If not, see <http://www.gnu.org/licenses/>.
12+
# You should have received a copy of the GNU General Public License along with
13+
# PRAW. If not, see <http://www.gnu.org/licenses/>.
1514

1615
import inspect
1716
import six

praw/helpers.py

+14-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# This file is part of reddit_api.
1+
# This file is part of PRAW.
22
#
3-
# reddit_api is free software: you can redistribute it and/or modify
4-
# it under the terms of the GNU General Public License as published by
5-
# the Free Software Foundation, either version 3 of the License, or
6-
# (at your option) any later version.
3+
# PRAW is free software: you can redistribute it and/or modify it under the
4+
# terms of the GNU General Public License as published by the Free Software
5+
# Foundation, either version 3 of the License, or (at your option) any later
6+
# version.
77
#
8-
# reddit_api is distributed in the hope that it will be useful,
9-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-
# GNU General Public License for more details.
8+
# PRAW is distributed in the hope that it will be useful, but WITHOUT ANY
9+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
10+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1211
#
13-
# You should have received a copy of the GNU General Public License
14-
# along with reddit_api. If not, see <http://www.gnu.org/licenses/>.
12+
# You should have received a copy of the GNU General Public License along with
13+
# PRAW. If not, see <http://www.gnu.org/licenses/>.
14+
15+
from . import backport # pylint: disable-msg=W0611
1516

16-
import reddit.backport # pylint: disable-msg=W0611
1717
import six
1818
from six.moves import Request, quote, urlencode, urljoin
19-
from reddit.decorators import Memoize, SleepAfter, require_login
19+
from .decorators import Memoize, SleepAfter, require_login
2020

2121

2222
def _get_section(subpath=''):
@@ -38,8 +38,7 @@ def _section(self, sort='new', time='all', *args, **kw):
3838

3939
def _get_sorter(subpath='', **defaults):
4040
"""
41-
Used by the Reddit Page classes to generate each of the currently supported
42-
sorts (hot, top, new, best).
41+
Used to generate the various Submission listings.
4342
"""
4443
def _sorted(self, *args, **kw):
4544
if 'url_data' in kw and kw['url_data']:

praw/objects.py

+24-25
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
# This file is part of reddit_api.
1+
# This file is part of PRAW.
22
#
3-
# reddit_api is free software: you can redistribute it and/or modify
4-
# it under the terms of the GNU General Public License as published by
5-
# the Free Software Foundation, either version 3 of the License, or
6-
# (at your option) any later version.
3+
# PRAW is free software: you can redistribute it and/or modify it under the
4+
# terms of the GNU General Public License as published by the Free Software
5+
# Foundation, either version 3 of the License, or (at your option) any later
6+
# version.
77
#
8-
# reddit_api is distributed in the hope that it will be useful,
9-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-
# GNU General Public License for more details.
8+
# PRAW is distributed in the hope that it will be useful, but WITHOUT ANY
9+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
10+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1211
#
13-
# You should have received a copy of the GNU General Public License
14-
# along with reddit_api. If not, see <http://www.gnu.org/licenses/>.
12+
# You should have received a copy of the GNU General Public License along with
13+
# PRAW. If not, see <http://www.gnu.org/licenses/>.
1514

16-
import reddit.backport # pylint: disable-msg=W0611
15+
from . import backport # pylint: disable-msg=W0611
1716

1817
import six
1918
import warnings
2019
from six.moves import urljoin
2120

22-
from reddit.decorators import limit_chars, require_login
23-
from reddit.errors import ClientException
24-
from reddit.helpers import (_get_section, _get_sorter, _modify_relationship,
25-
_request)
21+
from .decorators import limit_chars, require_login
22+
from .errors import ClientException
23+
from .helpers import (_get_section, _get_sorter, _modify_relationship,
24+
_request)
2625

2726
REDDITOR_KEYS = ('approved_by', 'author', 'banned_by', 'redditor')
2827

@@ -165,7 +164,7 @@ def edit(self, text):
165164
response = self.reddit_session.request_json(url, params)
166165
# pylint: disable-msg=E1101
167166
_request.evict([self.reddit_session.config['user']])
168-
# REDDIT: Reddit's end should only ever return a single comment
167+
# REDDIT: reddit's end should only ever return a single comment
169168
return response['data']['things'][0]
170169

171170

@@ -193,13 +192,13 @@ def reply(self, text):
193192

194193

195194
class Messageable(RedditContentObject):
196-
"""Interface for Reddit content objects that can be messaged."""
195+
"""Interface for RedditContentObjects that can be messaged."""
197196
def compose_message(self, subject, message):
198197
return self.reddit_session.compose_message(self, subject, message)
199198

200199

201200
class Reportable(RedditContentObject):
202-
"""Interface for Reddit content objects that can be reported."""
201+
"""Interface for RedditContentObjects that can be reported."""
203202
@require_login
204203
def report(self):
205204
url = self.reddit_session.config['report']
@@ -211,7 +210,7 @@ def report(self):
211210

212211

213212
class Saveable(RedditContentObject):
214-
"""Interface for Reddit content objects that can be saved."""
213+
"""Interface for RedditContentObjects that can be saved."""
215214
@require_login
216215
def save(self, unsave=False):
217216
"""If logged in, save the content."""
@@ -228,7 +227,7 @@ def unsave(self):
228227

229228

230229
class Voteable(RedditContentObject):
231-
"""Interface for Reddit content objects that can be voted on."""
230+
"""Interface for RedditContentObjects that can be voted on."""
232231
def clear_vote(self):
233232
return self.vote()
234233

@@ -354,7 +353,7 @@ def comments(self, update=True):
354353

355354

356355
class Redditor(Messageable):
357-
"""A class for Redditor methods."""
356+
"""A class representing the users of reddit."""
358357
get_overview = _get_section('')
359358
get_comments = _get_section('comments')
360359
get_submitted = _get_section('submitted')
@@ -403,7 +402,7 @@ def unfriend(self):
403402

404403

405404
class LoggedInRedditor(Redditor):
406-
"""A class for a currently logged in redditor"""
405+
"""A class for a currently logged in Redditor"""
407406
@require_login
408407
def get_inbox(self, limit=0):
409408
"""Return a generator for inbox messages."""
@@ -443,7 +442,7 @@ def my_reddits(self, limit=0):
443442

444443
class Submission(Approvable, Deletable, Distinguishable, Editable, Reportable,
445444
Saveable, Voteable):
446-
"""A class for submissions to Reddit."""
445+
"""A class for submissions to reddit."""
447446
@staticmethod
448447
def get_info(reddit_session, url, comments_only=False):
449448
url_data = {}
@@ -771,7 +770,7 @@ class UserList(RedditContentObject):
771770
def __init__(self, reddit_session, json_dict=None, fetch=False):
772771
super(UserList, self).__init__(reddit_session, json_dict, fetch)
773772

774-
# HACK: Convert children to RedditorObjects
773+
# HACK: Convert children to Redditor instances
775774
for i in range(len(self.children)):
776775
tmp = self.children[i]
777776
redditor = Redditor(reddit_session, tmp['name'], fetch=False)

praw/settings.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# This file is part of reddit_api.
1+
# This file is part of PRAW.
22
#
3-
# reddit_api is free software: you can redistribute it and/or modify
4-
# it under the terms of the GNU General Public License as published by
5-
# the Free Software Foundation, either version 3 of the License, or
6-
# (at your option) any later version.
3+
# PRAW is free software: you can redistribute it and/or modify it under the
4+
# terms of the GNU General Public License as published by the Free Software
5+
# Foundation, either version 3 of the License, or (at your option) any later
6+
# version.
77
#
8-
# reddit_api is distributed in the hope that it will be useful,
9-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-
# GNU General Public License for more details.
8+
# PRAW is distributed in the hope that it will be useful, but WITHOUT ANY
9+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
10+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1211
#
13-
# You should have received a copy of the GNU General Public License
14-
# along with reddit_api. If not, see <http://www.gnu.org/licenses/>.
12+
# You should have received a copy of the GNU General Public License along with
13+
# PRAW. If not, see <http://www.gnu.org/licenses/>.
1514

16-
import reddit.backport # pylint: disable-msg=W0611
15+
from . import backport # pylint: disable-msg=W0611
1716

1817
import os
1918
import sys
2019
from six.moves import configparser
20+
from warnings import warn_explicit
2121

2222

2323
def _load_configuration():
@@ -29,9 +29,9 @@ def _load_configuration():
2929
os_config_path = os.environ['XDG_CONFIG_HOME']
3030
else: # Legacy Linux
3131
os_config_path = os.path.join(os.environ['HOME'], '.config')
32-
locations = [os.path.join(module_dir, 'reddit_api.cfg'),
33-
os.path.join(os_config_path, 'reddit_api', 'reddit_api.cfg'),
34-
'reddit_api.cfg']
32+
locations = [os.path.join(module_dir, 'praw.ini'),
33+
os.path.join(os_config_path, 'praw.ini'),
34+
'praw.ini']
3535
if not config.read(locations):
3636
raise Exception('Could not find config file in any of: %s' % locations)
3737
return config

0 commit comments

Comments
 (0)