Browse Source

Cleaning up Docs

Trying to get coverage to upload to devpi and cleaning up Sphinx docs
master
Nate Bohman 5 years ago
parent
commit
f7d422919d
Signed by: Nate Bohman <natrinicle@gmail.com> GPG Key ID: C10546A54ABA1CE5
3 changed files with 24 additions and 24 deletions
  1. +1
    -0
      MANIFEST.in
  2. +2
    -0
      docs/source/conf.py
  3. +21
    -24
      shm_dict/shm_dict.py

+ 1
- 0
MANIFEST.in View File

include tox.ini include tox.ini
include docs/source/conf.py include docs/source/conf.py
include docs/source/coverage/extract_source.py include docs/source/coverage/extract_source.py
include docs/source/coverage/*.source.html
include docs/[mM]ake* include docs/[mM]ake*
recursive-include . *.gitkeep recursive-include . *.gitkeep
recursive-include docs/source *.rst recursive-include docs/source *.rst

+ 2
- 0
docs/source/conf.py View File

# name if not the default objects.inv # name if not the default objects.inv
intersphinx_mapping = { intersphinx_mapping = {
"arrow": ("https://arrow.readthedocs.io/en/latest/", None), "arrow": ("https://arrow.readthedocs.io/en/latest/", None),
"py2": ("https://docs.python.org/2", None),
"py3": ("https://docs.python.org/3", None),
"python": ("https://docs.python.org/3", None), "python": ("https://docs.python.org/3", None),
"requests": ("http://docs.python-requests.org/en/master/", None), "requests": ("http://docs.python-requests.org/en/master/", None),
"six": ("https://six.readthedocs.io/", None), "six": ("https://six.readthedocs.io/", None),

+ 21
- 24
shm_dict/shm_dict.py View File

import sys import sys
import threading import threading


# Related third party imports (If you used pip/apt/yum to install)
import posix_ipc import posix_ipc
import six import six


__email__ = "natrinicle@natrinicle.com" __email__ = "natrinicle@natrinicle.com"
__status__ = "Production" __status__ = "Production"


# Get the current working directory and add it to the sys.path unless it's already in there.
CWD = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
if CWD not in sys.path:
sys.path.append(CWD)

logger = logging.getLogger(__name__) # pylint: disable=invalid-name logger = logging.getLogger(__name__) # pylint: disable=invalid-name




class SHMDict(MutableMapping): class SHMDict(MutableMapping):
"""Python shared memory file descriptor.

:param name: Name for shared memory and semaphore if volatile
or path to file if persistent.
:param persist: True if name is the path to a file and this
shared memory dictionary should be written
out to the file for persistence between runs
and/or processes.
:param lock_timeout: Time in seconds before giving up on
acquiring an exclusive lock to the
dictionary.
:param auto_unlock: If the lock_timeout is hit, and this
is True, automatically bypass the
lock and use the dictionary anyway.
:type name: :class:`str`
:type persist: :class:`bool`
:type lock_timeout: :class:`int` or :class:`float`
:type auto_unlock: :class:`bool`
"""
"""Python shared memory dictionary."""


def __init__(self, name, persist=False, lock_timeout=30, auto_unlock=False): def __init__(self, name, persist=False, lock_timeout=30, auto_unlock=False):
"""Standard init method.

:param name: Name for shared memory and semaphore if volatile
or path to file if persistent.
:param persist: True if name is the path to a file and this
shared memory dictionary should be written
out to the file for persistence between runs
and/or processes.
:param lock_timeout: Time in seconds before giving up on
acquiring an exclusive lock to the
dictionary.
:param auto_unlock: If the lock_timeout is hit, and this
is True, automatically bypass the
lock and use the dictionary anyway.
:type name: :class:`str`
:type persist: :class:`bool`
:type lock_timeout: :class:`int` or :class:`float`
:type auto_unlock: :class:`bool`
"""
self.name = name self.name = name
self.persist_file = None self.persist_file = None
self.lock_timeout = lock_timeout self.lock_timeout = lock_timeout

Loading…
Cancel
Save