| skipped 597 lines |
598 | 598 | | except Exception as e: |
599 | 599 | | if self.debug: print('.current_url exception:\n{}'.format(e)) |
600 | 600 | | if self.debug: |
601 | | - | print("'{}': {:d} links added, {:d} total, {:d} bits domain entropy".format(current_url,k,self.link_count(),int(np.round(self.domain_entropy())))) |
| 601 | + | print("'{}': {:d} links added, {:d} total, {:.1f} bits domain entropy".format(current_url,k,self.link_count(),self.domain_entropy())) |
602 | 602 | | elif self.verbose: |
603 | 603 | | self.print_progress(k,current_url) |
604 | 604 | | |
605 | 605 | | def print_progress(self,num_links,url,terminal_width=80): |
606 | 606 | | # truncate or fill with white space |
607 | | - | text_suffix = ': {:d} links added, {:d} total'.format(num_links,self.link_count()) |
| 607 | + | text_suffix = ': +{:d} of {:d} links, H(domain) = {:.1f} b'.format(num_links,self.link_count(),self.domain_entropy()) |
608 | 608 | | chars_used = 2 + len(text_suffix) |
609 | 609 | | if len(url) + chars_used > terminal_width: |
610 | 610 | | url = url[:terminal_width-chars_used-1] + '…' |
| skipped 72 lines |