3 from Remote import Remote
4 from Table import Table
6 class PLC(dict, Remote):
8 'name': 'TestPLC', # PLC Name
9 'host': 'localhost', # Node Hostname
10 'ip': '127.0.0.1', # IP
12 'vserver': None, # Vserver where this PLC lives
13 'rootkey': '/home/tmack/.ssh/plc-root', # Root Key
14 'api_path': '/PLCAPI/', # PLCAPI path
15 'port': '443' # PLCAPI port
19 def __init__(self, config, fields = {}):
20 # XX Filter out fields not specified in fields
21 dict.__init__(self, self.fields)
23 # Merge defined fields with defaults
28 self.config.update_api(self)
30 class PLCs(list, Table):
32 def __init__(self, config, plcs):
33 plclist = [PLC(config, plc) for plc in plcs]
34 list.__init__(self, plclist)