[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Allow case insensitive torrc attribute lookups



commit 9a4688d6338fe20862fccc5dc63373f8c8c2eb82
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Aug 26 17:08:44 2017 -0700

    Allow case insensitive torrc attribute lookups
    
    Making the primary key uppercase so we can do case insensitive lookups.
---
 stem/manual.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/stem/manual.py b/stem/manual.py
index e78f917c..9b9c0252 100644
--- a/stem/manual.py
+++ b/stem/manual.py
@@ -526,7 +526,7 @@ class Manual(object):
       conn.execute('CREATE TABLE commandline(name TEXT PRIMARY KEY, description TEXT)')
       conn.execute('CREATE TABLE signals(name TEXT PRIMARY KEY, description TEXT)')
       conn.execute('CREATE TABLE files(name TEXT PRIMARY KEY, description TEXT)')
-      conn.execute('CREATE TABLE torrc(name TEXT PRIMARY KEY, category TEXT, usage TEXT, summary TEXT, description TEXT, position NUMBER)')
+      conn.execute('CREATE TABLE torrc(key TEXT PRIMARY KEY, name TEXT, category TEXT, usage TEXT, summary TEXT, description TEXT, position NUMBER)')
 
       conn.execute('INSERT INTO metadata(name, synopsis, description, man_commit, stem_commit) VALUES (?,?,?,?,?)', (self.name, self.synopsis, self.description, self.man_commit, self.stem_commit))
 
@@ -540,7 +540,7 @@ class Manual(object):
         conn.execute('INSERT INTO files(name, description) VALUES (?,?)', (k, v))
 
       for i, v in enumerate(self.config_options.values()):
-        conn.execute('INSERT INTO torrc(name, category, usage, summary, description, position) VALUES (?,?,?,?,?,?)', (v.name, v.category, v.usage, v.summary, v.description, i))
+        conn.execute('INSERT INTO torrc(key, name, category, usage, summary, description, position) VALUES (?,?,?,?,?,?,?)', (v.name.upper(), v.name, v.category, v.usage, v.summary, v.description, i))
 
     if os.path.exists(path):
       os.remove(path)

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits