Skip to content

Commit

Permalink
Merge pull request #921 from YektaY/embedded
Browse files Browse the repository at this point in the history
ENH: New embedded display method which can update macros and filename without a reload in between
  • Loading branch information
jbellister-slac authored Sep 16, 2022
2 parents 23db1d1 + c01c68d commit f4224d9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pydm/widgets/embedded_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,23 @@ def filename(self, filename):
self.clear_error_text()
self.load_if_needed()

def set_macros_and_filename(self, new_filename, new_macros):
"""
A method to change both macros and the filename of an embedded display.
the method takes in a Filename of the display to embed and a
JSON-formatted string containing macro variables to pass to the embedded file.
Parameters
----------
new_macros : str
new_filename : str
"""
new_macros = str(new_macros)
if new_macros != self._macros:
self._macros = new_macros

self.filename = new_filename

def parsed_macros(self):
"""
Dictionary containing the key value pair for each macro specified.
Expand Down

0 comments on commit f4224d9

Please sign in to comment.