1671def applyConfigurableUsers_old():
1672 """
1673 Obsolete (buggy) implementation of applyConfigurableUsers(), kept to provide
1674 backward compatibility for configurations that where relying (implicitly) on
1675 bug #103803, or on a specific (non guaranteed) order of execution.
1676
1677 @see applyConfigurableUsers()
1678 """
1679
1680 global _appliedConfigurableUsers_, postConfigActions
1681 if _appliedConfigurableUsers_:
1682 return
1683 _appliedConfigurableUsers_ = True
1684
1685 debugApplyOrder = "GAUDI_DUBUG_CONF_USER" in os.environ
1686 confUsers = [
1687 c
1688 for c in Configurable.allConfigurables.values()
1689 if hasattr(c, "__apply_configuration__")
1690 ]
1691 applied = True
1692 while applied and confUsers:
1693 newConfUsers = []
1694 applied = False
1695 for c in confUsers:
1696 if hasattr(c, "__users__") and c.__users__:
1697 newConfUsers.append(c)
1698 else:
1699 applied = True
1700
1701
1702 enabled = (not hasattr(c, "_enabled")) or c._enabled
1703 if enabled:
1704 log.info("applying configuration of %s", c.name())
1705 if debugApplyOrder:
1706 sys.stderr.write(f"applying {c!r}")
1707 c.__apply_configuration__()
1708 log.info(c)
1709 else:
1710 log.info("skipping configuration of %s", c.name())
1711 if hasattr(c, "__detach_used__"):
1712
1713 c.__detach_used__()
1714 confUsers = newConfUsers
1715 if confUsers:
1716
1717 raise Error(
1718 "Detected loop in the ConfigurableUser "
1719 " dependencies: %r" % [c.name() for c in confUsers]
1720 )
1721
1722 known = set()
1723 unknown = set(Configurable.allConfigurables)
1724 while unknown:
1725 for k in unknown:
1726 if not known:
1727 log.debug("new configurable created automatically: %s", k)
1728
1729 Configurable.allConfigurables[k].properties()
1730 known.add(k)
1731 unknown -= known
1732
1733 for action in postConfigActions:
1734 action()
1735
1736