def get_config(): """Get the Load Marker config object or None.""" file_name = const.CONFIG_FILE_NAME config_path = config_utils.get_home_dir_path(file_name) config = config_utils.Config(config_path) config.set_autoread(False) config.set_autowrite(False) return config
def __init__(self, parent, name=None): super(BaseMayaWindow, self).__init__() self.windowGeometry = None # Destroy this widget when closed. Otherwise it will stay around. self.setAttribute(QtCore.Qt.WA_DeleteOnClose, True) # Call the UI file contents. self.setupUi(self) if name is not None: self.setObjectName(name) # Get settings path. config_name = type(self).name + '.ini' config_path = config_utils.get_home_dir_path(config_name) self._settings_path = config_path return
def __init__(self, parent, name=None): s = time.time() super(BaseMayaWindow, self).__init__() self.windowGeometry = None # Destroy this widget when closed. Otherwise it will stay around. self.setAttribute(QtCore.Qt.WA_DeleteOnClose, True) # Call the UI file contents. self.setupUi(self) if name is not None: self.setObjectName(name) # Get settings path. config_name = type(self).name + '.ini' config_path = config_utils.get_home_dir_path(config_name) self._settings_path = config_path e = time.time() LOG.debug('BaseMayaWindow init: %r seconds', e - s) LOG.info('is the window dockable?: %s' % self.isDockable()) return
import mmSolver.logger import mmSolver.utils.config as config_utils import mmSolver.tools.userpreferences.constant as const LOG = mmSolver.logger.get_logger() # Intialised without a file path, because we only look up the file in # the functions below. # # Users are not allowed to touch this variable. # # Note we never re-assign this variable. The Config object instance is # always reused. __CONFIG_PATH = config_utils.get_home_dir_path(const.CONFIG_FILE_NAME) __CONFIG = config_utils.Config(__CONFIG_PATH) __CONFIG.autoread = True __CONFIG.autowrite = False def get_config(): return __CONFIG def force_reload_from_file(): if os.path.isfile(__CONFIG.file_path): __CONFIG.read() return