From: Eric S. Raymond Date: Fri, 15 Oct 2010 08:33:24 +0000 (-0400) Subject: Make the tool canonicalize wrapped lines in input from stdin. X-Git-Tag: 2.0~22 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=c78319d6e880730f5beffa3b85fb8f99318cbbf1;p=freecode-submit.git Make the tool canonicalize wrapped lines in input from stdin. --- diff --git a/TEST b/TEST index e37e275..05396bf 100644 --- a/TEST +++ b/TEST @@ -1,4 +1,7 @@ Project: freshmeat-submit +Description: freshmeat-submit is a tool to submit version updates to + freshmeat.net. It is designed to run from within a project release + script or makefile production, and uses freshmeat.net's JSON API. Version: 1.7 Release-Focus: Major feature enhancements Hide: Y diff --git a/freshmeat-submit b/freshmeat-submit index 636ab0d..dfab247 100755 --- a/freshmeat-submit +++ b/freshmeat-submit @@ -2,7 +2,7 @@ # # freshmeat-submit -- script transactions with the Freshmeat server -import sys +import sys, re def error(m): sys.stderr.write("freshmeat-submit: %s\n" % m) @@ -106,7 +106,7 @@ class FreshmeatSession: if self.verbose: print "Core data update for %s is: %s" % (self.project, coredata) self.edit_request("projects/" + self.permalink + ".json", - {"project": data}) + {"project": coredata}) def update_urls(self, urlassoc): "Update URL list for a project." @@ -117,8 +117,6 @@ class FreshmeatSession: % (self.permalink, self.auth) handle = urllib2.urlopen(query) content = json.loads(handle.read()) - if self.verbose: - print "Returned URL list:", content permadict = {} for item in content: inner = item['url'] @@ -256,6 +254,7 @@ class FreshmeatMetadataFactory: if options.read: message = self.message_parser.parse(stream) for (key, value) in message.items(): + value = re.sub("\n +", " ", value) if key.endswith("-URL"): urls.update({key[:-4] : value}) else: