Skip to content

Commit

Permalink
Added MemoryIO
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Zoppi <[email protected]>
  • Loading branch information
TexZK committed Dec 7, 2023
1 parent 9090b42 commit bf71529
Show file tree
Hide file tree
Showing 14 changed files with 2,025 additions and 6 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exclude_lines =
# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
@pytest\.mark\.skip

# Don't complain if non-runnable code isn't run:
if 0:
Expand Down
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ include pyproject.toml
include setup.cfg
include tox.ini

exclude build
exclude dist
exclude htmlcov
exclude .tox
exclude .pytest_cache

global-exclude *.py[cod] __pycache__ *.so *.dylib
2 changes: 1 addition & 1 deletion docs/_autosummary/bytesparse.base.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bytesparse.base
bytesparse.base
===============

.. automodule:: bytesparse.base
Expand Down
2 changes: 1 addition & 1 deletion docs/_autosummary/bytesparse.inplace.Memory.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bytesparse.inplace.Memory
bytesparse.inplace.Memory
=========================

.. currentmodule:: bytesparse.inplace
Expand Down
2 changes: 1 addition & 1 deletion docs/_autosummary/bytesparse.inplace.bytesparse.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bytesparse.inplace.bytesparse
bytesparse.inplace.bytesparse
=============================

.. currentmodule:: bytesparse.inplace
Expand Down
56 changes: 56 additions & 0 deletions docs/_autosummary/bytesparse.io.MemoryIO.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
bytesparse.io.MemoryIO
======================

.. currentmodule:: bytesparse.io

.. autoclass:: MemoryIO
:members:
:inherited-members:
:private-members:
:special-members:



.. rubric:: Methods

.. autosummary::
:nosignatures:

~MemoryIO.__init__
~MemoryIO.close
~MemoryIO.detach
~MemoryIO.fileno
~MemoryIO.flush
~MemoryIO.getbuffer
~MemoryIO.getvalue
~MemoryIO.isatty
~MemoryIO.peek
~MemoryIO.read
~MemoryIO.read1
~MemoryIO.readable
~MemoryIO.readinto
~MemoryIO.readinto1
~MemoryIO.readline
~MemoryIO.readlines
~MemoryIO.seek
~MemoryIO.seekable
~MemoryIO.skip_data
~MemoryIO.skip_hole
~MemoryIO.tell
~MemoryIO.truncate
~MemoryIO.writable
~MemoryIO.write
~MemoryIO.writelines





.. rubric:: Attributes

.. autosummary::

~MemoryIO.closed
~MemoryIO.memory


32 changes: 32 additions & 0 deletions docs/_autosummary/bytesparse.io.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
bytesparse.io
=============

.. automodule:: bytesparse.io











.. rubric:: Classes

.. autosummary::
:toctree:
:template: custom-class-template.rst
:nosignatures:

MemoryIO









1 change: 1 addition & 0 deletions docs/_autosummary/bytesparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@

bytesparse.base
bytesparse.inplace
bytesparse.io

4 changes: 3 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ ignore =
*.so

[flake8]
max-line-length = 120
exclude = */migrations/*
max-line-length = 120
per-file-ignores =
src/bytesparse/__init__.py: F401

[tool:pytest]
testpaths = tests
Expand Down
5 changes: 3 additions & 2 deletions src/bytesparse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,6 @@

__version__ = '0.0.7'

from .inplace import Memory # noqa F401
from .inplace import bytesparse # noqa F401
from .inplace import Memory
from .inplace import bytesparse
from .io import MemoryIO
27 changes: 27 additions & 0 deletions src/bytesparse/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,14 @@ def find(
Returns:
int: The index of the first item equal to `value`, or -1.
Warnings:
If the memory allows negative addresses, :meth:`index` is more
appropriate, because it raises :obj:`ValueError` if the item is
not found.
See Also:
:meth:`index`
"""
...

Expand Down Expand Up @@ -2411,6 +2419,9 @@ def index(
Raises:
:obj:`ValueError`: Item not found.
See Also:
:meth:`find`
"""
...

Expand Down Expand Up @@ -2741,6 +2752,14 @@ def rfind(
Returns:
int: The index of the last item equal to `value`, or -1.
Warnings:
If the memory allows negative addresses, :meth:`rindex` is more
appropriate, because it raises :obj:`ValueError` if the item is
not found.
See Also:
:meth:`rindex`
"""
...

Expand Down Expand Up @@ -2770,6 +2789,14 @@ def rindex(
Raises:
:obj:`ValueError`: Item not found.
Warnings:
If the memory allows negative addresses, :meth:`index` is more
appropriate, because it raises :obj:`ValueError` if the item is
not found.
See Also:
:meth:`rfind`
"""
...

Expand Down
Loading

0 comments on commit bf71529

Please sign in to comment.