move scripts

This commit is contained in:
AF 2023-01-01 05:48:55 +00:00
parent c520ef646a
commit f3703c634e
11 changed files with 48 additions and 21 deletions

View File

@ -28,11 +28,18 @@ RUN cp -r /app/legacy/ptvp35/docs/build/html/ /app/docs/build/html/1.1rc0/
RUN rm -r /app/legacy/ptvp35/docs/build/ RUN rm -r /app/legacy/ptvp35/docs/build/
WORKDIR /app/legacy/ptvp35/ WORKDIR /app/legacy/ptvp35/
RUN git fetch && git checkout 1.1rc2
WORKDIR /app/legacy/ptvp35/docs/
RUN make html
RUN cp -r /app/legacy/ptvp35/docs/build/html/ /app/docs/build/html/1.1rc2/
RUN rm -r /app/legacy/ptvp35/docs/build/
WORKDIR /app/legacy/ptvp35/
WORKDIR /app/ WORKDIR /app/
COPY docs/Makefile docs/Makefile COPY docs/Makefile docs/Makefile
COPY setup.py setup.py COPY setup.py setup.py
COPY traced_example.py traced_example.py COPY docs/scripts docs/scripts
COPY ptvp35 ptvp35 COPY ptvp35 ptvp35
COPY docs/source docs/source COPY docs/source docs/source
WORKDIR /app/docs/ WORKDIR /app/docs/

View File

@ -17,6 +17,6 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new # Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile %: Makefile
python ../traced_example.py > ../traced_example.txt python scripts/traced_example.py > scripts/traced_example.txt
python ../traced_example.py all > ../traced_example_all.txt python scripts/traced_example.py all > scripts/traced_example_all.txt
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

View File

@ -4,8 +4,13 @@ import sys
import threading import threading
from contextlib import ExitStack from contextlib import ExitStack
try:
sys.path.append('/app/')
from ptvp35 import * from ptvp35 import *
from ptvp35.instrumentation import * from ptvp35.instrumentation import *
except:
raise
async def aprint(*args, **kwargs): async def aprint(*args, **kwargs):
@ -135,7 +140,7 @@ run_all = 'all' in sys.argv
async def main(): async def main():
(path := pathlib.Path('dev.db')).unlink(missing_ok=True) (path := pathlib.Path(__file__).parent / 'trace_example.db').unlink(missing_ok=True)
with ExitStack() as es: with ExitStack() as es:
LogWrites().enter(es) LogWrites().enter(es)

View File

@ -18,3 +18,5 @@ These apply both to the internal PARRRATE TNV team behind Persistence 5 and to e
* Forking of the repository is encouraged. * Forking of the repository is encouraged.
* Usage of the repository as a reference for custom data storage solutions is encouraged. * Usage of the repository as a reference for custom data storage solutions is encouraged.
* Instrumentation code base is more open to direct code contributions. * Instrumentation code base is more open to direct code contributions.
* Main way of instrumentation is code injection.
* Instrumentation on its own shouldn't require changes to the core code, even though instrumentation-allowing core code is preferred.

View File

@ -1,12 +1,7 @@
Historical notes Historical notes
================ ================
Persistence 1. Persistence 1/2. CmbPrst.
--------------
* Used by CMB.
Persistence 2. CmbPrst.
-------------- --------------
* Internal storage of CMB. * Internal storage of CMB.

View File

@ -9,6 +9,7 @@ Memory-Resident DataBase for simple single-process asynchronous Python applicati
motivation motivation
usage usage
structure
guarantees guarantees
ordering ordering
projects projects

View File

@ -1,5 +1,5 @@
ptvp35 Modules
====== =======
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 4

View File

@ -4,17 +4,17 @@ Traced example of how ordering works in persistence5
Source Source
------ ------
.. literalinclude :: ../../traced_example.py .. literalinclude :: ../scripts/traced_example.py
:language: python3 :language: python3
Writes/reads log Writes/reads log
---------------- ----------------
.. literalinclude :: ../../traced_example.txt .. literalinclude :: ../scripts/traced_example.txt
:language: plain :language: plain
Everything log Everything log
-------------- --------------
.. literalinclude :: ../../traced_example_all.txt .. literalinclude :: ../scripts/traced_example_all.txt
:language: plain :language: plain

View File

@ -1,5 +1,5 @@
ptvp35 package ptvp35 (API Reference)
============== ======================
Module contents Module contents
--------------- ---------------

17
docs/source/structure.rst Normal file
View File

@ -0,0 +1,17 @@
Inner structure
===============
Main-Memory DataBase
--------------------
DataBase Stream File
--------------------
Request Queue
-------------
Transaction View
----------------
Transaction
-----------

View File

@ -23,7 +23,7 @@ Basic functionality
.. code-block:: python3 .. code-block:: python3
import pathlib import pathlib
from ptvp35 import DbFactory, KVJson from ptvp35 import *
async def main(): async def main():
async with DbFactory(pathlib.Path('example.db'), kvfactory=KVJson()) as connection: async with DbFactory(pathlib.Path('example.db'), kvfactory=KVJson()) as connection:
@ -33,7 +33,7 @@ Different ways to get/set a value:
.. code-block:: python3 .. code-block:: python3
from ptvp35 import DbConnection from ptvp35 import *
async def _main(connection: DbConnection): async def _main(connection: DbConnection):
value0 = connection.get('increment-0', 0) value0 = connection.get('increment-0', 0)