From ab78af6f47b8c3fc17a057e64208649e7d3a6141 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 6 Oct 2012 12:46:22 +0200 Subject: [PATCH] Fix what I broke... *oops* --- dsl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dsl.py b/dsl.py index c7ea0f9..d580276 100755 --- a/dsl.py +++ b/dsl.py @@ -86,9 +86,9 @@ def res2user(res): strRatio = '16:%d' % ratio return '%dx%d (%s)' %(w, h, strRatio) -def findAvailableConnector(tryConnectors): +def findAvailableConnector(tryConnectors, allConnectors): for connector in tryConnectors: - if connector in connectors and connectors[connector]: # if the connector exists and is active (i.e. there is a resolution) + if connector in allConnectors and allConnectors[connector]: # if the connector exists and is active (i.e. there is a resolution) return connector return None @@ -106,7 +106,7 @@ def main(): raise Exception("Connector %s does not exist, there is an error in your config file." % internalConnector) else: # auto-config - internalConnector = findAvailableConnector(commonInternalConnectorNames) + internalConnector = findAvailableConnector(commonInternalConnectorNames, connectors) if internalConnector is None: raise Exception("Could not automatically find internal connector, please use ~/.dsl.conf to specify it manually.") # all the rest is external then, obviously - unless the user wants to do that manually @@ -127,7 +127,7 @@ def main(): args[c] = ["--off"] # Check what to do - usedExternalConnector = findAvailableConnector(externalConnectors) # *the* external connector which is actually used + usedExternalConnector = findAvailableConnector(externalConnectors, connectors) # *the* external connector which is actually used if usedExternalConnector is not None: # there's an external screen connected, we need to ask what to do internalResolutions = connectors[internalConnector] externalResolutions = connectors[usedExternalConnector] -- 2.30.2