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

[tor-commits] [depictor/master] Port to stem's master branch



commit 109738157cdc56a58d3440eb619516b28a2ec525
Author: Tom Ritter <tom@xxxxxxxxx>
Date:   Fri Apr 16 22:53:54 2021 -0400

    Port to stem's master branch
---
 utility.py       | 7 ++++---
 website.py       | 2 +-
 write_website.py | 8 ++++----
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/utility.py b/utility.py
index 390cebf..cef4979 100755
--- a/utility.py
+++ b/utility.py
@@ -4,6 +4,7 @@ import time
 import urllib
 import datetime
 
+import stem.directory
 import stem.descriptor
 import stem.descriptor.remote
 import stem.util.conf
@@ -19,7 +20,7 @@ def get_dirauths():
 	global _dirAuths
 	if _dirAuths == None:
 		#Remove any BridgeAuths
-		_dirAuths = dict((k.lower(), v) for (k, v) in stem.descriptor.remote.get_authorities().items() if v.v3ident)
+		_dirAuths = dict((k.lower(), v) for (k, v) in stem.directory.Authority.from_cache().items() if v.v3ident)
 	return _dirAuths
 
 _bwAuths = None
@@ -27,7 +28,7 @@ def get_bwauths():
 	global config
 	global _bwAuths
 	if _bwAuths == None:
-		_bwAuths = dict((k.lower(), v) for (k, v) in stem.descriptor.remote.get_authorities().items() if v.nickname.lower() in config['bwauths'])
+		_bwAuths = dict((k.lower(), v) for (k, v) in stem.directory.Authority.from_cache().items() if v.nickname.lower() in config['bwauths'])
 	return _bwAuths
 
 # How to grab a vote or consensus with stem:
@@ -73,7 +74,7 @@ def _get_documents(label, resource):
 
 		query = downloader.query(
 			resource,
-			endpoints = [(authority.address, authority.dir_port)],
+			endpoints = [stem.DirPort(authority.address, authority.dir_port)],
 			default_params = False,
 			start = False
 		)
diff --git a/website.py b/website.py
index 6637773..dd9198e 100755
--- a/website.py
+++ b/website.py
@@ -337,7 +337,7 @@ class WebsiteWriter:
 				#The above structure is sufficient for getting the address & port
 				# but we need this structure for the authority's fingerprint
 				authority = [d for d in self.consensus.directory_authorities if d.nickname.lower() == dirauth_nickname][0]
-				if authority.fingerprint in signingFPs:
+				if authority.v3ident in signingFPs:
 					self.site.write("    <td></td>\n")
 				elif authority.nickname.lower() in self.consensuses:
 					self.site.write("    <td class=\"oiv\">Missing Signature! "
diff --git a/write_website.py b/write_website.py
index 6ca9d3c..b496796 100755
--- a/write_website.py
+++ b/write_website.py
@@ -20,8 +20,8 @@ import stem.descriptor.remote
 import stem.util.conf
 import stem.util.enum
 
-from stem.descriptor.remote import FallbackDirectory
-from stem.descriptor.remote import DirectoryAuthority
+from stem.directory import Fallback
+from stem.directory import Authority
 
 from utility import *
 from website import WebsiteWriter
@@ -35,7 +35,7 @@ from graphs import GraphWriter
 #Also make sure to define the list of bwauths in the consensus.cfg file
 
 #stem.directory.DIRECTORY_AUTHORITIES = {
-#'Faravahar': DirectoryAuthority(
+#'Faravahar': Authority(
 #    nickname = 'Faravahar',
 #    address = '154.35.175.225',
 #    or_port = 443,
@@ -72,7 +72,7 @@ def main():
 
 	# Calculate the fallback directory info
 	if not CONFIG['ignore_fallback_authorities']:
-		fallback_dirs = stem.descriptor.remote.FallbackDirectory.from_remote()
+		fallback_dirs = Fallback.from_remote()
 	else:
 		fallback_dirs = []
 	



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