Skip to content

Commit

Permalink
Merge pull request #1935 from vallsv/fix-calib2-calibrant
Browse files Browse the repository at this point in the history
calib2: Fixes calibrant selection
  • Loading branch information
kif authored Sep 6, 2023
2 parents 28d1f22 + 80ed072 commit 03ef9b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,12 @@ def find_executable(target):
# search the executable in pyproject.toml
with open(os.path.join(PROJECT_DIR, "pyproject.toml")) as f:
pyproject = tomli.loads(f.read())
for script, entry_point in list(pyproject.get("console_scripts", {}).items()) + list(pyproject.get("gui_scripts", {}).items()):

scripts = {}
scripts.update(pyproject.get("project", {}).get("scripts", {}))
scripts.update(pyproject.get("project", {}).get("gui-scripts", {}))

for script, entry_point in scripts.items():
if script == target:
print(script, entry_point)
return ("entry_point", target, entry_point)
Expand Down
10 changes: 10 additions & 0 deletions pyFAI/gui/widgets/CalibrantSelector2.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,16 @@ def __init__(self, parent=None):
view.sigLoadFileRequested.connect(self.__loadFileRequested)
self.setView(view)

self.activated.connect(self.__calibrantWasSelected)

def __calibrantWasSelected(self):
index = self.currentIndex()
if index == -1:
calibrant = None
else:
calibrant = self.itemData(index, role=CalibrantItemModel.CALIBRANT_ROLE)
self.__calibrantModel.setCalibrant(calibrant)

def __modelChanged(self):
calibrant = self.__calibrantModel.calibrant()
model = self.model()
Expand Down

0 comments on commit 03ef9b0

Please sign in to comment.