commit aa3223ee4faa7e2cb8ff4539d75c0c1c11d7a64b Author: Sathyanarayanan Gunasekaran gsathya.ceg@gmail.com Date: Wed Sep 26 18:40:38 2012 +0530
rename hex_fingerprint to hashed_fingerprint --- pyonionoo/database.py | 6 +++--- pyonionoo/parser.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/pyonionoo/database.py b/pyonionoo/database.py index 99573f8..44a0b25 100644 --- a/pyonionoo/database.py +++ b/pyonionoo/database.py @@ -43,7 +43,7 @@ id INTEGER PRIMARY KEY, type CHARACTER, nickname STRING, fingerprint STRING, -hex_fingerprint STRING, +hashed_fingerprint STRING, running BOOLEAN, time_published STRING, or_port STRING, @@ -142,7 +142,7 @@ def update_databases(summary_file=None): # field in the flags/addresses table. Here we can avoid all those # selects, because the rowid attribute of the cursor is set to that # id field right after we execute the (individual) insert statements. - summary_fields = ('type', 'nickname', 'fingerprint', 'hex_fingerprint', 'running', + summary_fields = ('type', 'nickname', 'fingerprint', 'hashed_fingerprint', 'running', 'time_published', 'or_port', 'dir_port', 'consensus_weight', 'country_code', 'hostname', 'time_lookup', 'flags', 'addresses', 'search')
@@ -205,7 +205,7 @@ def query_summary_tbl(running_filter=None, type_filter=None, hex_fingerprint_fil if type_filter: clauses.append("type = '%s'" % type_filter) if hex_fingerprint_filter: - clauses.append("hex_fingerprint = '%s'" % hex_fingerprint_filter) + clauses.append("hashed_fingerprint = '%s'" % hex_fingerprint_filter) if country_filter: clauses.append("country_code = '%s'" % country_filter) where_clause = ('WHERE %s' % ' and '.join(clauses)) if clauses else '' diff --git a/pyonionoo/parser.py b/pyonionoo/parser.py index f82ec2e..8e62e0a 100644 --- a/pyonionoo/parser.py +++ b/pyonionoo/parser.py @@ -8,7 +8,7 @@ class Router: def __init__(self): self.nickname = None self.fingerprint = None - self.hex_fingerprint = None + self.hashed_fingerprint = None self.address = None self.addresses = None self.exit_addresses = None @@ -34,7 +34,7 @@ class Router:
self.nickname = values[1] self.fingerprint = values[2] - self.hex_fingerprint = sha1(a2b_hex(self.fingerprint)).hexdigest() + self.hashed_fingerprint = sha1(a2b_hex(self.fingerprint)).hexdigest()
if ';' in values[3]: address_parts = values[3].split(';') @@ -87,7 +87,7 @@ class Router: router_list = [] for field in fields: if field == "search": - value = ' %s %s %s %s' % (self.fingerprint, self.hex_fingerprint, + value = ' %s %s %s %s' % (self.fingerprint, self.hashed_fingerprint, self.nickname, self.address) elif field == "flags": value = ' '.join(self.flags)