-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed circular import and empty ns hostname lookup
- Loading branch information
Showing
13 changed files
with
97 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
Pyro - Python Remote Objects. Copyright by Irmen de Jong ([email protected]). | ||
""" | ||
|
||
__version__ = "5.9" | ||
__version__ = "5.9.1" | ||
__author__ = "Irmen de Jong" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import threading | ||
from . import errors | ||
|
||
|
||
# call context thread local | ||
class _CallContext(threading.local): | ||
def __init__(self): | ||
# per-thread initialization | ||
self.client = None | ||
self.client_sock_addr = None | ||
self.seq = 0 | ||
self.msg_flags = 0 | ||
self.serializer_id = 0 | ||
self.annotations = {} | ||
self.response_annotations = {} | ||
self.correlation_id = None | ||
|
||
def to_global(self): | ||
return dict(self.__dict__) | ||
|
||
def from_global(self, values): | ||
self.client = values["client"] | ||
self.seq = values["seq"] | ||
self.msg_flags = values["msg_flags"] | ||
self.serializer_id = values["serializer_id"] | ||
self.annotations = values["annotations"] | ||
self.response_annotations = values["response_annotations"] | ||
self.correlation_id = values["correlation_id"] | ||
self.client_sock_addr = values["client_sock_addr"] | ||
|
||
def track_resource(self, resource): | ||
"""keep a weak reference to the resource to be tracked for this connection""" | ||
if self.client: | ||
self.client.tracked_resources.add(resource) | ||
else: | ||
raise errors.PyroError("cannot track resource on a connectionless call") | ||
|
||
def untrack_resource(self, resource): | ||
"""no longer track the resource for this connection""" | ||
if self.client: | ||
self.client.tracked_resources.discard(resource) | ||
else: | ||
raise errors.PyroError("cannot untrack resource on a connectionless call") | ||
|
||
|
||
current_context = _CallContext() | ||
"""the context object for the current call. (thread-local)""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,6 @@ | |
Pyro - Python Remote Objects. Copyright by Irmen de Jong ([email protected]). | ||
""" | ||
|
||
# the symbols that were available in Pyro4 as Pyro4.* : | ||
# from Pyro4.core import URI, Proxy, Daemon, callback, batch, asyncproxy, oneway, expose, behavior, current_context | ||
# from Pyro4.core import _locateNS as locateNS, _resolve as resolve | ||
# from Pyro4.futures import Future | ||
|
||
import sys | ||
import ipaddress | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.