Skip to content

Commit

Permalink
Merge pull request #127 from FriedrichFroebel/typoFixes
Browse files Browse the repository at this point in the history
Fix some typos and add some code formatting
  • Loading branch information
FriedrichFroebel committed Oct 8, 2019
2 parents 8ff9377 + 9e1a921 commit 79af9f9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ Coding style
- For code, follow `PEP8 <https://www.python.org/dev/peps/pep-0008/>`_.

- Use **double quotes**.
- Try to keep line length below **100 characters** (or 120 if absolutely nescessary).
- Try to keep line length below **100 characters** (or 120 if absolutely necessary).
- Use `.format()` for string formatting.

- For docs, please follow `PEP257 <https://www.python.org/dev/peps/pep-0257/>`_.
- **Importing modules** is okay for modules from standard library. If you want to include
- **Importing modules** is okay for modules from standard library. If you want to include a
third-party module, please consult it on GitHub before.
- `Please use regular expressions only as a last resort. <http://imgur.com/j3G9xyP>`_ When possible, use string manipulations,
such as :code:`split()` and then list operations. It is more readable.
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Features
- **search** caches

- normal search (unlimited number of caches from any point)
- quick search (all caches inside some area) - currently not working, see bellow
- quick search (all caches inside some area) - currently not working, see below

- **get cache** and its details

Expand Down Expand Up @@ -86,9 +86,9 @@ and ``password`` from that file as login credentials.
You can also provide multiple username and password tuples in a file as login credentials.
The tuple to be used can be chosen by providing its username when calling pycaching.login(),
e.g. pycaching.login("myusername2"). The first username and password tuple specified will be
used as default if pycaching.login() is called without providing a username.
The tuple to be used can be chosen by providing its username when calling ``pycaching.login()``,
e.g. ``pycaching.login("myusername2")``. The first username and password tuple specified will be
used as default if ``pycaching.login()`` is called without providing a username.

.. code-block:: json
Expand All @@ -111,7 +111,7 @@ using the ``password_cmd`` key instead of ``password``.
# sample .gc_credentials JSON file with password command
{ "username": "myusername", "password_cmd": "pass geocaching.com/myUsername" }
Note that the ``password`` and ``password_cmd`` keys are mutually exclusisive.
Note that the ``password`` and ``password_cmd`` keys are mutually exclusive.



Expand All @@ -127,7 +127,7 @@ Load a cache details
This uses lazy loading, so the `Cache <https://pycaching.readthedocs.io/en/latest/api.html#cache>`__
object is created immediately and the page is loaded when needed (accessing the name).

You can use different method of loading cache details. It will be much faster, but it will load less
You can use a different method of loading cache details. It will be much faster, but it will load less
details:

.. code-block:: python
Expand Down Expand Up @@ -158,7 +158,7 @@ Post a log to cache
geocaching.post_log("GC1PAR2", "Found cache in the rain. Nice place, TFTC!")
It is also possible to call post_log on `Cache
It is also possible to call ``post_log`` on `Cache
<https://pycaching.readthedocs.io/en/latest/api.html#cache>`__ object, but you would have to create
`Log <https://pycaching.readthedocs.io/en/latest/api.html#log>`__ object manually and pass it to
this method.
Expand Down
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
API reference
===============================================================================

Here you can find an overview of all avaliable classes and methods.
Here you can find an overview of all available classes and methods.

.. warning::
Deprecated methods will be removed in next minor version.
Expand Down
2 changes: 1 addition & 1 deletion pycaching/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Cache(object):

@classmethod
def _from_print_page(cls, geocaching, guid, soup):
"""Create a cache instance from a souped print-page and a GUID"""
"""Create a cache instance from a souped print-page and a GUID."""
if soup.find("p", "Warning") is not None:
raise errors.PMOnlyException()

Expand Down
6 changes: 3 additions & 3 deletions pycaching/geocaching.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def search(self, point, limit=float("inf")):
Search for caches around some point by loading search pages and parsing the data from these
pages. Yield :class:`.Cache` objects filled with data from search page. You can provide limit
as a convinient way to stop generator after certain number of caches.
as a convenient way to stop generator after certain number of caches.
:param .geo.Point point: Search center point.
:param int limit: Maximum number of caches to generate.
Expand All @@ -241,7 +241,7 @@ def search(self, point, limit=float("inf")):
# result is empty - no more caches
return

# prepare language-dependant mappings
# prepare language-dependent mappings
if start_index == 0:
cache_sizes_filter_wrapper = whole_page.find("div", class_="cache-sizes-wrapper")
localized_size_mapping = {
Expand Down Expand Up @@ -406,7 +406,7 @@ def _cache_from_guid(self, guid):
def _try_getting_cache_from_guid(self, guid):
"""Try to get a cache from guid page if possible, otherwise from gccode.
:param str guid: guid of the cache that should be read in
:param str guid: Guid of the cache that should be read in.
"""
try:
return self.get_cache(guid=guid)
Expand Down
4 changes: 2 additions & 2 deletions pycaching/trackable.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pycaching import errors
from pycaching.util import lazy_loaded, format_date

# prefix _type() function to avoid colisions with trackable type
# prefix _type() function to avoid collisions with trackable type
_type = type


Expand Down Expand Up @@ -204,7 +204,7 @@ def load(self):
def _load_log_page(self):
"""Load a logging page for this trackable.
:return: Tuple of data nescessary to log the trackable.
:return: Tuple of data necessary to log the trackable.
:rtype: :class:`tuple` of (:class:`set`:, :class:`dict`, class:`str`)
"""
if not self._log_page_url:
Expand Down

0 comments on commit 79af9f9

Please sign in to comment.