Convert all .py files to be valid Python

`raise NotImplementedError('Please replace this line with your code...')` signals to the user where they need to put their code.

This approach enables the codebase to be tested with lint tools like flake8, pyflakes, pylint, etc.
This commit is contained in:
cclauss
2017-08-15 08:49:57 +02:00
parent b566126bab
commit 6b4b5ba3ee
7 changed files with 78 additions and 39 deletions

View File

@@ -61,3 +61,4 @@ class UserGraphService(object):
def bfs(self, source, dest):
# Use self.visited_ids to track visited nodes
# Use self.lookup to translate a person_id to a Person
pass

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):