def _setup_addinfiles(self): """Reads the state of pyRevit addin files for different Revit versions and updates the ui. """ self.is_pyrevit_allusers = addinfiles.is_pyrevit_for_allusers() if self.is_pyrevit_allusers: addinfiles_states = addinfiles.get_addinfiles_state(allusers=True) self.revitversions_tb.Text = \ str(self.revitversions_tb.Text).replace('%appdata%', '%programdata%') else: addinfiles_states = addinfiles.get_addinfiles_state() for rvt_ver, checkbox in self._addinfiles_cboxes.items(): if rvt_ver in addinfiles_states.keys(): if rvt_ver != HOST_APP.version: checkbox.IsEnabled = True checkbox.IsChecked = addinfiles_states[rvt_ver] else: checkbox.Content = 'Revit {} (Current version. ' \ 'Can not disable.)'.format(rvt_ver) checkbox.IsEnabled = False checkbox.IsChecked = True else: checkbox.Content = 'Revit {} (Not installed)'.format(rvt_ver) checkbox.IsChecked = checkbox.IsEnabled = False
def _setup_addinfiles(self): addinfiles_states = get_addinfiles_state() for rvt_ver, checkbox in self._addinfiles_checkboxes.items(): if rvt_ver in addinfiles_states.keys(): if rvt_ver != HOST_APP.version: checkbox.IsEnabled = True checkbox.IsChecked = addinfiles_states[rvt_ver] else: checkbox.Content = 'Revit {} (Current version. Can not disable.)'.format(rvt_ver) checkbox.IsEnabled = False checkbox.IsChecked = True else: checkbox.Content = 'Revit {} (Not installed)'.format(rvt_ver) checkbox.IsChecked = checkbox.IsEnabled = False