Changeset 3b3b40b in sasview for src/sas/qtgui/Utilities/GuiUtils.py
- Timestamp:
- Mar 21, 2018 4:17:04 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 8b480d27
- Parents:
- e4c475b7
- git-author:
- Piotr Rozyczko <rozyczko@…> (02/08/18 04:19:04)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (03/21/18 04:17:04)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Utilities/GuiUtils.py
r63319b0 r3b3b40b 213 213 plotRequestedSignal = QtCore.pyqtSignal(list) 214 214 215 # Plot from file names 216 plotFromFilenameSignal = QtCore.pyqtSignal(str) 217 215 218 # Plot update requested from a perspective 216 219 plotUpdateSignal = QtCore.pyqtSignal(list) … … 236 239 # Send result of Data Operation Utility panel to Data Explorer 237 240 updateModelFromDataOperationPanelSignal = QtCore.pyqtSignal(QtGui.QStandardItem, dict) 241 242 # Notify about a new custom plugin being written/deleted/modified 243 customModelDirectoryChanged = QtCore.pyqtSignal() 238 244 239 245 def updateModelItemWithPlot(item, update_data, name=""): … … 872 878 raise TypeError 873 879 880 def findNextFilename(filename, directory): 881 """ 882 Finds the next available (non-existing) name for 'filename' in 'directory'. 883 plugin.py -> plugin (n).py - for first 'n' for which the file doesn't exist 884 """ 885 basename, ext = os.path.splitext(filename) 886 # limit the number of copies 887 MAX_FILENAMES = 1000 888 # Start with (1) 889 number_ext = 1 890 proposed_filename = "" 891 found_filename = False 892 # Find the next available filename or exit if too many copies 893 while not found_filename or number_ext > MAX_FILENAMES: 894 proposed_filename = basename + " ("+str(number_ext)+")" + ext 895 if os.path.exists(os.path.join(directory, proposed_filename)): 896 number_ext += 1 897 else: 898 found_filename = True 899 900 return proposed_filename 901 902 874 903 class DoubleValidator(QtGui.QDoubleValidator): 875 904 """
Note: See TracChangeset
for help on using the changeset viewer.