From: Eric S. Raymond Date: Sun, 21 Nov 2010 19:38:53 +0000 (-0500) Subject: Add a pychecker check and fix what it revealed. X-Git-Tag: 2.2~11 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=eee5e93bae66a64550022d3366ad5105e04c3090;p=freecode-submit.git Add a pychecker check and fix what it revealed. --- diff --git a/Makefile b/Makefile index b352399..5f7f0a6 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,14 @@ freshmeat-submit-$(VERS).tar.gz: $(SOURCES) freshmeat-submit.1 (cd ..; tar -czf freshmeat-submit/freshmeat-submit-$(VERS).tar.gz `cat freshmeat-submit/MANIFEST`) (cd ..; rm freshmeat-submit-$(VERS)) +pychecker: + @echo "Expect: Object (data) has no attribute (update)" + @ln -f freshmeat-submit freshmeat-submit.py + @-pychecker --only --limit 50 freshmeat-submit.py + @rm -f freshmeat-submit.py + clean: - rm -f *.html freshmeat-submit.1 MANIFEST ChangeLog SHIPPER.* *~ + rm -f *.pyc *.html freshmeat-submit.1 MANIFEST ChangeLog SHIPPER.* *~ dist: freshmeat-submit-$(VERS).tar.gz diff --git a/freshmeat-submit b/freshmeat-submit index 10fccc8..bf7440b 100755 --- a/freshmeat-submit +++ b/freshmeat-submit @@ -2,7 +2,7 @@ # # freshmeat-submit -- script transactions with the Freshmeat server -import sys, re, urllib2, json, netrc, email.Parser, optparse, commands +import sys, re, urllib2, json, netrc, email.Parser, optparse class Update: "Encapsulate dictionaries describing a project metadata update." @@ -38,7 +38,7 @@ class RequestWithMethod(urllib2.Request): else: return "GET" -class FreshmeatSessionException: +class FreshmeatSessionException(Exception): def __init__(self, msg): self.msg = msg