Add missing docstrings.

This commit is contained in:
Bastian Kleineidam 2013-01-09 22:26:00 +01:00
parent 5479627d86
commit fd8949b8b7
7 changed files with 12 additions and 0 deletions

View file

@ -103,6 +103,7 @@ doccheck:
py-check-docstrings --force \
dosagelib/*.py \
dosage \
scripts \
*.py
pyflakes:

View file

@ -74,6 +74,7 @@ def get_results():
def has_creators_comic(name):
"""Test if comic name already exists."""
cname = "Creators/%s" % name
for scraperclass in get_scrapers():
lname = scraperclass.get_name().lower()

View file

@ -401,6 +401,7 @@ def get_results():
def has_comic(name):
"""Check if comic name already exists."""
cname = ("Creators/%s" % name).lower()
gname = ("GoComics/%s" % name).lower()
for scraperclass in get_scrapers():

View file

@ -45,10 +45,12 @@ def get_mtime (filename):
def strdate(t):
"""Get formatted date string."""
return time.strftime("%d.%m.%Y", time.localtime(t))
def get_test_name(line):
"""Get scraper name from test output line."""
classname = line.split('::')[1][4:]
for scraper in get_scrapers():
if scraper.__name__ == classname:
@ -61,12 +63,14 @@ def get_test_name(line):
def get_test(line):
"""Get test name from test output line."""
name, url = get_test_name(line)
result = "OK" if line.startswith(". ") else "FAILED"
return [name, url, result, ""]
def get_content(filename):
"""Get HTML content for test output."""
tests = []
with open(filename, "r") as f:
print("Tests parsed: 0", end=" ", file=sys.stderr)
@ -103,10 +107,12 @@ def get_content(filename):
def quote_all(*args):
"""CGI-escape all arguments for."""
return tuple(cgi.escape(x, quote=True) for x in args)
def main(args):
"""Generate HTML output for test result."""
filename = args[0]
modified = get_mtime(filename)
content = get_content(filename)

View file

@ -7,6 +7,7 @@ import fileinput
import sys
def main(args):
"""Remove lines after marker."""
filename = args[0]
marker = args[1]
for line in fileinput.input(filename, inplace=1):

View file

@ -284,6 +284,7 @@ def get_results():
def has_comic(name):
"""Check if comic name already exists."""
cname = name.lower()
for scraperclass in get_scrapers():
lname = scraperclass.get_name().lower()

View file

@ -68,6 +68,7 @@ def get_results():
def has_comic(name):
"""Check if comic name already exists."""
cname = ("Creators/%s" % name).lower()
gname = ("GoComics/%s" % name).lower()
for scraperclass in get_scrapers():