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
c3249887
Commit
c3249887
authored
Sep 24, 2022
by
Alexander Schrode
Committed by
oroulet
Sep 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add cmd lines for branch and tag
parent
366b9f36
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
13 deletions
+32
-13
.gitignore
.gitignore
+1
-0
schemas/update_ua_nodeset.py
schemas/update_ua_nodeset.py
+31
-13
No files found.
.gitignore
View file @
c3249887
...
...
@@ -23,3 +23,4 @@ examples/history.db
/venv/
.eggs*
.coverage
schemas/UA-Nodese*
schemas/update_ua_nodeset.py
View file @
c3249887
from
subprocess
import
check_call
,
CalledProcessError
,
TimeoutExpired
from
runpy
import
run_module
from
pathlib
import
Path
from
typing
import
Optional
import
argparse
import
logging
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -19,7 +20,7 @@ def rm_tree(path: Path):
path
.
rmdir
()
def
get_new_nodeset
(
timeout
=
120
):
def
get_new_nodeset
(
timeout
:
float
=
120
,
tag
:
Optional
[
str
]
=
None
,
branch
:
Optional
[
str
]
=
None
):
cwd
=
Path
(
"."
)
target_v1
=
cwd
/
"UA-Nodeset"
backup_v1
=
target_v1
.
parent
/
(
target_v1
.
name
+
"_backup"
)
...
...
@@ -30,8 +31,19 @@ def get_new_nodeset(timeout=120):
elif
target_v2
.
is_dir
():
target_v2
.
rename
(
str
(
backup_v2
))
try
:
check_call
([
"git"
,
"clone"
,
"--depth=1"
,
"https://github.com/OPCFoundation/UA-Nodeset.git"
,
"UA-Nodeset-master"
],
timeout
=
timeout
)
args
=
[
"git"
,
"clone"
,
"--depth=1"
,
"https://github.com/OPCFoundation/UA-Nodeset.git"
,
"UA-Nodeset-master"
]
if
tag
is
not
None
:
args
.
append
(
f"tags/
{
tag
}
"
)
if
branch
is
not
None
:
args
.
append
(
branch
)
print
(
args
)
check_call
(
args
,
timeout
=
timeout
)
except
CalledProcessError
:
if
backup_v1
.
is_dir
():
backup_v1
.
rename
(
str
(
target_v1
))
...
...
@@ -53,18 +65,24 @@ def get_new_nodeset(timeout=120):
def
generate_standard_nodesets
():
run_module
(
"generate_address_space"
)
run_module
(
"generate_event_objects"
)
run_module
(
"generate_ids"
)
run_module
(
"generate_protocol_python"
)
run_module
(
"generate_model_event"
)
run_module
(
"generate_event_objects"
)
run_module
(
"generate_statuscode"
)
run_module
(
"generate_uaerrors"
)
run_module
(
"generate_address_space"
,
run_name
=
"__main__"
)
run_module
(
"generate_event_objects"
,
run_name
=
"__main__"
)
run_module
(
"generate_ids"
,
run_name
=
"__main__"
)
run_module
(
"generate_protocol_python"
,
run_name
=
"__main__"
)
run_module
(
"generate_model_event"
,
run_name
=
"__main__"
)
run_module
(
"generate_event_objects"
,
run_name
=
"__main__"
)
run_module
(
"generate_statuscode"
,
run_name
=
"__main__"
)
run_module
(
"generate_uaerrors"
,
run_name
=
"__main__"
)
if
__name__
==
"__main__"
:
parser
=
argparse
.
ArgumentParser
(
description
=
"Update the ua nodeset from https://github.com/OPCFoundation/UA-Nodeset"
)
parser
.
add_argument
(
"-b"
,
"--branch"
,
help
=
"which git branch is used default UA-Nodeset-master"
)
parser
.
add_argument
(
"-t"
,
"--tag"
,
help
=
"git tag is used default: no tag is used"
)
args
=
parser
.
parse_args
()
logger
.
debug
(
"Try creating new Nodeset from github source"
)
get_new_nodeset
()
get_new_nodeset
(
branch
=
args
.
branch
,
tag
=
args
.
tag
)
generate_standard_nodesets
()
logger
.
debug
(
"UA Nodeset created successfully"
)
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