text stringlengths 1 843k ⌀ |
|---|
"""miscellaneous zmq_utils wrapping"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from zmq.error import InterruptedSystemCall, _check_rc, _check_version
from ._cffi import ffi
from ._cffi import lib as C
def has(capability):
"""Check for zmq capability by name (... |
"""zmq poll function"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
try:
from time import monotonic
except ImportError:
from time import clock as monotonic
import warnings
from zmq.error import InterruptedSystemCall, _check_rc
from ._cffi import ffi
from ._cf... |
"""CFFI backend (for PyPy)"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
# for clearer error message on missing cffi
import cffi # noqa
from zmq.backend.cffi import _poll, context, devices, error, message, socket, utils
from ._cffi import ffi
from ._cffi import lib ... |
# cython: language_level = 3str
# cython: freethreading_compatible = True
"""Cython backend for pyzmq"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
try:
import cython
if not cython.compiled:
raise ImportError()
excep... |
"""Python bindings for core 0MQ objects."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from . import _zmq
# mq not in __all__
from ._zmq import * # noqa
from ._zmq import monitored_queue # noqa
Message = _zmq.Frame
__all__ = ["Message"]
__all__.extend(_zmq.__all__... |
"""Classes for running 0MQ Devices in the background."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import time
from multiprocessing import Process
from threading import Thread
from typing import Any, Callable, List, Optional, Tuple
import zmq
from zmq import ENOTSOCK... |
"""pure Python monitored_queue function
For use when Cython extension is unavailable (PyPy).
Authors
-------
* MinRK
"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from typing import Callable
import zmq
from zmq.backend import monitored_queue as _backend_mq
def _r... |
"""MonitoredQueue classes and functions."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from zmq import PUB
from zmq.devices.monitoredqueue import monitored_queue
from zmq.devices.proxydevice import ProcessProxy, Proxy, ProxyBase, ThreadProxy
class MonitoredQueueBase(... |
"""Proxy classes and functions."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import zmq
from zmq.devices.basedevice import Device, ProcessDevice, ThreadDevice
class ProxyBase:
"""Base class for overriding methods."""
def __init__(self, in_type, out_type, mo... |
"""Classes for running a steerable ZMQ proxy"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import zmq
from zmq.devices.proxydevice import ProcessProxy, Proxy, ThreadProxy
class ProxySteerableBase:
"""Base class for overriding methods."""
def __init__(self, i... |
"""0MQ Device classes for running in background threads or processes."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
from zmq import DeviceType, proxy
from zmq.devices import (
basedevice,
monitoredqueue,
monitoredqueuedev... |
"""Future-returning APIs for tornado coroutines.
.. seealso::
:mod:`zmq.asyncio`
"""
# Copyright (c) PyZMQ Developers.
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
import asyncio
import warnings
from typing import Any
from tornado.concurrent import Future
from ... |
"""tornado IOLoop API with zmq compatibility
This module is deprecated in pyzmq 17.
To use zmq with tornado,
eventloop integration is no longer required
and tornado itself should be used.
"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import warnings
def _deprecated... |
# Derived from iostream.py from tornado 1.0, Copyright 2009 Facebook
# Used under Apache License Version 2.0
#
# Modifications are Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
"""A utility class for event-based messaging on a zmq socket using tornado.
.. seealso::
- :m... |
"""tornado IOLoop API with zmq compatibility
If you have tornado ≥ 3.0, this is a subclass of tornado's IOLoop,
otherwise we ship a minimal subset of tornado in zmq.eventloop.minitornado.
The minimal shipped version of tornado's IOLoop does not include
support for concurrent futures - this will only be available if y... |
"""Tornado eventloop integration for pyzmq"""
from tornado.ioloop import IOLoop
__all__ = ['IOLoop']
|
# -----------------------------------------------------------------------------
# Copyright (C) 2011-2012 Travis Cline
#
# This file is part of pyzmq
# It is adapted from upstream project zeromq_gevent under the New BSD License
#
# Distributed under the terms of the New BSD License. The full license is in
# the f... |
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
import zmq
from zmq.green import Poller
def device(device_type, isocket, osocket):
"""Start a zeromq device (gevent-compatible).
Unlike the true zmq.device, this does not release th... |
from __future__ import annotations
import gevent
from gevent import select
import zmq
from zmq import Poller as _original_Poller
class _Poller(_original_Poller):
"""Replacement for :class:`zmq.Poller`
Ensures that the greened Poller below is used in calls to
:meth:`zmq.Poller.poll`.
"""
_geven... |
# -----------------------------------------------------------------------------
# Copyright (C) 2011-2012 Travis Cline
#
# This file is part of pyzmq
# It is adapted from upstream project zeromq_gevent under the New BSD License
#
# Distributed under the terms of the New BSD License. The full license is in
# the f... |
from zmq.eventloop.ioloop import * # noqa
|
from zmq.eventloop import zmqstream
from zmq.green.eventloop.ioloop import IOLoop
class ZMQStream(zmqstream.ZMQStream):
def __init__(self, socket, io_loop=None):
io_loop = io_loop or IOLoop.instance()
super().__init__(socket, io_loop=io_loop)
__all__ = ["ZMQStream"]
|
from zmq.green.eventloop.ioloop import IOLoop
__all__ = ['IOLoop']
|
"""pyzmq logging handlers.
This mainly defines the PUBHandler object for publishing logging messages over
a zmq.PUB socket.
The PUBHandler can be used with the regular logging module, as in::
>>> import logging
>>> handler = PUBHandler('tcp://127.0.0.1:12345')
>>> handler.root_topic = 'foo'
>>> logge... |
null |
"""pyzmq log watcher.
Easily view log messages published by the PUBHandler in zmq.log.handlers
Designed to be run as an executable module - try this to see options:
python -m zmq.log -h
Subscribes to the '' (empty string) topic by default which means it will work
out-of-the-box with a PUBHandler object instantia... |
#
# This file is adapted from a paramiko demo, and thus licensed under LGPL 2.1.
# Original Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
# Edits Copyright (C) 2010 The IPython Team
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Publ... |
"""Basic ssh tunnel utilities, and convenience functions for tunneling
zeromq connections.
"""
# Copyright (C) 2010-2011 IPython Development Team
# Copyright (C) 2011- PyZMQ Developers
#
# Redistributed from IPython under the terms of the BSD License.
import atexit
import os
import re
import signal
import socket
imp... |
from zmq.ssh.tunnel import *
|
"""Mixin for mapping set/getattr to self.set/get"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
import errno
from typing import TypeVar, Union
from .. import constants
T = TypeVar("T")
OptValT = Union[str, bytes, int]
class Attribu... |
"""Python bindings for 0MQ."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
import atexit
import os
from threading import Lock
from typing import Any, Callable, Generic, TypeVar, overload
from warnings import warn
from weakref import W... |
"""0MQ Frame pure Python methods."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import zmq
from zmq.backend import Frame as FrameBase
from .attrsettr import AttributeSetter
def _draft(v, feature):
zmq.error._check_version(v, feature)
if not zmq.DRAFT_API:
... |
"""0MQ polling related functions and classes."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
from typing import Any
from zmq.backend import zmq_poll
from zmq.constants import POLLERR, POLLIN, POLLOUT
# ------------------------------... |
"""0MQ Socket pure Python methods."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
import errno
import pickle
import random
import sys
from typing import (
Any,
Callable,
Generic,
List,
Literal,
Sequence,
Ty... |
"""Deprecated Stopwatch implementation"""
# Copyright (c) PyZMQ Development Team.
# Distributed under the terms of the Modified BSD License.
class Stopwatch:
"""Deprecated zmq.Stopwatch implementation
You can use Python's builtin timers (time.monotonic, etc.).
"""
def __init__(self):
import... |
"""Tracker for zero-copy messages with 0MQ."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
import time
from threading import Event
from zmq.backend import Frame
from zmq.error import NotDone
class MessageTracker:
"""A class for... |
"""PyZMQ and 0MQ version functions."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
import re
from typing import Match, cast
from zmq.backend import zmq_version_info
__version__: str = "26.4.0"
_version_pat = re.compile(r"(\d+)\.(\d+)... |
"""pure-Python sugar wrappers for core 0MQ objects."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
from zmq import error
from zmq.backend import proxy
from zmq.constants import DeviceType
from zmq.sugar import context, frame, poll, so... |
# Copyright (c) PyZMQ Developers.
# Distributed under the terms of the Modified BSD License.
import os
import platform
import signal
import sys
import time
import warnings
from functools import partial
from threading import Thread
from typing import List
from unittest import SkipTest, TestCase
from pytest import mark... |
"""Garbage collection thread for representing zmq refcount of Python objects
used in zero-copy sends.
"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import atexit
import struct
import warnings
from collections import namedtuple
from os import getpid
from threading impo... |
"""Utils for interoperability with other libraries.
Just CFFI pointer casting for now.
"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from typing import Any
def cast_int_addr(n: Any) -> int:
"""Cast an address to a Python int
This could be a Python integer ... |
"""JSON serialize to/from utf8 bytes
.. versionchanged:: 22.2
Remove optional imports of different JSON implementations.
Now that we require recent Python, unconditionally use the standard library.
Custom JSON libraries can be used via custom serialization functions.
"""
# Copyright (C) PyZMQ Developers
#... |
"""Module holding utility and convenience functions for zmq event monitoring."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
import struct
from typing import Awaitable, TypedDict, overload
import zmq
import zmq.asyncio
from zmq.error... |
"""Declare basic string types unambiguously for various Python versions.
Authors
-------
* MinRK
"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import warnings
bytes = bytes
unicode = str
basestring = (str,)
def cast_bytes(s, encoding='utf8', errors='strict'):
... |
"""Win32 compatibility utilities."""
# -----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
# -----------------------------------------------------------------------------
from __future__ import annotat... |
"""Python implementation of Z85 85-bit encoding
Z85 encoding is a plaintext encoding for a bytestring interpreted as 32bit integers.
Since the chunks are 32bit, a bytestring must be a multiple of 4 bytes.
See ZMQ RFC 32 for details.
"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified ... |
null |
__import__('_distutils_hack').do_override()
|
# don't import any costly modules
import os
import sys
report_url = (
"https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml"
)
def warn_distutils_present():
if 'distutils' not in sys.modules:
return
import warnings
warnings.warn(
"Distutils was imported be... |
# This is a stub package designed to roughly emulate the _yaml
# extension module, which previously existed as a standalone module
# and has been moved into the `yaml` package namespace.
# It does not perfectly mimic its old counterpart, but should get
# close enough for anyone who's relying on it even when they should... |
# postinstall script for pywin32
#
# copies pywintypesXX.dll and pythoncomXX.dll into the system directory,
# and creates a pth file
import argparse
import glob
import os
import shutil
import sys
import sysconfig
import tempfile
import winreg
tee_f = open(
os.path.join(
tempfile.gettempdir(), # Send outpu... |
"""A test runner for pywin32"""
import os
import site
import subprocess
import sys
# locate the dirs based on where this script is - it may be either in the
# source tree, or in an installed Python 'Scripts' tree.
project_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
site_packages = [site.getuser... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.