nxsconfigserver package¶
Submodules¶
nxsconfigserver.ComponentParser module¶
Parser for searching database names in components
-
class
ComponentHandler
(dsLabel='datasources', delimiter='.')[source]¶ Bases:
xml.sax.handler.ContentHandler
SAX2 parser
constructor
- Parameters
- Brief
It constructs parser and sets variables to default values
nxsconfigserver.Errors module¶
Error classes
-
exception
IncompatibleNodeError
(value, nodes=None)[source]¶ Bases:
Exception
Incompatible class Exception
constructor
- Parameters
-
nodes
¶ nodes with errors
-
value
¶ exception value
nxsconfigserver.MYSQLDataBase module¶
Providesthe access to MYSQL database with NDTS configuration files
-
class
MYSQLDataBase
(streams=None)[source]¶ Bases:
object
XML Configurer
constructor
- Brief
It creates the MYSQLDataBase instance
- Parameters
streams (
StreamSet
ortango.LatestDeviceImpl
) -- tango-like steamset class
-
deleteComponent
(name)[source]¶ deletes the given component
- Parameters
name (
str
) -- name of the component to delete
-
deleteDataSource
(name)[source]¶ deletes the given datasource
- Parameters
name (
str
) -- name of the datasource to delete
-
deleteSelection
(name)[source]¶ deletes the given selection
- Parameters
name (
str
) -- name of the selection to delete
-
setMandatory
(name)[source]¶ sets components as mandatory
- Parameters
name (
str
) -- name of the component
nxsconfigserver.Merger module¶
Classes for merging DOM component trees
nxsconfigserver.NXSConfigServer module¶
Configuration Server for Nexus Data Writer
-
class
NXSConfigServer
(cl, name)[source]¶ Bases:
tango.device_server.LatestDeviceImpl
NXSConfigServer Class Description:
- Brief
Configuration Server based on MySQL database. Device States Description: DevState.OPEN - Open connection to the database, DevState.ON - Server is ON, DevState.RUNNING - Performing a query,
Device constructor
-
DeleteComponent
(argin)[source]¶ DeleteComponent command
- Brief
Deletes the given component
- Parameters
argin (
str
) -- DevString component name
-
DeleteDataSource
(argin)[source]¶ DeleteDataSource command
- Brief
Deletes the given datasource
- Parameters
argin (
str
) -- DevString datasource name
-
DeleteSelection
(argin)[source]¶ DeleteSelection command
- Brief
Deletes the given selection
- Parameters
argin (
str
) -- DevString selection name
-
SetComponentDataSources
(argin)[source]¶ SetComponentDataSources command
- Brief
Sets component datasources according to given dictionary
- Parameters
argin (
str
) -- DevString JSON dict { comp1: {ds: tds, ...}, ...}
-
StoreComponent
(argin)[source]¶ StoreComponent command
- Brief
Stores the component from XMLString
- Parameters
argin (
str
) -- DevString component name
-
StoreDataSource
(argin)[source]¶ StoreDataSource command
- Brief
Stores the DataSource from XMLString
- Parameters
argin (
str
) -- DevString datasource name
-
StoreSelection
(argin)[source]¶ StoreSelection command
- Brief
Stores the selection from XMLString
- Parameters
argin (
str
) -- DevString selection name
-
is_AvailableComponents_allowed
()[source]¶ AvailableComponents command State Machine
- Returns
True if the operation allowed
- Return type
-
is_AvailableDataSources_allowed
()[source]¶ AvailableDataSources command State Machine
- Returns
True if the operation allowed
- Return type
-
is_AvailableSelections_allowed
()[source]¶ AvailableSelections command State Machine
- Returns
True if the operation allowed
- Return type
-
is_CanFailDataSources_write_allowed
()[source]¶ CanFailDataSources attribute Write State Machine
- Returns
True if the operation allowed
- Return type
-
is_Close_allowed
()[source]¶ Close command State Machine
- Returns
True if the operation allowed
- Return type
-
is_ComponentDataSources_allowed
()[source]¶ ComponentDataSources command State Machine
- Returns
True if the operation allowed
- Return type
-
is_ComponentVariables_allowed
()[source]¶ ComponentVariables command State Machine
- Returns
True if the operation allowed
- Return type
-
is_ComponentsDataSources_allowed
()[source]¶ ComponentsDataSources command State Machine
- Returns
True if the operation allowed
- Return type
-
is_ComponentsVariables_allowed
()[source]¶ ComponentsVariables command State Machine
- Returns
True if the operation allowed
- Return type
-
is_Components_allowed
()[source]¶ Components command State Machine
- Returns
True if the operation allowed
- Return type
-
is_CreateConfiguration_allowed
()[source]¶ CreateConfiguration command State Machine
- Returns
True if the operation allowed
- Return type
-
is_DataSources_allowed
()[source]¶ DataSources command State Machine
- Returns
True if the operation allowed
- Return type
-
is_DeleteComponent_allowed
()[source]¶ DeleteComponent command State Machine
- Returns
True if the operation allowed
- Return type
-
is_DeleteDataSource_allowed
()[source]¶ DeleteDataSource command State Machine
- Returns
True if the operation allowed
- Return type
-
is_DeleteSelection_allowed
()[source]¶ DeleteSelection command State Machine
- Returns
True if the operation allowed
- Return type
-
is_DependentComponents_allowed
()[source]¶ DependentComponents command State Machine
- Returns
True if the operation allowed
- Return type
-
is_InstantiatedComponents_allowed
()[source]¶ Components command State Machine
- Returns
True if the operation allowed
- Return type
-
is_JSONSettings_write_allowed
()[source]¶ JSONSettings attribute Write State Machine
- Returns
True if the operation allowed
- Return type
-
is_LinkDataSources_write_allowed
()[source]¶ LinkDataSources attribute Write State Machine
- Returns
True if the operation allowed
- Return type
-
is_MandatoryComponents_allowed
()[source]¶ MandatoryComponents command State Machine
- Returns
True if the operation allowed
- Return type
-
is_Merge_allowed
()[source]¶ Merge command State Machine
- Returns
True if the operation allowed
- Return type
-
is_Open_allowed
()[source]¶ Open command State Machine
- Returns
True if the operation allowed
- Return type
-
is_STEPDataSources_write_allowed
()[source]¶ STEPDataSources attribute Write State Machine
- Returns
True if the operation allowed
- Return type
-
is_Selection_allowed
(_)[source]¶ Selection attribute State Machine
- Returns
True if the operation allowed
- Return type
-
is_Selections_allowed
()[source]¶ Selections command State Machine
- Returns
True if the operation allowed
- Return type
-
is_SetComponentDataSources_allowed
()[source]¶ SetComponentDataSources command State Machine
- Returns
True if the operation allowed
- Return type
-
is_SetMandatoryComponents_allowed
()[source]¶ SetMandatoryComponents command State Machine
- Returns
True if the operation allowed
- Return type
-
is_StoreComponent_allowed
()[source]¶ StoreComponent command State Machine
- Returns
True if the operation allowed
- Return type
-
is_StoreDataSource_allowed
()[source]¶ StoreDataSource command State Machine
- Returns
True if the operation allowed
- Return type
-
is_StoreSelection_allowed
()[source]¶ StoreSelection command State Machine
- Returns
True if the operation allowed
- Return type
-
is_UnsetMandatoryComponents_allowed
()[source]¶ UnsetMandatoryComponents command State Machine
- Returns
True if the operation allowed
- Return type
-
is_Variables_allowed
(_)[source]¶ Variables attribute State Machine
- Returns
True if the operation allowed
- Return type
-
is_XMLString_allowed
(_)[source]¶ XMLString attribute State Machine
- Returns
True if the operation allowed
- Return type
-
read_CanFailDataSources
(attr)[source]¶ Read CanFailDataSources attribute
- Parameters
attr (
tango.Attribute
) -- step datasources attribute
-
read_JSONSettings
(attr)[source]¶ Read JSONSettings attribute
- Parameters
attr (
tango.Attribute
) -- jsonsettings attribute
-
read_LinkDataSources
(attr)[source]¶ Read LinkDataSources attribute
- Parameters
attr (
tango.Attribute
) -- link datasources attribute
-
read_STEPDataSources
(attr)[source]¶ Read STEPDataSources attribute
- Parameters
attr (
tango.Attribute
) -- step datasources attribute
-
read_Selection
(attr)[source]¶ Read Selection attribute
- Parameters
attr (
tango.Attribute
) -- selection attribute
-
read_Variables
(attr)[source]¶ Read Variables attribute
- Parameters
attr (
tango.Attribute
) -- variables attribute
-
read_Version
(attr)[source]¶ Read Version attribute
- Parameters
attr (
tango.Attribute
) -- version attribute
-
read_XMLString
(attr)[source]¶ Read XMLString attribute
- Parameters
attr (
tango.Attribute
) -- xml string attribute
-
write_CanFailDataSources
(attr)[source]¶ Write CanFailDataSources attribute
- Parameters
attr (
tango.Attribute
) -- step datasources attribute
-
write_JSONSettings
(attr)[source]¶ Read JSONSettings attribute
- Parameters
attr (
tango.Attribute
) -- jsonsettings attribute
-
write_LinkDataSources
(attr)[source]¶ Write LinkDataSources attribute
- Parameters
attr (
tango.Attribute
) -- link datasources attribute
-
write_STEPDataSources
(attr)[source]¶ Write STEPDataSources attribute
- Parameters
attr (
tango.Attribute
) -- step datasources attribute
-
write_Selection
(attr)[source]¶ Write Selection attribute
- Parameters
attr (
tango.Attribute
) -- selection attribute
-
write_Variables
(attr)[source]¶ Write Variables attribute
- Parameters
attr (
tango.Attribute
) -- variables attribute
-
write_XMLString
(attr)[source]¶ Write XMLString attribute
- Parameters
attr (
tango.Attribute
) -- xml string attribute
-
xmlc
¶ (
nxsconfigserver.XMLConfigutator.XMLConfigutator
) xml configurator instance
-
class
NXSConfigServerClass
(name)[source]¶ Bases:
tango._tango.DeviceClass
NXSConfigServerClass class definition
NXSConfigServerClass Constructor
-
attr_list
= {'CanFailDataSources': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Datasources to be switched into CanFail Mode', 'description': 'JSON list of datasources to be switched into CanFail mode during creating configuration process'}], 'JSONSettings': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Arguments of MySQLdb.connect(...)', 'description': 'The JSON string with parameters of MySQLdb.connect(...).', 'Memorized': 'true', 'Display level': tango._tango.DispLevel.EXPERT}], 'LinkDataSources': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Datasources to which links will be added', 'description': 'JSON list of datasourcesto which links will be added'}], 'STEPDataSources': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Datasources to be switched into STEP Mode', 'description': 'JSON list of datasources to be switched into STEP mode during creating configuration process'}], 'Selection': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Selected Component', 'description': 'It allows to pass JSON strings into database during performing StoreSelection.', 'Display level': tango._tango.DispLevel.EXPERT}], 'Variables': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'XML Configuration Variables', 'description': 'The JSON string with XML configuration variables'}], 'Version': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ], {'label': 'Configuration Version', 'description': 'Configuration version'}], 'XMLString': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'XML Configuration', 'description': 'It allows to pass XML strings into database during performing StoreComponent and StoreDataSource.\nMoreover, after performing CreateConfiguration it contains the resulting XML configuration.', 'Display level': tango._tango.DispLevel.EXPERT}]}¶
-
class_property_list
= {}¶ (
dict
<str
, [str
,tango.CmdArgType
, [list
<int
> ] ] > ) Class Properties
-
cmd_list
= {'AvailableComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available component names']], 'AvailableDataSources': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available DataSource names']], 'AvailableSelections': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available selection names']], 'Close': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'ComponentDataSources': [[tango._tango.CmdArgType.DevString, 'component name'], [tango._tango.CmdArgType.DevVarStringArray, 'list of datasource names']], 'ComponentVariables': [[tango._tango.CmdArgType.DevString, 'component name'], [tango._tango.CmdArgType.DevVarStringArray, 'list of variable names']], 'Components': [[tango._tango.CmdArgType.DevVarStringArray, 'list of component names'], [tango._tango.CmdArgType.DevVarStringArray, 'list of required components']], 'ComponentsDataSources': [[tango._tango.CmdArgType.DevVarStringArray, 'component names'], [tango._tango.CmdArgType.DevVarStringArray, 'list of datasource names']], 'ComponentsVariables': [[tango._tango.CmdArgType.DevVarStringArray, 'component names'], [tango._tango.CmdArgType.DevVarStringArray, 'list of variable names']], 'CreateConfiguration': [[tango._tango.CmdArgType.DevVarStringArray, 'list of component names'], [tango._tango.CmdArgType.DevVoid, '']], 'DataSources': [[tango._tango.CmdArgType.DevVarStringArray, 'list of DataSource names'], [tango._tango.CmdArgType.DevVarStringArray, 'list of required DataSources']], 'DeleteComponent': [[tango._tango.CmdArgType.DevString, 'component name'], [tango._tango.CmdArgType.DevVoid, '']], 'DeleteDataSource': [[tango._tango.CmdArgType.DevString, 'datasource name'], [tango._tango.CmdArgType.DevVoid, '']], 'DeleteSelection': [[tango._tango.CmdArgType.DevString, 'selection name'], [tango._tango.CmdArgType.DevVoid, '']], 'DependentComponents': [[tango._tango.CmdArgType.DevVarStringArray, 'component names'], [tango._tango.CmdArgType.DevVarStringArray, 'list of component names']], 'InstantiatedComponents': [[tango._tango.CmdArgType.DevVarStringArray, 'list of component names'], [tango._tango.CmdArgType.DevVarStringArray, 'list of instantiated components']], 'MandatoryComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'component names']], 'Merge': [[tango._tango.CmdArgType.DevVarStringArray, 'list of component names'], [tango._tango.CmdArgType.DevString, 'merged components']], 'Open': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'Selections': [[tango._tango.CmdArgType.DevVarStringArray, 'list of selection names'], [tango._tango.CmdArgType.DevVarStringArray, 'list of required selections']], 'SetComponentDataSources': [[tango._tango.CmdArgType.DevString, 'JSON dict {comp1: {tds1: ds1, ...}, ...}'], [tango._tango.CmdArgType.DevVoid, '']], 'SetMandatoryComponents': [[tango._tango.CmdArgType.DevVarStringArray, 'component names'], [tango._tango.CmdArgType.DevVoid, '']], 'StoreComponent': [[tango._tango.CmdArgType.DevString, 'component name'], [tango._tango.CmdArgType.DevVoid, '']], 'StoreDataSource': [[tango._tango.CmdArgType.DevString, 'datasource name'], [tango._tango.CmdArgType.DevVoid, '']], 'StoreSelection': [[tango._tango.CmdArgType.DevString, 'selection name'], [tango._tango.CmdArgType.DevVoid, '']], 'UnsetMandatoryComponents': [[tango._tango.CmdArgType.DevVarStringArray, 'list of component names'], [tango._tango.CmdArgType.DevVoid, '']]}¶ (
dict
<str
, [[tango.CmdArgType
,str
]] >) Command definitions
-
nxsconfigserver.StreamSet module¶
labels to Tango Streams
-
class
StreamSet
(streams)[source]¶ Bases:
object
streamset constractor
- Parameters
streams (
StreamSet
ortango.LatestDeviceImpl
) -- tango-like steamset class
-
log_debug
¶ (
tango.log4tango.TangoStream
) Tango debug log stream
-
log_error
¶ (
tango.log4tango.TangoStream
) Tango error log stream
-
log_fatal
¶ (
tango.log4tango.TangoStream
) Tango fatal log stream
-
log_info
¶ (
tango.log4tango.TangoStream
) Tango info log stream
-
log_warn
¶ (
tango.log4tango.TangoStream
) Tango warn log stream
nxsconfigserver.XMLConfigurator module¶
Provides the access to a database with NDTS configuration files
-
class
XMLConfigurator
(server=None)[source]¶ Bases:
object
XML Configurator
constructor
- Parameters
server (
tango.LatestDeviceImpl
) -- NXSConfigServer instance- Brief
It allows to construct XML configurer object
-
createConfiguration
(names)[source]¶ creates the final configuration string in the xmlstring attribute
-
deleteComponent
(name)[source]¶ deletes the given component
- Parameters
name (
str
) -- name of the component to delete
-
deleteDataSource
(name)[source]¶ deletes the given datasource
- Parameters
name (
str
) -- name of the datasource to delete
-
deleteSelection
(name)[source]¶ deletes the given selection
- Parameters
name (
str
) -- name of the selection to delete
-
open
()[source]¶ opens database connection
- Brief
It opens connection to the give database by JSON string
-
setComponentDataSources
(jdict)[source]¶ sets component datasources according to given dict
- Parameters
jdict (
str
) -- JSON dict of component datasources
-
storeComponent
(name)[source]¶ stores the component from the xmlstring attribute
- Parameters
name (
str
) -- name of the component to store
-
storeDataSource
(name)[source]¶ stores the datasource from the xmlstring attribute
- Parameters
name (
str
) -- name of the datasource to store
-
storeSelection
(name)[source]¶ stores the selection from the xmlstring attribute
- Parameters
name (
str
) -- name of the selection to store