Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
cf2bd668
Commit
cf2bd668
authored
Feb 13, 2024
by
Jan-Niklas Burfeind
Committed by
oroulet
Feb 16, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Add typehints for the optional shelf file
to clarify its intended usage.
parent
f41b67e1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
5 deletions
+6
-5
asyncua/server/address_space.py
asyncua/server/address_space.py
+2
-1
asyncua/server/internal_server.py
asyncua/server/internal_server.py
+2
-2
asyncua/server/server.py
asyncua/server/server.py
+1
-1
asyncua/sync.py
asyncua/sync.py
+1
-1
No files found.
asyncua/server/address_space.py
View file @
cf2bd668
...
@@ -9,6 +9,7 @@ import shelve
...
@@ -9,6 +9,7 @@ import shelve
from
concurrent.futures
import
ThreadPoolExecutor
from
concurrent.futures
import
ThreadPoolExecutor
from
datetime
import
datetime
from
datetime
import
datetime
from
functools
import
partial
from
functools
import
partial
from
pathlib
import
Path
from
typing
import
TYPE_CHECKING
,
Optional
from
typing
import
TYPE_CHECKING
,
Optional
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
...
@@ -697,7 +698,7 @@ class AddressSpace:
...
@@ -697,7 +698,7 @@ class AddressSpace:
with
open
(
path
,
'rb'
)
as
f
:
with
open
(
path
,
'rb'
)
as
f
:
self
.
_nodes
=
pickle
.
load
(
f
)
self
.
_nodes
=
pickle
.
load
(
f
)
def
make_aspace_shelf
(
self
,
path
):
def
make_aspace_shelf
(
self
,
path
:
Path
):
"""
"""
Make a shelf for containing the nodes from the standard address space; this is typically only done on first
Make a shelf for containing the nodes from the standard address space; this is typically only done on first
start of the server. Subsequent server starts will load the shelf, nodes are then moved to a cache
start of the server. Subsequent server starts will load the shelf, nodes are then moved to a cache
...
...
asyncua/server/internal_server.py
View file @
cf2bd668
...
@@ -80,7 +80,7 @@ class InternalServer:
...
@@ -80,7 +80,7 @@ class InternalServer:
self
.
match_discovery_source_ip
:
bool
=
True
self
.
match_discovery_source_ip
:
bool
=
True
self
.
supported_tokens
=
[]
self
.
supported_tokens
=
[]
async
def
init
(
self
,
shelffile
=
None
):
async
def
init
(
self
,
shelffile
:
Optional
[
Path
]
=
None
):
await
self
.
load_standard_address_space
(
shelffile
)
await
self
.
load_standard_address_space
(
shelffile
)
await
self
.
_address_space_fixes
()
await
self
.
_address_space_fixes
()
await
self
.
setup_nodes
()
await
self
.
setup_nodes
()
...
@@ -135,7 +135,7 @@ class InternalServer:
...
@@ -135,7 +135,7 @@ class InternalServer:
result
=
await
self
.
isession
.
write
(
params
)
result
=
await
self
.
isession
.
write
(
params
)
result
[
0
].
check
()
result
[
0
].
check
()
async
def
load_standard_address_space
(
self
,
shelf_file
=
None
):
async
def
load_standard_address_space
(
self
,
shelf_file
:
Optional
[
Path
]
=
None
):
if
shelf_file
:
if
shelf_file
:
is_file
=
await
asyncio
.
get_running_loop
().
run_in_executor
(
is_file
=
await
asyncio
.
get_running_loop
().
run_in_executor
(
None
,
Path
.
is_file
,
shelf_file
None
,
Path
.
is_file
,
shelf_file
...
...
asyncua/server/server.py
View file @
cf2bd668
...
@@ -121,7 +121,7 @@ class Server:
...
@@ -121,7 +121,7 @@ class Server:
max_message_size
=
max_msg_sz
max_message_size
=
max_msg_sz
)
)
async
def
init
(
self
,
shelf_file
=
None
):
async
def
init
(
self
,
shelf_file
:
Optional
[
Path
]
=
None
):
await
self
.
iserver
.
init
(
shelf_file
)
await
self
.
iserver
.
init
(
shelf_file
)
# setup some expected values
# setup some expected values
await
self
.
set_application_uri
(
self
.
_application_uri
)
await
self
.
set_application_uri
(
self
.
_application_uri
)
...
...
asyncua/sync.py
View file @
cf2bd668
...
@@ -537,7 +537,7 @@ class Server:
...
@@ -537,7 +537,7 @@ class Server:
waits for an async call to return. defualt is 120s and hopefully should fit most applications
waits for an async call to return. defualt is 120s and hopefully should fit most applications
"""
"""
def
__init__
(
self
,
shelf_file
=
None
,
tloop
=
None
,
sync_wrapper_timeout
:
Optional
[
float
]
=
120
,):
def
__init__
(
self
,
shelf_file
:
Optional
[
Path
]
=
None
,
tloop
=
None
,
sync_wrapper_timeout
:
Optional
[
float
]
=
120
,):
self
.
tloop
=
tloop
self
.
tloop
=
tloop
self
.
close_tloop
=
False
self
.
close_tloop
=
False
if
not
self
.
tloop
:
if
not
self
.
tloop
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment