From f9d8477c8faa13622acadf92d8bb9cc83f9b40dc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 23 Nov 2005 14:25:26 +0000 Subject: * add more licenses * deal with project without a license git-svn-id: file:///home/lennart/svn/public/sse/trunk@39 5fbabb74-0606-0410-a5e4-b5cc6a42724e --- feed/sse_fm.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'feed') diff --git a/feed/sse_fm.py b/feed/sse_fm.py index 467ed9f..45f6ce4 100755 --- a/feed/sse_fm.py +++ b/feed/sse_fm.py @@ -15,7 +15,8 @@ license_blacklist = [ "Shareware", "Other/Proprietary License with Source", "Other/Proprietary License", - "Aladdin Free Public License (AFPL)" + "Aladdin Free Public License (AFPL)", + "Free For Home Use" ] license_whitelist = [ @@ -39,13 +40,13 @@ license_whitelist = [ def process_record(meta): - archive_url = None - for k, v in meta.items(): meta[k] = v.strip() meta["id"] = int(meta["id"]) + archive_url = None + for a in ("archive-tgz-url", "archive-bz2-url", "archive-zip-url"): if meta.has_key(a) and meta[a] != "": @@ -56,6 +57,12 @@ def process_record(meta): print "Ignoring project '%s' without archive URL!" % meta["name"] return + meta["archive-url"] = archive_url + + if not meta.has_key("license"): + print "WARNING: Project '%s' has no license!" % meta["name"] + return + if meta["license"] in license_blacklist: print "Ignoring project '%s' due to evil license '%s'!" % (meta["name"], meta["license"]) return @@ -68,8 +75,6 @@ def process_record(meta): f.close() return - meta["archive-url"] = archive_url - print "Next record '%s'" % meta["name"] sse_grab.grab_archive(meta, "freshmeat:%i" % meta["id"], SSE_PROVIDER_FRESHMEAT) -- cgit