nxsconfigserver 2.19.0__py3-none-any.whl → 2.20.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nxsconfigserver/Merger.py +10 -5
- nxsconfigserver/NXSConfigServer.py +31 -0
- nxsconfigserver/Release.py +1 -1
- nxsconfigserver/XMLConfigurator.py +12 -4
- {nxsconfigserver-2.19.0.dist-info → nxsconfigserver-2.20.0.dist-info}/METADATA +6 -5
- nxsconfigserver-2.20.0.dist-info/RECORD +14 -0
- nxsconfigserver-2.19.0.dist-info/RECORD +0 -14
- {nxsconfigserver-2.19.0.data → nxsconfigserver-2.20.0.data}/scripts/NXSConfigServer +0 -0
- {nxsconfigserver-2.19.0.dist-info → nxsconfigserver-2.20.0.dist-info}/WHEEL +0 -0
- {nxsconfigserver-2.19.0.dist-info → nxsconfigserver-2.20.0.dist-info}/top_level.txt +0 -0
nxsconfigserver/Merger.py
CHANGED
|
@@ -77,6 +77,8 @@ class Merger(object):
|
|
|
77
77
|
|
|
78
78
|
#: (:obj:`xml.etree.ElementTree.Element`) DOM root node
|
|
79
79
|
self.__root = None
|
|
80
|
+
#: (:obj:`bool`) do not merge node on false
|
|
81
|
+
self.skip = False
|
|
80
82
|
#: (:obj:`list` <:obj:`str`> ) tags which cannot have the same siblings
|
|
81
83
|
self.singles = ['strategy', 'dimensions', 'definition',
|
|
82
84
|
'record', 'device', 'query', 'database',
|
|
@@ -223,11 +225,14 @@ class Merger(object):
|
|
|
223
225
|
text1 = unicode(self.__getText(elem1)).strip()
|
|
224
226
|
text2 = unicode(self.__getText(elem2)).strip()
|
|
225
227
|
if text1 != text2 and text1 and text2:
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
if not self.skip:
|
|
229
|
+
raise IncompatibleNodeError(
|
|
230
|
+
"Incompatible \n%s element value\n%s \n%s "
|
|
231
|
+
% (str(self.__getAncestors(elem1, ancestors)),
|
|
232
|
+
text1, text2),
|
|
233
|
+
[elem1, elem2])
|
|
234
|
+
else:
|
|
235
|
+
status = False
|
|
231
236
|
return status
|
|
232
237
|
|
|
233
238
|
def __checkAttributes(self, elem1, elem2):
|
|
@@ -135,6 +135,26 @@ class NXSConfigServer(tango.LatestDeviceImpl):
|
|
|
135
135
|
return False
|
|
136
136
|
return True
|
|
137
137
|
|
|
138
|
+
def read_MergedXML(self, attr):
|
|
139
|
+
""" Read MergedXML attribute
|
|
140
|
+
|
|
141
|
+
:param attr: xml string attribute
|
|
142
|
+
:type attr: :class:`tango.Attribute`
|
|
143
|
+
"""
|
|
144
|
+
self.debug_stream("In read_MergedXML()")
|
|
145
|
+
attr.set_value(self.xmlc.mergedxml)
|
|
146
|
+
|
|
147
|
+
def is_MergedXML_allowed(self, _):
|
|
148
|
+
""" MergedXML attribute State Machine
|
|
149
|
+
|
|
150
|
+
:returns: True if the operation allowed
|
|
151
|
+
:rtype: :obj:`bool`
|
|
152
|
+
"""
|
|
153
|
+
if self.get_state() in [tango.DevState.ON,
|
|
154
|
+
tango.DevState.RUNNING]:
|
|
155
|
+
return False
|
|
156
|
+
return True
|
|
157
|
+
|
|
138
158
|
def read_Selection(self, attr):
|
|
139
159
|
""" Read Selection attribute
|
|
140
160
|
|
|
@@ -765,6 +785,7 @@ class NXSConfigServer(tango.LatestDeviceImpl):
|
|
|
765
785
|
|
|
766
786
|
:brief: Creates the NDTS configuration script from the
|
|
767
787
|
given components. The result is strored in XMLString
|
|
788
|
+
and MergedXML
|
|
768
789
|
|
|
769
790
|
:param argin: DevVarStringArray list of component names
|
|
770
791
|
:type argin: :obj:`list` <:obj:`str`>
|
|
@@ -1316,6 +1337,16 @@ class NXSConfigServerClass(tango.DeviceClass):
|
|
|
1316
1337
|
"it contains the resulting XML configuration.",
|
|
1317
1338
|
'Display level': tango.DispLevel.EXPERT,
|
|
1318
1339
|
}],
|
|
1340
|
+
'MergedXML':
|
|
1341
|
+
[[tango.DevString,
|
|
1342
|
+
tango.SCALAR,
|
|
1343
|
+
tango.READ],
|
|
1344
|
+
{
|
|
1345
|
+
'label': "XML for merged components",
|
|
1346
|
+
'description':
|
|
1347
|
+
"XML for merged components without applied variables ",
|
|
1348
|
+
'Display level': tango.DispLevel.EXPERT,
|
|
1349
|
+
}],
|
|
1319
1350
|
'Selection':
|
|
1320
1351
|
[[tango.DevString,
|
|
1321
1352
|
tango.SCALAR,
|
nxsconfigserver/Release.py
CHANGED
|
@@ -86,6 +86,8 @@ class XMLConfigurator(object):
|
|
|
86
86
|
self._streams = StreamSet(weakref.ref(server) if server else None)
|
|
87
87
|
#: (:obj:`str`) XML config string
|
|
88
88
|
self.xmlstring = ""
|
|
89
|
+
#: (:obj:`str`) Merged coponents in XML string without variables
|
|
90
|
+
self.mergedxml = ""
|
|
89
91
|
#: (:obj:`str`) component selection
|
|
90
92
|
self.selection = "{}"
|
|
91
93
|
#: (:obj:`str`) JSON string with arguments to connect to database
|
|
@@ -976,13 +978,18 @@ class XMLConfigurator(object):
|
|
|
976
978
|
allnames = self.dependentComponents(
|
|
977
979
|
list(set(self.__mydb.mandatory() + names)))
|
|
978
980
|
comps = self.__mydb.components(list(set(allnames)))
|
|
981
|
+
xml = self.__merge(comps, skip=withVariables)
|
|
979
982
|
if withVariables:
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
+
self.mergedxml = xml or ""
|
|
984
|
+
if xml is not None:
|
|
985
|
+
comps = [xml]
|
|
986
|
+
cpvars = self.__variableComponentValues(comps)
|
|
987
|
+
comps = [self.__attachVariables(cp, cpvars)
|
|
988
|
+
for cp in comps]
|
|
989
|
+
xml = self.__merge(comps)
|
|
983
990
|
return xml if xml is not None else ""
|
|
984
991
|
|
|
985
|
-
def __merge(self, xmls):
|
|
992
|
+
def __merge(self, xmls, skip=False):
|
|
986
993
|
""" merges the give component xmls
|
|
987
994
|
|
|
988
995
|
:param xmls: list of component xmls
|
|
@@ -996,6 +1003,7 @@ class XMLConfigurator(object):
|
|
|
996
1003
|
mgr.extralinkdatasources = json.loads(self.extralinkdatasources)
|
|
997
1004
|
mgr.canfaildatasources = json.loads(self.canfaildatasources)
|
|
998
1005
|
mgr.extralinkpath = self.__splitExtraPath(self.extraLinkPath)
|
|
1006
|
+
mgr.skip = skip
|
|
999
1007
|
mgr.collect(xmls)
|
|
1000
1008
|
mgr.merge()
|
|
1001
1009
|
return mgr.toString()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: nxsconfigserver
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.20.0
|
|
4
4
|
Summary: Configuration Server for Nexus Data Writer
|
|
5
5
|
Home-page: http://github.com/jkotan/nexdatas/nxsconfigserver
|
|
6
6
|
Author: Jan Kotanski, Eugen Wintersberger , Halil Pasic
|
|
@@ -99,21 +99,22 @@ with proper privileges.
|
|
|
99
99
|
Debian packages
|
|
100
100
|
^^^^^^^^^^^^^^^
|
|
101
101
|
|
|
102
|
-
Debian Bookworm, Bullseye
|
|
102
|
+
Debian Trixie, Bookworm, Bullseye and as well as Ubuntu Questing, Noble, Jammy packages can be found in the HDRI repository.
|
|
103
103
|
|
|
104
104
|
To install the debian packages, add the PGP repository key
|
|
105
105
|
|
|
106
106
|
.. code-block:: console
|
|
107
107
|
|
|
108
108
|
$ sudo su
|
|
109
|
-
$
|
|
109
|
+
$ curl -s http://repos.pni-hdri.de/debian_repo.pub.gpg | gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/debian-hdri-repo.gpg --import
|
|
110
|
+
$ chmod 644 /etc/apt/trusted.gpg.d/debian-hdri-repo.gpg
|
|
110
111
|
|
|
111
|
-
and then download the corresponding source list, e.g. for
|
|
112
|
+
and then download the corresponding source list, e.g. for trixie
|
|
112
113
|
|
|
113
114
|
.. code-block:: console
|
|
114
115
|
|
|
115
116
|
$ cd /etc/apt/sources.list.d
|
|
116
|
-
$ wget http://repos.pni-hdri.de/
|
|
117
|
+
$ wget http://repos.pni-hdri.de/trixie-pni-hdri.sources
|
|
117
118
|
|
|
118
119
|
Finally, for python2 packages
|
|
119
120
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
nxsconfigserver/ComponentParser.py,sha256=oUEy3_0Q77992pAxR3k8CxzF5UP4hwc2beHYh9v-mJU,7745
|
|
2
|
+
nxsconfigserver/Errors.py,sha256=zFZlQNbZV6UlbGGBV149j1DQbPXAkTmYVgaR1QRIXP8,1956
|
|
3
|
+
nxsconfigserver/MYSQLDataBase.py,sha256=54bFG4KFLMkVYMme3bcybve24qgsxKTvCo7vP6RDjTI,22755
|
|
4
|
+
nxsconfigserver/Merger.py,sha256=U8MHssm3j_LSXnaQWDrcsNL3WTCjGhndZk5ghX0lvZw,25734
|
|
5
|
+
nxsconfigserver/NXSConfigServer.py,sha256=5zOFJXPfx9qu_pWCcvsCWluHsDfMOKRuAP5TUpuBtyI,48059
|
|
6
|
+
nxsconfigserver/Release.py,sha256=ppIx2NmQN559RH_J9_oB6D0XxZ1haPI1F-OE7-JpN1c,895
|
|
7
|
+
nxsconfigserver/StreamSet.py,sha256=sSvXJxoDufmt9_Xu5rFaQsp_4x9gww_zMv0NTiiyLlg,5799
|
|
8
|
+
nxsconfigserver/XMLConfigurator.py,sha256=bWJuJHvHsXNKZuFAcXi_Er5O_ZhsR24FFOzoFubp3eg,37573
|
|
9
|
+
nxsconfigserver/__init__.py,sha256=dAvNwdxRsIARsH--JgJBAxzyaX3KPzZNStQ6B7SLbjI,1718
|
|
10
|
+
nxsconfigserver-2.20.0.data/scripts/NXSConfigServer,sha256=VEAkby0R6UyckF-OofkVDPx3Mkn6rjPrl2xMbbBXqwo,986
|
|
11
|
+
nxsconfigserver-2.20.0.dist-info/METADATA,sha256=6hna9733z74TKnHve2Txd6uXsqcdS-_9ficmQumIT5c,14580
|
|
12
|
+
nxsconfigserver-2.20.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
13
|
+
nxsconfigserver-2.20.0.dist-info/top_level.txt,sha256=TFz-xXdq3yV2iwY44R0uY1F-zqwYDnOmcJlN9kdo1S8,16
|
|
14
|
+
nxsconfigserver-2.20.0.dist-info/RECORD,,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
nxsconfigserver/ComponentParser.py,sha256=oUEy3_0Q77992pAxR3k8CxzF5UP4hwc2beHYh9v-mJU,7745
|
|
2
|
-
nxsconfigserver/Errors.py,sha256=zFZlQNbZV6UlbGGBV149j1DQbPXAkTmYVgaR1QRIXP8,1956
|
|
3
|
-
nxsconfigserver/MYSQLDataBase.py,sha256=54bFG4KFLMkVYMme3bcybve24qgsxKTvCo7vP6RDjTI,22755
|
|
4
|
-
nxsconfigserver/Merger.py,sha256=r7SS4JRdFWgGgRuI1sDl-H-zsYVcUjIbF3mSlTG_CHk,25545
|
|
5
|
-
nxsconfigserver/NXSConfigServer.py,sha256=kxHx0vugHEin9j5c0iizvIbbi0Z5S6E8MoMDY7csN6k,47113
|
|
6
|
-
nxsconfigserver/Release.py,sha256=2KgnY_sm1tpwteaOQR6sXxvJM1opn5jyjKBMrQO7erQ,895
|
|
7
|
-
nxsconfigserver/StreamSet.py,sha256=sSvXJxoDufmt9_Xu5rFaQsp_4x9gww_zMv0NTiiyLlg,5799
|
|
8
|
-
nxsconfigserver/XMLConfigurator.py,sha256=xdifnewlTNIQ3PgHTBvBh83xJUf2qCnqC3Rkq24urzk,37220
|
|
9
|
-
nxsconfigserver/__init__.py,sha256=dAvNwdxRsIARsH--JgJBAxzyaX3KPzZNStQ6B7SLbjI,1718
|
|
10
|
-
nxsconfigserver-2.19.0.data/scripts/NXSConfigServer,sha256=VEAkby0R6UyckF-OofkVDPx3Mkn6rjPrl2xMbbBXqwo,986
|
|
11
|
-
nxsconfigserver-2.19.0.dist-info/METADATA,sha256=9C9T_WGxRBExhkI-YFFnZkhvJceog6scmyOJYRu57DA,14440
|
|
12
|
-
nxsconfigserver-2.19.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
13
|
-
nxsconfigserver-2.19.0.dist-info/top_level.txt,sha256=TFz-xXdq3yV2iwY44R0uY1F-zqwYDnOmcJlN9kdo1S8,16
|
|
14
|
-
nxsconfigserver-2.19.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|