Changeset 1eafef1 in sasview


Ignore:
Timestamp:
Oct 26, 2017 8:26:01 AM (7 years ago)
Author:
Adam Washington <adam.washington@…>
Parents:
ff2b961
Message:

Unify enum function into GuiUtils?

Location:
src/sas/qtgui
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Calculators/DensityPanel.py

    rb0c5e8c r1eafef1  
    88from sas.qtgui.Utilities.GuiUtils import FormulaValidator 
    99from sas.qtgui.UI import main_resources_rc 
    10 from sas.qtgui.Utilities.GuiUtils import HELP_DIRECTORY_LOCATION 
     10from sas.qtgui.Utilities.GuiUtils import HELP_DIRECTORY_LOCATION, enum 
    1111 
    1212# Local UI 
    1313from sas.qtgui.Calculators.UI.DensityPanel import Ui_DensityPanel 
    14  
    15 def enum(*sequential, **named): 
    16     enums = dict(zip(sequential, range(len(sequential))), **named) 
    17     return type('Enum', (), enums) 
    1814 
    1915MODEL = enum( 
  • src/sas/qtgui/Calculators/SldPanel.py

    rb0c5e8c r1eafef1  
    1414from sas.qtgui.Calculators.UI.SldPanel import Ui_SldPanel 
    1515 
    16 def enum(*sequential, **named): 
    17     enums = dict(zip(sequential, range(len(sequential))), **named) 
    18     return type('Enum', (), enums) 
    19  
    20 MODEL = enum( 
     16MODEL = GuiUtils.enum( 
    2117    'MOLECULAR_FORMULA', 
    2218    'MASS_DENSITY', 
  • src/sas/qtgui/Perspectives/Corfunc/CorfuncUtils.py

    r9634f86 r1eafef1  
    1 def enum(*sequential, **named): 
    2     enums = dict(zip(sequential, range(len(sequential))), **named) 
    3     return type('Enum', (), enums) 
     1from sas.qtgui.Utilities.GuiUtils import enum 
    42 
    53WIDGETS = enum( 'W_QMIN', 
  • src/sas/qtgui/Perspectives/Invariant/InvariantUtils.py

    rf721030 r1eafef1  
    1 def enum(*sequential, **named): 
    2     enums = dict(zip(sequential, range(len(sequential))), **named) 
    3     return type('Enum', (), enums) 
     1from sas.qtgui.Utilities.GuiUtils import enum 
    42 
    53WIDGETS = enum( 'W_FILENAME',           #0 
  • src/sas/qtgui/Utilities/GuiUtils.py

    r88e1f57 r1eafef1  
    806806    else: 
    807807        return name 
     808 
     809def enum(*sequential, **named): 
     810    """Create an enumeration object from a list of strings""" 
     811    enums = dict(zip(sequential, range(len(sequential))), **named) 
     812    return type('Enum', (), enums) 
Note: See TracChangeset for help on using the changeset viewer.