[or-cvs] r23726: {arm} fix: removing case sensitivity when fetching descriptions fr (arm/trunk/src/util)

Damian Johnson atagar1 at gmail.com
Sun Oct 31 03:07:07 UTC 2010


Author: atagar
Date: 2010-10-31 03:07:06 +0000 (Sun, 31 Oct 2010)
New Revision: 23726

Modified:
   arm/trunk/src/util/torConfig.py
Log:
fix: removing case sensitivity when fetching descriptions from the man page



Modified: arm/trunk/src/util/torConfig.py
===================================================================
--- arm/trunk/src/util/torConfig.py	2010-10-30 12:07:37 UTC (rev 23725)
+++ arm/trunk/src/util/torConfig.py	2010-10-31 03:07:06 UTC (rev 23726)
@@ -103,7 +103,7 @@
             if inputFileContents: loadedLine = inputFileContents.pop(0)
             else: break
           
-          CONFIG_DESCRIPTIONS[option] = (argument, description.rstrip())
+          CONFIG_DESCRIPTIONS[option.lower()] = (argument, description.rstrip())
       except IndexError:
         CONFIG_DESCRIPTIONS.clear()
         raise IOError("input file format is invalid")
@@ -127,7 +127,7 @@
           # down on the noise).
           strippedDescription = lastDescription.strip()
           if lastOption and strippedDescription:
-            CONFIG_DESCRIPTIONS[lastOption] = (lastArg, strippedDescription)
+            CONFIG_DESCRIPTIONS[lastOption.lower()] = (lastArg, strippedDescription)
           lastDescription = ""
           
           # parses the option and argument
@@ -193,8 +193,8 @@
   
   CONFIG_DESCRIPTIONS_LOCK.acquire()
   
-  if option in CONFIG_DESCRIPTIONS:
-    returnVal = CONFIG_DESCRIPTIONS[option]
+  if option.lower() in CONFIG_DESCRIPTIONS:
+    returnVal = CONFIG_DESCRIPTIONS[option.lower()]
   else: returnVal = None
   
   CONFIG_DESCRIPTIONS_LOCK.release()



More information about the tor-commits mailing list