# HG changeset patch # User Paul Boddie # Date 1407688880 -7200 # Node ID 23418e7bc79149a2d5c997fca6e21f74c96d3576 # Parent 8608b8370a2a5f99c8972e3cac939168fc1d9079 Changed the get_profile code to not return any profile information when no profile page can be retrieved. diff -r 8608b8370a2a -r 23418e7bc791 tools/get_profile.py --- a/tools/get_profile.py Sun Aug 10 17:05:09 2014 +0200 +++ b/tools/get_profile.py Sun Aug 10 18:41:20 2014 +0200 @@ -25,7 +25,7 @@ return [username, fullname, email, image and basejoin(url, image) or ""] except libxml2dom.LSException: - return [username, "", username, ""] + return None def main(): progname = split(sys.argv[0])[-1] @@ -41,7 +41,8 @@ stdout = codecs.getwriter("utf-8")(sys.stdout) details = get_profile(url, username) - print >>stdout, "\t".join(details) + if details: + print >>stdout, "\t".join(details) if __name__ == "__main__": main() diff -r 8608b8370a2a -r 23418e7bc791 tools/get_profiles.py --- a/tools/get_profiles.py Sun Aug 10 17:05:09 2014 +0200 +++ b/tools/get_profiles.py Sun Aug 10 18:41:20 2014 +0200 @@ -36,7 +36,9 @@ line = sys.stdin.readline() while line: username = line.strip() - print >>stdout, "\t".join(get_profile(url, username)) + details = get_profile(url, username) + if details: + print >>stdout, "\t".join(details) sleep(delay) line = sys.stdin.readline()