Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ include src/*.cpp
include src/p4p/*.pyx
include src/p4p/*.pxd
include src/p4p/pvxs/*.pxd
include src/p4p/*.pyi
include src/p4p/*.conf
include src/p4p/*.service
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def get_numpy_include_dirs():
install_requires = install_requires,
extras_require={
'qt': ['qtpy'],
'stubgen': ['mypy>=2.1.0; python_version>="3.8"'],
},
entry_points = {
'console_scripts': ['pvagw=p4p.gw:main'],
Expand Down
92 changes: 92 additions & 0 deletions src/p4p/_gw.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import _cython_3_2_5
import p4p._p4p
from _typeshed import Incomplete
from typing import Any

Server_report: _cython_3_2_5.cython_function_or_method
__reduce_cython__: _cython_3_2_5.cython_function_or_method
__setstate_cython__: _cython_3_2_5.cython_function_or_method
__test__: dict
addOdometer: _cython_3_2_5.cython_function_or_method

class Channel(InfoBase):
expired: Incomplete
name: Incomplete
@classmethod
def __init__(cls, *args, **kwargs) -> None:
"""Create and return a new object. See help(type) for accurate signature."""
def access(self, *args, **kwargs): ...
def __reduce__(self): ...

class CreateOp(InfoBase):
"""Handle for in-progress Channel creation request
"""
name: Incomplete
@classmethod
def __init__(cls, *args, **kwargs) -> None:
"""Create and return a new object. See help(type) for accurate signature."""
def create(self, *args, **kwargs):
"""Create a Channel with a given upstream (server-side) name

:param bytes name: Upstream name to use. This is what the GW Client will search for.
:returns: A `Channel`
"""
def __reduce__(self): ...

class InfoBase:
account: Incomplete
peer: Incomplete
roles: Incomplete
@classmethod
def __init__(cls, *args, **kwargs) -> None:
"""Create and return a new object. See help(type) for accurate signature."""
def __reduce__(self): ...

class Provider(p4p._p4p.Source):
BanHost: Incomplete
BanHostPV: Incomplete
BanPV: Incomplete
Claim: Incomplete
Ignore: Incomplete
def __init__(self, *args, **kwargs) -> None:
"""Initialize self. See help(type(self)) for accurate signature."""
def cachePeek(self, *args, **kwargs):
"""Returns PV names in channel cache

:returns: a set of strings
"""
def clearBan(self, *args, **kwargs):
"""Clear the negative results cache
"""
def forceBan(self, *args, **kwargs):
"""Preemptively Add an entry to the negative result cache.
Either host or usname must be not None

:param bytes host: None or a host name
:param bytes usname: None or a upstream (Server side) PV name
"""
def ignoreByGUID(self, *args, **kwargs): ...
def report(self, *args, **kwargs):
"""Run Client/Upstream bandwidth usage report

:returns: List of tuple
:rtype: [(usname, opTx, opRx, peer, trTx, trRx)]
"""
def stats(self, *args, **kwargs):
"""Return statistics of various internal caches

:rtype: dict
"""
def sweep(self, *args, **kwargs):
"""Call periodically to remove unused `Channel` from channel cache.
"""
def testChannel(self, usname) -> Any:
"""testChannel(usname)
Add the upstream name to the channel cache and begin trying to connect.
Returns Claim if the channel is connected, and Ignore if it is not.

:param bytes usname: Upstream (Server side) PV name
:returns: Claim or Ignore
"""
def use_count(self, *args, **kwargs): ...
def __reduce__(self): ...
1 change: 1 addition & 0 deletions src/p4p/_gw.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# distutils: language = c++
#cython: language_level=2
#cython: binding=True

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not strictly necessary as it has been default behaviour in Cython since 3.0. The flag is set so that stubgen can use introspection to determine typing information.


cimport cython

Expand Down
Loading
Loading