-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readability - node.server is in fact an InternalSession instance #754
base: master
Are you sure you want to change the base?
Conversation
The problem is that Node is also used on client side, and calling it isession there is also very confusing. Not sure what the correct wording should be. maybe connection... or simply session. but that is a very invasive change that will break things for many people so I am not sure we can merge it.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Friday, November 23, 2018 6:41 PM, brubbel ***@***.***> wrote:
code readability.
It is highly confusing to understand the code flow for the Node.server attribute, as the server is actually an "InternalSession (server)" instance. Replaced all ocurrences of node.server by node.isession.
There is a fallback property which redirects the server attribute to node.isession, with a one-shot deprecation warning.
---------------------------------------------------------------
You can view, comment on, or merge this pull request online at:
#754
Commit Summary
- code readability: server->isession for all InternalSession server references
- show deprecation message for node.server calls.
File Changes
- M [opcua/common/copy_node.py](https://github.com/FreeOpcUa/python-opcua/pull/754/files#diff-0) (12)
- M [opcua/common/instantiate.py](https://github.com/FreeOpcUa/python-opcua/pull/754/files#diff-1) (18)
- M [opcua/common/manage_nodes.py](https://github.com/FreeOpcUa/python-opcua/pull/754/files#diff-2) (30)
- M [opcua/common/methods.py](https://github.com/FreeOpcUa/python-opcua/pull/754/files#diff-3) (6)
- M [opcua/common/node.py](https://github.com/FreeOpcUa/python-opcua/pull/754/files#diff-4) (49)
- M [opcua/common/shortcuts.py](https://github.com/FreeOpcUa/python-opcua/pull/754/files#diff-5) (40)
- M [opcua/common/subscription.py](https://github.com/FreeOpcUa/python-opcua/pull/754/files#diff-6) (26)
- M [opcua/common/type_dictionary_buider.py](https://github.com/FreeOpcUa/python-opcua/pull/754/files#diff-7) (2)
- M [opcua/server/standard_address_space/standard_address_space.py](https://github.com/FreeOpcUa/python-opcua/pull/754/files#diff-8) (18)
- M [opcua/tools.py](https://github.com/FreeOpcUa/python-opcua/pull/754/files#diff-9) (6)
- M [tests/tests_unit.py](https://github.com/FreeOpcUa/python-opcua/pull/754/files#diff-10) (1)
Patch Links:
- https://github.com/FreeOpcUa/python-opcua/pull/754.patch
- https://github.com/FreeOpcUa/python-opcua/pull/754.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, [view it on GitHub](#754), or [mute the thread](https://github.com/notifications/unsubscribe-auth/ACcfzgHlm5ZH6EDrU21f-aZt8uwyjsdNks5uyDNGgaJpZM4Yw-2v).
|
Yes, I did not thought about that. You are right about the name isession, maybe it is better to find a common basis for InternalSession and UaClient.
For me, it was a useful insight that a Node instance is related to a session, rather than to a server. e.g. (isession then becomes activeSession of course) python-opcua/opcua/common/node.py Lines 54 to 57 in b8c727e
Also, |
…erences Fixed confusion between (Internal)Server <-> InternalSession. A lot of methods require an 'InternalSession server' instance where the latter is referenced to as 'server', which makes it quite difficult to understand the code flow.
b8c727e
to
7e53d20
Compare
Settled for session_server, because it was already used here: python-opcua/opcua/common/type_dictionary_buider.py Lines 121 to 130 in 9357c99
Retained a property 'server' linking session_server for backwards compatibility. |
code readability.
It is highly confusing to understand the code flow for the Node.server attribute, as the server is actually an "InternalSession (server)" instance. Replaced all occurrences of node.server by node.isession.
There is a fallback property which redirects the server attribute to node.isession, with a one-shot deprecation warning.