nxsconfigserver 2.16.0__py3-none-any.whl → 2.18.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 +101 -29
- nxsconfigserver/NXSConfigServer.py +83 -0
- nxsconfigserver/Release.py +1 -1
- nxsconfigserver/XMLConfigurator.py +77 -0
- {nxsconfigserver-2.16.0.dist-info → nxsconfigserver-2.18.0.dist-info}/METADATA +5 -2
- nxsconfigserver-2.18.0.dist-info/RECORD +14 -0
- nxsconfigserver-2.16.0.dist-info/RECORD +0 -14
- {nxsconfigserver-2.16.0.data → nxsconfigserver-2.18.0.data}/scripts/NXSConfigServer +0 -0
- {nxsconfigserver-2.16.0.dist-info → nxsconfigserver-2.18.0.dist-info}/WHEEL +0 -0
- {nxsconfigserver-2.16.0.dist-info → nxsconfigserver-2.18.0.dist-info}/top_level.txt +0 -0
nxsconfigserver/Merger.py
CHANGED
|
@@ -131,9 +131,18 @@ class Merger(object):
|
|
|
131
131
|
#: (:obj:`list` <:obj:`str`> ) aliased to add links
|
|
132
132
|
self.linkdatasources = []
|
|
133
133
|
|
|
134
|
+
#: (:obj:`list` <:obj:`str`> ) aliased to add extralinks
|
|
135
|
+
self.extralinkdatasources = []
|
|
136
|
+
|
|
134
137
|
#: (:obj:`list` <:obj:`str`> ) aliased to switch to CanFial mode
|
|
135
138
|
self.canfaildatasources = []
|
|
136
139
|
|
|
140
|
+
#: (:obj:`list` <:obj:`str`> ) extra link path
|
|
141
|
+
self.extralinkpath = []
|
|
142
|
+
|
|
143
|
+
#: (:obj:`list` <:obj:`str`> ) data link path
|
|
144
|
+
self.linkpath = [("data", "NXdata")]
|
|
145
|
+
|
|
137
146
|
#: (:obj:`str`) datasource label
|
|
138
147
|
self.__dsvars = "$datasources."
|
|
139
148
|
|
|
@@ -155,6 +164,8 @@ class Merger(object):
|
|
|
155
164
|
|
|
156
165
|
:param node: dom node
|
|
157
166
|
:type node: :obj:`xml.etree.ElementTree.Element`
|
|
167
|
+
:param ancestors: list with NeXus path nodes (tag, name, type)
|
|
168
|
+
:type ancestors: :obj:`list`< (:obj:`str`,:obj:`str`,:obj:`str`) >
|
|
158
169
|
:returns: xml path
|
|
159
170
|
:rtype: :obj:`str`
|
|
160
171
|
"""
|
|
@@ -178,6 +189,8 @@ class Merger(object):
|
|
|
178
189
|
:type elem1: :obj:`xml.etree.ElementTree.Element`
|
|
179
190
|
:param elem2: second element
|
|
180
191
|
:type elem2: :obj:`xml.etree.ElementTree.Element`
|
|
192
|
+
:param ancestors: list with NeXus path nodes (tag, name, type)
|
|
193
|
+
:type ancestors: :obj:`list`< (:obj:`str`,:obj:`str`,:obj:`str`) >
|
|
181
194
|
:returns: bool varaible if two elements are mergeable
|
|
182
195
|
:rtype: :obj:`bool`
|
|
183
196
|
"""
|
|
@@ -244,6 +257,8 @@ class Merger(object):
|
|
|
244
257
|
:type elem1: :obj:`xml.etree.ElementTree.Element`
|
|
245
258
|
:param elem2: second element
|
|
246
259
|
:type elem2: :obj:`xml.etree.ElementTree.Element`
|
|
260
|
+
:param parent: the given parent node
|
|
261
|
+
:type parent: :obj:`xml.etree.ElementTree.Element`
|
|
247
262
|
"""
|
|
248
263
|
attr2 = elem2.attrib
|
|
249
264
|
texts = []
|
|
@@ -283,11 +298,20 @@ class Merger(object):
|
|
|
283
298
|
|
|
284
299
|
parent.remove(elem2)
|
|
285
300
|
|
|
286
|
-
def __mergeChildren(self, node, ancestors, entrynode=None
|
|
301
|
+
def __mergeChildren(self, node, ancestors, entrynode=None,
|
|
302
|
+
datanode=None, linknode=None):
|
|
287
303
|
""" merge the given node
|
|
288
304
|
|
|
289
305
|
:param node: the given node
|
|
290
306
|
:type node: :obj:`xml.etree.ElementTree.Element`
|
|
307
|
+
:param ancestors: list with NeXus path nodes (tag, name, type)
|
|
308
|
+
:type ancestors: :obj:`list`< (:obj:`str`,:obj:`str`,:obj:`str`) >
|
|
309
|
+
:param entrynode: entry node
|
|
310
|
+
:type entrynode: :class:`xml.etree.ElementTree.Element`
|
|
311
|
+
:param datanode: data node
|
|
312
|
+
:type datanode: :class:`xml.etree.ElementTree.Element`
|
|
313
|
+
:param linknode: link node
|
|
314
|
+
:type linknode: :class:`xml.etree.ElementTree.Element`
|
|
291
315
|
"""
|
|
292
316
|
if node is not None and node.tag != "definition":
|
|
293
317
|
newancestors = tuple(
|
|
@@ -328,11 +352,18 @@ class Merger(object):
|
|
|
328
352
|
self.__getAncestors(child, newancestors)),
|
|
329
353
|
[child])
|
|
330
354
|
|
|
331
|
-
self.__mergeChildren(child, newancestors, entrynode
|
|
355
|
+
self.__mergeChildren(child, newancestors, entrynode,
|
|
356
|
+
datanode, linknode)
|
|
332
357
|
if cName in self.switchable and self.switchdatasources:
|
|
333
358
|
self.__switch(child)
|
|
334
359
|
if cName in self.linkable and self.linkdatasources:
|
|
335
|
-
self.__addlink(
|
|
360
|
+
datanode = self.__addlink(
|
|
361
|
+
child, newancestors, entrynode, datanode,
|
|
362
|
+
self.linkdatasources, self.linkpath)
|
|
363
|
+
if cName in self.linkable and self.extralinkdatasources:
|
|
364
|
+
linknode = self.__addlink(
|
|
365
|
+
child, newancestors, entrynode, linknode,
|
|
366
|
+
self.extralinkdatasources, self.extralinkpath)
|
|
336
367
|
if cName in self.switchable and self.canfaildatasources:
|
|
337
368
|
self.__canfail(child)
|
|
338
369
|
|
|
@@ -465,27 +496,38 @@ class Merger(object):
|
|
|
465
496
|
if stnode is not None and dsnode is not None:
|
|
466
497
|
stnode.attrib["canfail"] = "true"
|
|
467
498
|
|
|
468
|
-
def __addlink(self, node, ancestors, entrynode
|
|
499
|
+
def __addlink(self, node, ancestors, entrynode, linknode, linkdatasources,
|
|
500
|
+
linkpath=None):
|
|
469
501
|
""" add link in NXdata group
|
|
470
502
|
|
|
471
503
|
:param node: the given node
|
|
472
504
|
:type node: :obj:`xml.etree.ElementTree.Element`
|
|
505
|
+
:param ancestors: list with NeXus path nodes (tag, name, type)
|
|
506
|
+
:type ancestors: :obj:`list`< (:obj:`str`,:obj:`str`,:obj:`str`) >
|
|
507
|
+
:param entrynode: root node
|
|
508
|
+
:type entrynode: :class:`xml.etree.ElementTree.Element`
|
|
509
|
+
:param linknode: the given link node
|
|
510
|
+
:type linknode: :obj:`xml.etree.ElementTree.Element`
|
|
511
|
+
:param linkpath: list with NeXus path (name, type)
|
|
512
|
+
:type linkpath: :obj:`list` < (:obj:`str`,:obj:`str`) >
|
|
513
|
+
:returns: the current link node
|
|
514
|
+
:rtype: :obj:`xml.etree.ElementTree.Element`
|
|
473
515
|
"""
|
|
474
516
|
if node is not None:
|
|
475
517
|
dsname = None
|
|
476
518
|
dsnode = None
|
|
477
519
|
|
|
478
520
|
dsname, dsnode = self.__getTextDataSource(
|
|
479
|
-
node,
|
|
521
|
+
node, linkdatasources)
|
|
480
522
|
for child in node:
|
|
481
523
|
cName = unicode(child.tag)
|
|
482
524
|
if cName == 'datasource':
|
|
483
525
|
dsname = child.get("name")
|
|
484
|
-
if dsname in
|
|
526
|
+
if dsname in linkdatasources:
|
|
485
527
|
dsnode = child
|
|
486
528
|
else:
|
|
487
529
|
dsname, dsnode = self.__getTextDataSource(
|
|
488
|
-
child,
|
|
530
|
+
child, linkdatasources)
|
|
489
531
|
if dsnode is not None:
|
|
490
532
|
break
|
|
491
533
|
if dsnode is not None:
|
|
@@ -494,46 +536,76 @@ class Merger(object):
|
|
|
494
536
|
for anc in reversed(ancestors):
|
|
495
537
|
path.append((anc[1], anc[2]))
|
|
496
538
|
linkfound = False
|
|
497
|
-
datanode = None
|
|
498
539
|
if entrynode is not None:
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
540
|
+
if linknode is None:
|
|
541
|
+
# found linknode
|
|
542
|
+
parent = entrynode
|
|
543
|
+
for nm, tp in linkpath:
|
|
544
|
+
node = None
|
|
545
|
+
for gchild in parent:
|
|
546
|
+
if gchild.get("name") == nm \
|
|
547
|
+
and gchild.get("type") == tp:
|
|
548
|
+
node = gchild
|
|
506
549
|
break
|
|
550
|
+
if node is None:
|
|
551
|
+
break
|
|
552
|
+
else:
|
|
553
|
+
parent = node
|
|
554
|
+
else:
|
|
555
|
+
linknode = parent
|
|
556
|
+
|
|
557
|
+
if linknode is not None:
|
|
558
|
+
for dchild in linknode:
|
|
559
|
+
if dchild.get("name") == dsname:
|
|
560
|
+
linkfound = True
|
|
561
|
+
break
|
|
507
562
|
if not linkfound:
|
|
508
|
-
self.__createLink(
|
|
563
|
+
linknode = self.__createLink(
|
|
564
|
+
entrynode, linknode, path, linkpath)
|
|
565
|
+
return linknode
|
|
509
566
|
|
|
510
|
-
def __createLink(self,
|
|
567
|
+
def __createLink(self, entrynode, linknode, path, linkpath=None):
|
|
511
568
|
""" create link on given node
|
|
512
569
|
|
|
513
|
-
:param
|
|
514
|
-
:type
|
|
515
|
-
:param
|
|
516
|
-
:type
|
|
570
|
+
:param entrynode: root node
|
|
571
|
+
:type entrynode: :class:`xml.etree.ElementTree.Element`
|
|
572
|
+
:param linknode: the given link node
|
|
573
|
+
:type linknode: :obj:`xml.etree.ElementTree.Element`
|
|
517
574
|
:param path: list with NeXus path (name, type)
|
|
518
|
-
:type
|
|
575
|
+
:type path: :obj:`list` < (:obj:`str`,:obj:`str`) >
|
|
576
|
+
:param linkpath: list with NeXus path (name, type)
|
|
577
|
+
:type linkpath: :obj:`list` < (:obj:`str`,:obj:`str`) >
|
|
578
|
+
:returns: the current link node
|
|
579
|
+
:rtype: :obj:`xml.etree.ElementTree.Element`
|
|
519
580
|
"""
|
|
520
|
-
|
|
521
581
|
if path:
|
|
522
582
|
target, dsname = path[0]
|
|
523
583
|
if target:
|
|
524
|
-
if
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
584
|
+
if linknode is None:
|
|
585
|
+
linknode = entrynode
|
|
586
|
+
if linkpath is None:
|
|
587
|
+
linkpath = [("data", "NXdata")]
|
|
588
|
+
for nm, tp in linkpath:
|
|
589
|
+
for gchild in linknode:
|
|
590
|
+
if gchild.get("name") == nm \
|
|
591
|
+
and gchild.get("type") == tp:
|
|
592
|
+
linknode = gchild
|
|
593
|
+
break
|
|
594
|
+
else:
|
|
595
|
+
node = etree.Element("group")
|
|
596
|
+
linknode.append(node)
|
|
597
|
+
linknode = node
|
|
598
|
+
linknode.attrib["type"] = tp
|
|
599
|
+
linknode.attrib["name"] = nm
|
|
529
600
|
for gname, gtype in path[1:]:
|
|
530
601
|
target = "%s:%s/" % (gname, gtype) + target
|
|
531
602
|
target = "/" + target
|
|
532
603
|
if dsname:
|
|
533
604
|
link = etree.Element("link")
|
|
534
|
-
|
|
605
|
+
linknode.append(link)
|
|
535
606
|
link.attrib["target"] = "%s" % target
|
|
536
607
|
link.attrib["name"] = dsname
|
|
608
|
+
return linknode
|
|
537
609
|
|
|
538
610
|
def collect(self, components):
|
|
539
611
|
""" collects the given components in one DOM tree
|
|
@@ -89,6 +89,7 @@ class NXSConfigServer(tango.LatestDeviceImpl):
|
|
|
89
89
|
self.set_state(tango.DevState.ON)
|
|
90
90
|
self.get_device_properties(self.get_device_class())
|
|
91
91
|
self.xmlc.versionLabel = self.VersionLabel
|
|
92
|
+
self.xmlc.extraLinkPath = self.ExtraLinkPath
|
|
92
93
|
|
|
93
94
|
def always_executed_hook(self):
|
|
94
95
|
""" Always excuted hook method
|
|
@@ -263,6 +264,39 @@ class NXSConfigServer(tango.LatestDeviceImpl):
|
|
|
263
264
|
return False
|
|
264
265
|
return True
|
|
265
266
|
|
|
267
|
+
def read_ExtraLinkDataSources(self, attr):
|
|
268
|
+
""" Read ExtraLinkDataSources attribute
|
|
269
|
+
|
|
270
|
+
:param attr: extra link datasources attribute
|
|
271
|
+
:type attr: :class:`tango.Attribute`
|
|
272
|
+
"""
|
|
273
|
+
self.debug_stream("In read_ExtraLinkDataSources()")
|
|
274
|
+
attr.set_value(self.xmlc.extralinkdatasources or "")
|
|
275
|
+
|
|
276
|
+
def write_ExtraLinkDataSources(self, attr):
|
|
277
|
+
""" Write ExtraLinkDataSources attribute
|
|
278
|
+
|
|
279
|
+
:param attr: extra link datasources attribute
|
|
280
|
+
:type attr: :class:`tango.Attribute`
|
|
281
|
+
"""
|
|
282
|
+
self.debug_stream("In write_ExtraLinkDataSources()")
|
|
283
|
+
if self.is_ExtraLinkDataSources_write_allowed():
|
|
284
|
+
self.xmlc.extralinkdatasources = attr.get_write_value() or ""
|
|
285
|
+
else:
|
|
286
|
+
self.warn_stream("To change the settings please close the server.")
|
|
287
|
+
raise Exception(
|
|
288
|
+
"To change the settings please close the server.")
|
|
289
|
+
|
|
290
|
+
def is_ExtraLinkDataSources_write_allowed(self):
|
|
291
|
+
""" ExtraLinkDataSources attribute Write State Machine
|
|
292
|
+
|
|
293
|
+
:returns: True if the operation allowed
|
|
294
|
+
:rtype: :obj:`bool`
|
|
295
|
+
"""
|
|
296
|
+
if self.get_state() in [tango.DevState.RUNNING]:
|
|
297
|
+
return False
|
|
298
|
+
return True
|
|
299
|
+
|
|
266
300
|
def read_CanFailDataSources(self, attr):
|
|
267
301
|
""" Read CanFailDataSources attribute
|
|
268
302
|
|
|
@@ -488,6 +522,38 @@ class NXSConfigServer(tango.LatestDeviceImpl):
|
|
|
488
522
|
return False
|
|
489
523
|
return True
|
|
490
524
|
|
|
525
|
+
def InstantiatedDataSources(self, argin):
|
|
526
|
+
""" InstantiatedDataSources command
|
|
527
|
+
|
|
528
|
+
:brief: Returns a list of required components
|
|
529
|
+
|
|
530
|
+
:param argin: DevVarStringArray list of component names
|
|
531
|
+
:type argin: :obj:`list` <:obj:`str`>
|
|
532
|
+
:returns: DevVarStringArray list of instantiated components
|
|
533
|
+
:rtype: :obj:`list` <:obj:`str`>
|
|
534
|
+
"""
|
|
535
|
+
self.debug_stream("In InstantiateDataSources()")
|
|
536
|
+
try:
|
|
537
|
+
self.set_state(tango.DevState.RUNNING)
|
|
538
|
+
argout = self.xmlc.instantiatedDataSources(argin)
|
|
539
|
+
self.set_state(tango.DevState.OPEN)
|
|
540
|
+
finally:
|
|
541
|
+
if self.get_state() == tango.DevState.RUNNING:
|
|
542
|
+
self.set_state(tango.DevState.OPEN)
|
|
543
|
+
|
|
544
|
+
return argout
|
|
545
|
+
|
|
546
|
+
def is_InstantiatedDataSources_allowed(self):
|
|
547
|
+
""" DataSources command State Machine
|
|
548
|
+
|
|
549
|
+
:returns: True if the operation allowed
|
|
550
|
+
:rtype: :obj:`bool`
|
|
551
|
+
"""
|
|
552
|
+
if self.get_state() in [tango.DevState.ON,
|
|
553
|
+
tango.DevState.RUNNING]:
|
|
554
|
+
return False
|
|
555
|
+
return True
|
|
556
|
+
|
|
491
557
|
def DataSources(self, argin):
|
|
492
558
|
""" DataSources command
|
|
493
559
|
|
|
@@ -1135,6 +1201,11 @@ class NXSConfigServerClass(tango.DeviceClass):
|
|
|
1135
1201
|
[tango.DevString,
|
|
1136
1202
|
"version label",
|
|
1137
1203
|
["XCS"]],
|
|
1204
|
+
'ExtraLinkPath':
|
|
1205
|
+
[tango.DevString,
|
|
1206
|
+
"extra link NeXus path below NXentry. "
|
|
1207
|
+
"Default: instrument:NXinstrument/collection:NXcollection",
|
|
1208
|
+
["instrument:NXinstrument/collection:NXcollection"]],
|
|
1138
1209
|
}
|
|
1139
1210
|
|
|
1140
1211
|
#: (:obj:`dict` <:obj:`str`, \
|
|
@@ -1156,6 +1227,9 @@ class NXSConfigServerClass(tango.DeviceClass):
|
|
|
1156
1227
|
'InstantiatedComponents':
|
|
1157
1228
|
[[tango.DevVarStringArray, "list of component names"],
|
|
1158
1229
|
[tango.DevVarStringArray, "list of instantiated components"]],
|
|
1230
|
+
'InstantiatedDataSources':
|
|
1231
|
+
[[tango.DevVarStringArray, "list of component names"],
|
|
1232
|
+
[tango.DevVarStringArray, "list of instantiated datasources"]],
|
|
1159
1233
|
'DataSources':
|
|
1160
1234
|
[[tango.DevVarStringArray, "list of DataSource names"],
|
|
1161
1235
|
[tango.DevVarStringArray, "list of required DataSources"]],
|
|
@@ -1299,6 +1373,15 @@ class NXSConfigServerClass(tango.DeviceClass):
|
|
|
1299
1373
|
'description': "JSON list of datasources"
|
|
1300
1374
|
"to which links will be added",
|
|
1301
1375
|
}],
|
|
1376
|
+
'ExtraLinkDataSources':
|
|
1377
|
+
[[tango.DevString,
|
|
1378
|
+
tango.SCALAR,
|
|
1379
|
+
tango.READ_WRITE],
|
|
1380
|
+
{
|
|
1381
|
+
'label': "Datasources to which extra links will be added",
|
|
1382
|
+
'description': "JSON list of datasources"
|
|
1383
|
+
"to which extra links will be added",
|
|
1384
|
+
}],
|
|
1302
1385
|
'CanFailDataSources':
|
|
1303
1386
|
[[tango.DevString,
|
|
1304
1387
|
tango.SCALAR,
|
nxsconfigserver/Release.py
CHANGED
|
@@ -94,6 +94,8 @@ class XMLConfigurator(object):
|
|
|
94
94
|
self.__stepdatasources = "[]"
|
|
95
95
|
#: (:obj:`str`) datasources to which links will be added
|
|
96
96
|
self.__linkdatasources = "[]"
|
|
97
|
+
#: (:obj:`str`) datasources to which extra links will be added
|
|
98
|
+
self.__extralinkdatasources = "[]"
|
|
97
99
|
#: (:obj:`str`) datasources to be switched into CanFail mode
|
|
98
100
|
self.__canfaildatasources = "[]"
|
|
99
101
|
|
|
@@ -125,6 +127,9 @@ class XMLConfigurator(object):
|
|
|
125
127
|
#: (:obj:`str`) version label
|
|
126
128
|
self.versionLabel = "XCS"
|
|
127
129
|
|
|
130
|
+
#: (:obj:`str`) extra link path
|
|
131
|
+
self.extraLinkPath = "instrument:NXinstrument/collection:NXcollection"
|
|
132
|
+
|
|
128
133
|
#: (:class:`tango.LatestDeviceImpl`) Tango server
|
|
129
134
|
self.__server = server
|
|
130
135
|
|
|
@@ -207,6 +212,35 @@ class XMLConfigurator(object):
|
|
|
207
212
|
__setLinkDatSources,
|
|
208
213
|
doc='link datasource list')
|
|
209
214
|
|
|
215
|
+
def __getExtraLinkDatSources(self):
|
|
216
|
+
""" get method for dataSourceGroup attribute
|
|
217
|
+
|
|
218
|
+
:returns: names of EXTRA LINK dataSources
|
|
219
|
+
:rtype: :obj:`str`
|
|
220
|
+
"""
|
|
221
|
+
try:
|
|
222
|
+
lad = json.loads(self.__extralinkdatasources)
|
|
223
|
+
assert isinstance(lad, list)
|
|
224
|
+
return self.__extralinkdatasources
|
|
225
|
+
except Exception:
|
|
226
|
+
return '[]'
|
|
227
|
+
|
|
228
|
+
def __setExtraLinkDatSources(self, names):
|
|
229
|
+
""" set method for dataSourceGroup attribute
|
|
230
|
+
|
|
231
|
+
:param names: of EXTRA LINK dataSources
|
|
232
|
+
:type names: :obj:`str`
|
|
233
|
+
"""
|
|
234
|
+
jnames = self.__stringToListJson(names)
|
|
235
|
+
#: administator data
|
|
236
|
+
self.__extralinkdatasources = jnames
|
|
237
|
+
|
|
238
|
+
#: (:obj:`str`) the json data string
|
|
239
|
+
extralinkdatasources = property(
|
|
240
|
+
__getExtraLinkDatSources,
|
|
241
|
+
__setExtraLinkDatSources,
|
|
242
|
+
doc='extra link datasource list')
|
|
243
|
+
|
|
210
244
|
def __getCanFailDatSources(self):
|
|
211
245
|
""" get method for dataSourceGroup attribute
|
|
212
246
|
|
|
@@ -319,6 +353,20 @@ class XMLConfigurator(object):
|
|
|
319
353
|
comps = [self.__instantiate(cp) for cp in comps]
|
|
320
354
|
return comps
|
|
321
355
|
|
|
356
|
+
def instantiatedDataSources(self, names):
|
|
357
|
+
""" instantiates the required datasources
|
|
358
|
+
|
|
359
|
+
:param names: list of datasource names
|
|
360
|
+
:type names: :obj:`list` <:obj:`str`>
|
|
361
|
+
:returns: list of instantiated datasources
|
|
362
|
+
:rtype: :obj:`list` <:obj:`str`>
|
|
363
|
+
"""
|
|
364
|
+
comps = []
|
|
365
|
+
if self.__mydb:
|
|
366
|
+
comps = self.__mydb.dataSources(names)
|
|
367
|
+
comps = [self.__instantiate(ds) for ds in comps]
|
|
368
|
+
return comps
|
|
369
|
+
|
|
322
370
|
def __instantiate(self, xmlcp):
|
|
323
371
|
""" instantiates the xml component
|
|
324
372
|
|
|
@@ -933,11 +981,40 @@ class XMLConfigurator(object):
|
|
|
933
981
|
mgr = Merger()
|
|
934
982
|
mgr.switchdatasources = json.loads(self.stepdatasources)
|
|
935
983
|
mgr.linkdatasources = json.loads(self.linkdatasources)
|
|
984
|
+
mgr.extralinkdatasources = json.loads(self.extralinkdatasources)
|
|
936
985
|
mgr.canfaildatasources = json.loads(self.canfaildatasources)
|
|
986
|
+
mgr.extralinkpath = self.__splitExtraPath(self.extraLinkPath)
|
|
937
987
|
mgr.collect(xmls)
|
|
938
988
|
mgr.merge()
|
|
939
989
|
return mgr.toString()
|
|
940
990
|
|
|
991
|
+
def __splitExtraPath(self, extrapath):
|
|
992
|
+
""" split extra path to names and types
|
|
993
|
+
|
|
994
|
+
:param extrapath: extra link path
|
|
995
|
+
:type extrapath: :obj:`str`
|
|
996
|
+
:returns: list of name an type of extra link path groups
|
|
997
|
+
:rtype: :obj:`list` <[:obj:`str`, :obj:`str`]>
|
|
998
|
+
"""
|
|
999
|
+
epath = []
|
|
1000
|
+
if extrapath:
|
|
1001
|
+
path = extrapath.split("/")
|
|
1002
|
+
for nd in path:
|
|
1003
|
+
if ":" in nd:
|
|
1004
|
+
snd = nd.split(":")
|
|
1005
|
+
if snd[0] and snd[1]:
|
|
1006
|
+
epath.append([snd[0], snd[1]])
|
|
1007
|
+
elif snd[1] and len(snd[1]) > 2:
|
|
1008
|
+
epath.append([snd[0][2:], snd[1]])
|
|
1009
|
+
else:
|
|
1010
|
+
epath.append([snd[0], "NX" + snd[0]])
|
|
1011
|
+
|
|
1012
|
+
elif nd.startswith("NX") and len(nd) > 2:
|
|
1013
|
+
epath.append([nd[0][2:], nd[1]])
|
|
1014
|
+
else:
|
|
1015
|
+
epath.append([nd[0], "NX" + nd[0]])
|
|
1016
|
+
return epath
|
|
1017
|
+
|
|
941
1018
|
def createConfiguration(self, names):
|
|
942
1019
|
""" creates the final configuration string in the xmlstring attribute
|
|
943
1020
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: nxsconfigserver
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.18.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
|
|
@@ -21,6 +21,9 @@ Classifier: Programming Language :: Python :: 3.7
|
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.8
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.9
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
27
|
Requires-Dist: lxml
|
|
25
28
|
|
|
26
29
|
======================================================
|
|
@@ -96,7 +99,7 @@ with proper privileges.
|
|
|
96
99
|
Debian packages
|
|
97
100
|
^^^^^^^^^^^^^^^
|
|
98
101
|
|
|
99
|
-
Debian Bookworm, Bullseye, Buster and as well as Ubuntu
|
|
102
|
+
Debian Bookworm, Bullseye, Buster and as well as Ubuntu Plucky, Noble, Jammy packages can be found in the HDRI repository.
|
|
100
103
|
|
|
101
104
|
To install the debian packages, add the PGP repository key
|
|
102
105
|
|
|
@@ -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=t6xX2ETUIy1FYIXvmcEstTwKf9oq_jDtvXIDV6c4kV0,25327
|
|
5
|
+
nxsconfigserver/NXSConfigServer.py,sha256=kxHx0vugHEin9j5c0iizvIbbi0Z5S6E8MoMDY7csN6k,47113
|
|
6
|
+
nxsconfigserver/Release.py,sha256=9ewpv_XVl0c_YuOvqi-Ntvm7H_HchEUOXi0bWKva8I8,895
|
|
7
|
+
nxsconfigserver/StreamSet.py,sha256=sSvXJxoDufmt9_Xu5rFaQsp_4x9gww_zMv0NTiiyLlg,5799
|
|
8
|
+
nxsconfigserver/XMLConfigurator.py,sha256=7EzAsnoD5WLzgdEfcq9u7ITNQKZ5Car9I2jxj2DI3hI,36899
|
|
9
|
+
nxsconfigserver/__init__.py,sha256=dAvNwdxRsIARsH--JgJBAxzyaX3KPzZNStQ6B7SLbjI,1718
|
|
10
|
+
nxsconfigserver-2.18.0.data/scripts/NXSConfigServer,sha256=VEAkby0R6UyckF-OofkVDPx3Mkn6rjPrl2xMbbBXqwo,986
|
|
11
|
+
nxsconfigserver-2.18.0.dist-info/METADATA,sha256=DsbF-BxvE5W8TpwyM_GnNx3_l6s0D-knin0jYLuHr7Y,14440
|
|
12
|
+
nxsconfigserver-2.18.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
13
|
+
nxsconfigserver-2.18.0.dist-info/top_level.txt,sha256=TFz-xXdq3yV2iwY44R0uY1F-zqwYDnOmcJlN9kdo1S8,16
|
|
14
|
+
nxsconfigserver-2.18.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=v8jtDGi1NYugNpcYyyxFRP8XZQcbye8cKbYtj8iQaBM,21686
|
|
5
|
-
nxsconfigserver/NXSConfigServer.py,sha256=g894NApWFK3RS8MCuZd4HR6K8DCbs0sE-gYLZ9Q0OoI,44001
|
|
6
|
-
nxsconfigserver/Release.py,sha256=ZF7Wt1GNsab9PoJiL5ZtBBAebQx-PCT1f3rpwwmZaOo,895
|
|
7
|
-
nxsconfigserver/StreamSet.py,sha256=sSvXJxoDufmt9_Xu5rFaQsp_4x9gww_zMv0NTiiyLlg,5799
|
|
8
|
-
nxsconfigserver/XMLConfigurator.py,sha256=XitDApCprP0Em17Gi2w8J_XFm8RiH3VlyOvc7vlYeiA,34163
|
|
9
|
-
nxsconfigserver/__init__.py,sha256=dAvNwdxRsIARsH--JgJBAxzyaX3KPzZNStQ6B7SLbjI,1718
|
|
10
|
-
nxsconfigserver-2.16.0.data/scripts/NXSConfigServer,sha256=VEAkby0R6UyckF-OofkVDPx3Mkn6rjPrl2xMbbBXqwo,986
|
|
11
|
-
nxsconfigserver-2.16.0.dist-info/METADATA,sha256=QWzKAoM0loUyCa95t6oiJdRNwZzq37B4gm21WTl74pg,14279
|
|
12
|
-
nxsconfigserver-2.16.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
13
|
-
nxsconfigserver-2.16.0.dist-info/top_level.txt,sha256=TFz-xXdq3yV2iwY44R0uY1F-zqwYDnOmcJlN9kdo1S8,16
|
|
14
|
-
nxsconfigserver-2.16.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|