From 2ebb12a2b712afd81dbcbb9491d29441039abab6 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 15 Oct 2010 03:20:38 -0400 Subject: [PATCH] Name changes and documentation. --- freshmeat-submit | 14 ++++++-------- freshmeat-submit.xml | 16 ++++++++-------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/freshmeat-submit b/freshmeat-submit index 98a9fde..e891f40 100755 --- a/freshmeat-submit +++ b/freshmeat-submit @@ -66,8 +66,6 @@ class FreshmeatSession: content = json.loads(handle.read()) content = content['project'] self.permalink = content['permalink'] - if self.verbose: - print "Permalink:", self.permalink def issue_wrapped_request(self, url, request): "Wrap a JSON object with the auth code and ship it as a POST request" @@ -78,10 +76,10 @@ class FreshmeatSession: headers = {"Content-Type" : "application/json"} if self.verbose: print "Request URL:", url + #if self.verbose: + # print "Request headers:", headers if self.verbose: print "Request data:", data - if self.verbose: - print "Request headers:", headers if self.emit_enable: handle = urllib2.urlopen(urllib2.Request(url=url, data=data, headers=headers)) if self.verbose: @@ -207,7 +205,7 @@ class FreshmeatMetadataFactory: self.argument_parser.add_option('-n', '--no-stdin', dest='read', default=True, action='store_false', help='Suppress reading fields from stdin.') - self.argument_parser.add_option('-N', '--noemit', dest='noemit', + self.argument_parser.add_option('-N', '--dryrun', dest='dryrun', default=False, action='store_true', help='Suppress reading fields from stdin.') self.argument_parser.add_option('-V', '--verbose', dest='verbose', @@ -247,7 +245,7 @@ class FreshmeatMetadataFactory: raise FreshmeatSessionException("Version conflict on stdin.") # Merge in options from the command line; # they override what's on stdin. - controls = ('read', 'delete', 'no-stdin', 'noemit', 'verbose') + controls = ('read', 'delete', 'no-stdin', 'dryrun', 'verbose') prior_version = data.get("version") for (key, value) in options.__dict__.items(): if key not in controls and value != None: @@ -299,10 +297,10 @@ if __name__ == "__main__": # Some switches shouldn't be passed to the server verbose = 'verbose' in options.__dict__ and options.verbose delete = 'delete' in options.__dict__ and options.delete - noemit = 'noemit' in options.__dict__ and options.noemit + dryrun = 'dryrun' in options.__dict__ and options.dryrun # Time to ship the update. # Establish session - session = FreshmeatSession(verbose=int(verbose), emit_enable=not noemit) + session = FreshmeatSession(verbose=int(verbose), emit_enable=not dryrun) session.on_project(update.name) # OK, now actually add or delete the release. if update.per_release: diff --git a/freshmeat-submit.xml b/freshmeat-submit.xml index fbe53e3..285e789 100644 --- a/freshmeat-submit.xml +++ b/freshmeat-submit.xml @@ -46,7 +46,7 @@ freshmeat database via its API. --d +-d, --delete Delete the specified release rather than submitting it. With this option, all data other than Project and Release are @@ -56,20 +56,20 @@ this mode will throw an error. --n +-n, --no-stdin Process command-line options only; don't read data from standard input. --N +-N, --dryrun Dump the generated JSON, but don't ship it. to Freshmeat. --V +-V, --verbose Enable verbose debugging of the transaction. This option is mainly for developers. @@ -227,10 +227,10 @@ release will not be visible on the project page. -The License-List and all URL fields, when specified, actually change -the record for the project. Only the Tag-List, Changes, Version, -Release-Focus, and Hide fields are actually stored for each -version. +The Summary, Description, License-List, Project-Tag-List and all +URL fields, when specified, actually change the record for the +project. Only the Tag-List, Changes, Version, Release-Focus, and Hide +fields are actually stored for each version. Here are the release-focus types. Either the string or the integer is acceptable. Case of the string is significant. -- 2.43.0