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
52f1453b
Commit
52f1453b
authored
Sep 01, 2019
by
cbergmiller
Committed by
GitHub
Sep 01, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #65 from FreeOpcUa/fix_60_aiosqlite
Fix 60 aiosqlite
parents
4748b6bb
f34d9155
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
73 deletions
+67
-73
.travis.yml
.travis.yml
+1
-1
asyncua/server/history.py
asyncua/server/history.py
+10
-10
asyncua/server/history_sql.py
asyncua/server/history_sql.py
+52
-54
asyncua/ua/uatypes.py
asyncua/ua/uatypes.py
+1
-1
setup.py
setup.py
+1
-1
tests/conftest.py
tests/conftest.py
+2
-6
No files found.
.travis.yml
View file @
52f1453b
...
...
@@ -7,7 +7,7 @@ install:
-
pip install pytz
-
pip install lxml
-
pip install aiofiles
-
pip install a
syncio-contextmanager
-
pip install a
iosqlite
-
pip install pytest --upgrade
-
pip install pytest-asyncio
-
pip install cryptography
...
...
asyncua/server/history.py
View file @
52f1453b
...
...
@@ -13,11 +13,11 @@ class UaNodeAlreadyHistorizedError(ua.UaError):
class
HistoryStorageInterface
:
"""
Interface of a history backend.
Must be implemented by backends
"""
async
def
init
(
self
):
"""
Async. initialization.
...
...
@@ -185,7 +185,7 @@ class HistoryDict(HistoryStorageInterface):
class
SubHandler
:
def
__init__
(
self
,
storage
,
loop
):
self
.
storage
=
storage
self
.
loop
=
loop
self
.
loop
=
loop
def
datachange_notification
(
self
,
node
,
val
,
data
):
self
.
loop
.
create_task
(
...
...
@@ -274,7 +274,7 @@ class HistoryManager:
"""
if
node
in
self
.
_handlers
:
await
self
.
_sub
.
unsubscribe
(
self
.
_handlers
[
node
])
del
(
self
.
_handlers
[
node
])
del
(
self
.
_handlers
[
node
])
else
:
self
.
logger
.
error
(
"History Manager isn't subscribed to %s"
,
node
)
...
...
@@ -329,9 +329,9 @@ class HistoryManager:
starttime
=
ua
.
ua_binary
.
Primitives
.
DateTime
.
unpack
(
Buffer
(
rv
.
ContinuationPoint
))
dv
,
cont
=
await
self
.
storage
.
read_node_history
(
rv
.
NodeId
,
starttime
,
details
.
EndTime
,
details
.
NumValuesPerNode
)
starttime
,
details
.
EndTime
,
details
.
NumValuesPerNode
)
if
cont
:
cont
=
ua
.
ua_binary
.
Primitives
.
DateTime
.
pack
(
cont
)
# rv.IndexRange
...
...
@@ -348,10 +348,10 @@ class HistoryManager:
starttime
=
ua
.
ua_binary
.
Primitives
.
DateTime
.
unpack
(
Buffer
(
rv
.
ContinuationPoint
))
evts
,
cont
=
await
self
.
storage
.
read_event_history
(
rv
.
NodeId
,
starttime
,
details
.
EndTime
,
details
.
NumValuesPerNode
,
details
.
Filter
)
starttime
,
details
.
EndTime
,
details
.
NumValuesPerNode
,
details
.
Filter
)
results
=
[]
for
ev
in
evts
:
field_list
=
ua
.
HistoryEventFieldList
()
...
...
asyncua/server/history_sql.py
View file @
52f1453b
This diff is collapsed.
Click to expand it.
asyncua/ua/uatypes.py
View file @
52f1453b
...
...
@@ -36,7 +36,7 @@ class UTC(tzinfo):
return
timedelta
(
0
)
def
datetime_to_win_epoch
(
dt
):
def
datetime_to_win_epoch
(
dt
:
datetime
):
"""method copied from David Buxton <david@gasmark6.com> sample code"""
if
(
dt
.
tzinfo
is
None
)
or
(
dt
.
tzinfo
.
utcoffset
(
dt
)
is
None
):
dt
=
dt
.
replace
(
tzinfo
=
UTC
())
...
...
setup.py
View file @
52f1453b
...
...
@@ -10,7 +10,7 @@ setup(
packages
=
find_packages
(),
provides
=
[
"asyncua"
],
license
=
"GNU Lesser General Public License v3 or later"
,
install_requires
=
[
"aiofiles"
,
"python-dateutil"
,
"pytz"
,
"lxml"
,
'cryptography'
],
install_requires
=
[
"aiofiles"
,
"
aiosqlite"
,
"
python-dateutil"
,
"pytz"
,
"lxml"
,
'cryptography'
],
classifiers
=
[
"Programming Language :: Python :: 3.6"
,
"Programming Language :: Python :: 3.7"
,
...
...
tests/conftest.py
View file @
52f1453b
...
...
@@ -19,13 +19,9 @@ def pytest_generate_tests(metafunc):
if
'opc'
in
metafunc
.
fixturenames
:
metafunc
.
parametrize
(
'opc'
,
[
'client'
,
'server'
],
indirect
=
True
)
elif
'history'
in
metafunc
.
fixturenames
:
#metafunc.parametrize('history', ['dict', 'sqlite'], indirect=True)
#FIXME: disable sqlite backend, it breaks
metafunc
.
parametrize
(
'history'
,
[
'dict'
],
indirect
=
True
)
metafunc
.
parametrize
(
'history'
,
[
'dict'
,
'sqlite'
],
indirect
=
True
)
elif
'history_server'
in
metafunc
.
fixturenames
:
#FIXME: disable sqlite backend, it breaks
#metafunc.parametrize('history_server', ['dict', 'sqlite'], indirect=True)
metafunc
.
parametrize
(
'history_server'
,
[
'dict'
],
indirect
=
True
)
metafunc
.
parametrize
(
'history_server'
,
[
'dict'
,
'sqlite'
],
indirect
=
True
)
@
pytest
.
yield_fixture
(
scope
=
'module'
)
...
...
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