fixed closeness calculation
This commit is contained in:
		
							parent
							
								
									57ec04eff5
								
							
						
					
					
						commit
						4a831a4a4d
					
				
					 3 changed files with 46 additions and 20 deletions
				
			
		
							
								
								
									
										21
									
								
								scripts/closeness-calculator.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								scripts/closeness-calculator.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,21 @@ | |||
| import sys | ||||
| import os | ||||
| import subprocess | ||||
| import base64 | ||||
| if not os.path.exists('onionr.sh'): | ||||
|     os.chdir('../') | ||||
| sys.path.append("src/") | ||||
| from streamfill import identify_neighbors | ||||
| 
 | ||||
| onions = [] | ||||
| p = subprocess.Popen(["scripts/generate-onions.py", '5'], | ||||
|                         stdout=subprocess.PIPE, | ||||
|                         stderr=subprocess.PIPE) | ||||
| for line in iter(p.stdout.readline, b''): | ||||
|     line = line.decode() | ||||
|     onions.append(line.strip()) | ||||
| 
 | ||||
| 
 | ||||
| for onion in onions: | ||||
|     print(onion, identify_neighbors(onion, onions, 3)) | ||||
| 
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue