1
0
mirror of https://github.com/donnemartin/system-design-primer.git synced 2025-06-12 21:47:33 +02:00

Convert all .py files to be valid Python (#98)

This commit is contained in:
cclauss
2018-03-07 01:37:46 +01:00
committed by Donne Martin
parent 3ca1f1d0d2
commit f099a0ad3f
7 changed files with 78 additions and 39 deletions

View File

@ -2,33 +2,33 @@
class PagesDataStore(object):
def __init__(self, db);
def __init__(self, db):
self.db = db
...
pass
def add_link_to_crawl(self, url):
"""Add the given link to `links_to_crawl`."""
...
pass
def remove_link_to_crawl(self, url):
"""Remove the given link from `links_to_crawl`."""
...
pass
def reduce_priority_link_to_crawl(self, url)
def reduce_priority_link_to_crawl(self, url):
"""Reduce the priority of a link in `links_to_crawl` to avoid cycles."""
...
pass
def extract_max_priority_page(self):
"""Return the highest priority link in `links_to_crawl`."""
...
pass
def insert_crawled_link(self, url, signature):
"""Add the given link to `crawled_links`."""
...
pass
def crawled_similar(self, signature):
"""Determine if we've already crawled a page matching the given signature"""
...
pass
class Page(object):
@ -41,7 +41,7 @@ class Page(object):
def create_signature(self):
# Create signature based on url and contents
...
pass
class Crawler(object):