Permalink
Browse files

Update file contents for the new package name.

  • Loading branch information...
bboe committed Jul 1, 2012
1 parent add35a9 commit adaf89fe8631f41ab9913b379de104c9ef6a1e73
Showing with 230 additions and 231 deletions.
  1. +4 −4 .gitignore
  2. +1 −1 MANIFEST.in
  3. +1 −1 deploy.sh
  4. +3 −3 lint.sh
  5. +98 −100 praw/__init__.py
  6. +10 −11 praw/backport.py
  7. +17 −18 praw/decorators.py
  8. +10 −11 praw/errors.py
  9. +14 −15 praw/helpers.py
  10. +24 −25 praw/objects.py
  11. +15 −15 praw/settings.py
  12. +13 −14 praw/tests.py
  13. +20 −13 setup.py
View
@@ -1,8 +1,8 @@
-tags
-.coverage
-*.pyc
*~
+*.egg
+*.pyc
+.coverage
+*.egg-info/
_build/
build/
dist/
-reddit.egg-info/
View
@@ -1,2 +1,2 @@
include COPYING
-include reddit/*.cfg
+include praw/praw.ini
View
@@ -12,7 +12,7 @@ if [ $lines -ne 2 ]; then
exit 1
fi
-version=$(python -c "import reddit; print reddit.__version__")
+version=$(python -c "import praw; print praw.__version__")
read -p "Do you want to deploy $version? [y/n] " input
case $input in
View
@@ -3,21 +3,21 @@
dir=$(dirname $0)
# pep8
-output=$(find $dir/reddit -name [A-Za-z_]\*.py -exec pep8 {} \;)
+output=$(find $dir/praw -name [A-Za-z_]\*.py -exec pep8 {} \;)
if [ -n "$output" ]; then
echo "---pep8---"
echo -e "$output"
exit 1
fi
# pylint
-output=$(pylint --rcfile=$dir/.pylintrc $dir/reddit 2> /dev/null)
+output=$(pylint --rcfile=$dir/.pylintrc $dir/praw 2> /dev/null)
if [ -n "$output" ]; then
echo "--pylint--"
echo -e "$output"
fi
echo "---pyflakes---"
-find $dir/reddit -name [A-Za-z_]\*.py -exec pyflakes {} \;
+find $dir/praw -name [A-Za-z_]\*.py -exec pyflakes {} \;
exit 0
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,17 +1,16 @@
-# This file is part of reddit_api.
+# This file is part of PRAW.
#
-# reddit_api is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# PRAW is free software: you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
#
-# reddit_api is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# PRAW is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
-# along with reddit_api. If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License along with
+# PRAW. If not, see <http://www.gnu.org/licenses/>.
from six import MovedAttribute, add_move
View
@@ -1,19 +1,18 @@
-# This file is part of reddit_api.
+# This file is part of PRAW.
#
-# reddit_api is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# PRAW is free software: you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
#
-# reddit_api is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# PRAW is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
-# along with reddit_api. If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License along with
+# PRAW. If not, see <http://www.gnu.org/licenses/>.
-import reddit.backport # pylint: disable-msg=W0611
+from . import backport # pylint: disable-msg=W0611
import six
import sys
@@ -22,7 +21,7 @@
from functools import wraps
from six.moves import urljoin
-from reddit import errors
+from . import errors
class Memoize(object):
@@ -153,9 +152,9 @@ def function_wrapper(self, *args, **kwargs):
def parse_api_json_response(function): # pylint: disable-msg=R0912
- """Decorator to look at the Reddit API response to an API POST request like
- vote, subscribe, login, etc. Basically, it just looks for certain errors in
- the return string. If it doesn't find one, then it just returns True.
+ """Decorator to look at the response to an API POST request like vote,
+ subscribe, login, etc. Basically, it just looks for certain errors in the
+ return string. If it doesn't find one, then it just returns True.
"""
@wraps(function)
def error_checked_function(self, *args, **kwargs):
@@ -229,5 +228,5 @@ def moderator_required_function(self, subreddit, *args, **kwargs):
# Avoid circular import: http://effbot.org/zone/import-confusion.htm
-from reddit.objects import RedditContentObject
-from reddit.helpers import _request
+from .objects import RedditContentObject
+from .helpers import _request
View
@@ -1,17 +1,16 @@
-# This file is part of reddit_api.
+# This file is part of PRAW.
#
-# reddit_api is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# PRAW is free software: you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
#
-# reddit_api is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# PRAW is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
-# along with reddit_api. If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License along with
+# PRAW. If not, see <http://www.gnu.org/licenses/>.
import inspect
import six
View
@@ -1,22 +1,22 @@
-# This file is part of reddit_api.
+# This file is part of PRAW.
#
-# reddit_api is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# PRAW is free software: you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
#
-# reddit_api is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# PRAW is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
-# along with reddit_api. If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License along with
+# PRAW. If not, see <http://www.gnu.org/licenses/>.
+
+from . import backport # pylint: disable-msg=W0611
-import reddit.backport # pylint: disable-msg=W0611
import six
from six.moves import Request, quote, urlencode, urljoin
-from reddit.decorators import Memoize, SleepAfter, require_login
+from .decorators import Memoize, SleepAfter, require_login
def _get_section(subpath=''):
@@ -38,8 +38,7 @@ def _section(self, sort='new', time='all', *args, **kw):
def _get_sorter(subpath='', **defaults):
"""
- Used by the Reddit Page classes to generate each of the currently supported
- sorts (hot, top, new, best).
+ Used to generate the various Submission listings.
"""
def _sorted(self, *args, **kw):
if 'url_data' in kw and kw['url_data']:
View
@@ -1,28 +1,27 @@
-# This file is part of reddit_api.
+# This file is part of PRAW.
#
-# reddit_api is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# PRAW is free software: you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
#
-# reddit_api is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# PRAW is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
-# along with reddit_api. If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License along with
+# PRAW. If not, see <http://www.gnu.org/licenses/>.
-import reddit.backport # pylint: disable-msg=W0611
+from . import backport # pylint: disable-msg=W0611
import six
import warnings
from six.moves import urljoin
-from reddit.decorators import limit_chars, require_login
-from reddit.errors import ClientException
-from reddit.helpers import (_get_section, _get_sorter, _modify_relationship,
- _request)
+from .decorators import limit_chars, require_login
+from .errors import ClientException
+from .helpers import (_get_section, _get_sorter, _modify_relationship,
+ _request)
REDDITOR_KEYS = ('approved_by', 'author', 'banned_by', 'redditor')
@@ -165,7 +164,7 @@ def edit(self, text):
response = self.reddit_session.request_json(url, params)
# pylint: disable-msg=E1101
_request.evict([self.reddit_session.config['user']])
- # REDDIT: Reddit's end should only ever return a single comment
+ # REDDIT: reddit's end should only ever return a single comment
return response['data']['things'][0]
@@ -193,13 +192,13 @@ def reply(self, text):
class Messageable(RedditContentObject):
- """Interface for Reddit content objects that can be messaged."""
+ """Interface for RedditContentObjects that can be messaged."""
def compose_message(self, subject, message):
return self.reddit_session.compose_message(self, subject, message)
class Reportable(RedditContentObject):
- """Interface for Reddit content objects that can be reported."""
+ """Interface for RedditContentObjects that can be reported."""
@require_login
def report(self):
url = self.reddit_session.config['report']
@@ -211,7 +210,7 @@ def report(self):
class Saveable(RedditContentObject):
- """Interface for Reddit content objects that can be saved."""
+ """Interface for RedditContentObjects that can be saved."""
@require_login
def save(self, unsave=False):
"""If logged in, save the content."""
@@ -228,7 +227,7 @@ def unsave(self):
class Voteable(RedditContentObject):
- """Interface for Reddit content objects that can be voted on."""
+ """Interface for RedditContentObjects that can be voted on."""
def clear_vote(self):
return self.vote()
@@ -354,7 +353,7 @@ def comments(self, update=True):
class Redditor(Messageable):
- """A class for Redditor methods."""
+ """A class representing the users of reddit."""
get_overview = _get_section('')
get_comments = _get_section('comments')
get_submitted = _get_section('submitted')
@@ -403,7 +402,7 @@ def unfriend(self):
class LoggedInRedditor(Redditor):
- """A class for a currently logged in redditor"""
+ """A class for a currently logged in Redditor"""
@require_login
def get_inbox(self, limit=0):
"""Return a generator for inbox messages."""
@@ -443,7 +442,7 @@ def my_reddits(self, limit=0):
class Submission(Approvable, Deletable, Distinguishable, Editable, Reportable,
Saveable, Voteable):
- """A class for submissions to Reddit."""
+ """A class for submissions to reddit."""
@staticmethod
def get_info(reddit_session, url, comments_only=False):
url_data = {}
@@ -771,7 +770,7 @@ class UserList(RedditContentObject):
def __init__(self, reddit_session, json_dict=None, fetch=False):
super(UserList, self).__init__(reddit_session, json_dict, fetch)
- # HACK: Convert children to RedditorObjects
+ # HACK: Convert children to Redditor instances
for i in range(len(self.children)):
tmp = self.children[i]
redditor = Redditor(reddit_session, tmp['name'], fetch=False)
View
@@ -1,23 +1,23 @@
-# This file is part of reddit_api.
+# This file is part of PRAW.
#
-# reddit_api is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# PRAW is free software: you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
#
-# reddit_api is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# PRAW is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
-# along with reddit_api. If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License along with
+# PRAW. If not, see <http://www.gnu.org/licenses/>.
-import reddit.backport # pylint: disable-msg=W0611
+from . import backport # pylint: disable-msg=W0611
import os
import sys
from six.moves import configparser
+from warnings import warn_explicit
def _load_configuration():
@@ -29,9 +29,9 @@ def _load_configuration():
os_config_path = os.environ['XDG_CONFIG_HOME']
else: # Legacy Linux
os_config_path = os.path.join(os.environ['HOME'], '.config')
- locations = [os.path.join(module_dir, 'reddit_api.cfg'),
- os.path.join(os_config_path, 'reddit_api', 'reddit_api.cfg'),
- 'reddit_api.cfg']
+ locations = [os.path.join(module_dir, 'praw.ini'),
+ os.path.join(os_config_path, 'praw.ini'),
+ 'praw.ini']
if not config.read(locations):
raise Exception('Could not find config file in any of: %s' % locations)
return config
Oops, something went wrong.

0 comments on commit adaf89f

Please sign in to comment.