[WIP] rename to frappy.has_changed()
This commit is contained in:
17
devices.py
17
devices.py
@ -164,7 +164,7 @@ class FrappyConfig(Device):
|
||||
cfgs = self.check_services()
|
||||
proposed, overview = self.to_consider(cfgs)
|
||||
if overview != self._previous_shown and (proposed or not self._servers_loaded):
|
||||
cmd = 'frappy.changed()'
|
||||
cmd = 'frappy.has_changed() # inserted automatically when frappy or sea servers changed'
|
||||
controller.new_request(ScriptRequest(cmd, None, User('guest', USER)))
|
||||
except RequestError as e:
|
||||
session.log.error(f'can not queue request {e!r}')
|
||||
@ -310,9 +310,13 @@ class FrappyConfig(Device):
|
||||
|
||||
def show_config(self, allcfg, full=False):
|
||||
proposed, overview = self.to_consider(allcfg)
|
||||
# remove 'frappy.changed()' commands in script queue
|
||||
if full == 'auto' and overview != self._previous_shown or full is True:
|
||||
for line in overview:
|
||||
session.log.info('%s', line)
|
||||
# remove 'frappy.has_changed()' commands in script queue
|
||||
controller = session.daemon_device._controller
|
||||
controller.block_requests(r['reqid'] for r in controller.get_queue() if r['script'] == 'frappy.changed()')
|
||||
controller.block_requests(r['reqid'] for r in controller.get_queue()
|
||||
if r['script'].startswith('frappy.has_changed()'))
|
||||
self._previous_shown = overview
|
||||
session.log.info(all_info(allcfg))
|
||||
|
||||
@ -322,9 +326,6 @@ class FrappyConfig(Device):
|
||||
session.log.info(info)
|
||||
if '?' in info:
|
||||
session.log.warning("but create cfg files first for items marked with '?'")
|
||||
if full:
|
||||
for line in overview:
|
||||
session.log.info('%s', line)
|
||||
|
||||
def initial_restart_cfg(self, service):
|
||||
"""get cfg for (re)start of the service
|
||||
@ -359,9 +360,9 @@ class FrappyConfig(Device):
|
||||
self._initial_config = fm.propose_cfgs(config.instrument, cfgs)[0]
|
||||
return self._initial_config.get(service)
|
||||
|
||||
def changed(self):
|
||||
def has_changed(self):
|
||||
self._servers_loaded = True
|
||||
self.show_config(self.check_services())
|
||||
self.show_config(self.check_services(), 'auto')
|
||||
|
||||
def remove_aliases(self):
|
||||
for meaning in self.meanings:
|
||||
|
Reference in New Issue
Block a user