New manpage, fix typos

This commit is contained in:
Ryan Kavanagh 2008-08-27 11:21:36 -04:00
commit 41d0be35a7
5 changed files with 77 additions and 17 deletions

View File

@ -164,20 +164,20 @@ def _check_for_launchpad_cookie(cookie_file):
newLPCookieLocation = os.path.expanduser("~/.lpcookie.txt") newLPCookieLocation = os.path.expanduser("~/.lpcookie.txt")
# Open file for writing. # Open file for writing.
newLPCookie = open(newLPCookieLocation, 'w') try:
# For security reasons, change file mode to write and read newLPCookie = open(newLPCookieLocation, 'w')
# only by owner. # For security reasons, change file mode to write and read
os.chmod(newLPCookieLocation, 0600) # only by owner.
newLPCookie.write("# HTTP Cookie File.\n") # Header. os.chmod(newLPCookieLocation, 0600)
newLPCookie.write("# HTTP Cookie File for Launchpad.\n") # Header.
for item in items: for item in items:
# Write entries. # Write entries.
newLPCookie.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % ( newLPCookie.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (
item[0], ftstr[item[0].startswith('.')], item[1], item[0], ftstr[item[0].startswith('.')], item[1],
ftstr[item[2]], item[3], item[4], item[5])) ftstr[item[2]], item[3], item[4], item[5]))
finally:
newLPCookie.write("\n") # New line. newLPCookie.close() # And close file.
newLPCookie.close() # And close file.
return newLPCookieLocation return newLPCookieLocation
else: else:
@ -188,8 +188,16 @@ def _check_for_launchpad_cookie(cookie_file):
def setupLaunchpadUrlOpener(cookie): def setupLaunchpadUrlOpener(cookie):
""" Build HTML opener with cookie file. """ """ Build HTML opener with cookie file. """
cj = cookielib.MozillaCookieJar()
cj.load(cookie) # Attempt to load our cookie file.
try:
cj = cookielib.MozillaCookieJar()
cj.load(cookie)
except cookielib.LoadError, error:
print "Unable to load cookie file: %s (%s)" % (cookie, error)
sys.exit(1)
# Add cookie to our URL opener.
urlopener = urllib2.build_opener() urlopener = urllib2.build_opener()
urlopener.add_handler(urllib2.HTTPCookieProcessor(cj)) urlopener.add_handler(urllib2.HTTPCookieProcessor(cj))

15
debian/changelog vendored
View File

@ -1,3 +1,18 @@
ubuntu-dev-tools (0.43ubuntu1) intrepid; urgency=low
[Jonathan Patrick Davies]
* common.py:
- If loading a cookie file raises an exception exit.
- Improve cookie file writing.
[Ryan Kavanagh]
* dgetlp.1: New manpage
* dgetlp: fix typo in usage
* hugdaylist: New manpage
* s/requestsync/pull-lp-source/g in doc/pull-lp-source.1
-- Ryan Kavanagh <ryanakca@kubuntu.org> Wed, 27 Aug 2008 11:20:11 -0400
ubuntu-dev-tools (0.42ubuntu1) intrepid; urgency=low ubuntu-dev-tools (0.42ubuntu1) intrepid; urgency=low
[Jonathan Patrick Davies] [Jonathan Patrick Davies]

2
dgetlp
View File

@ -37,7 +37,7 @@ usage()
cat << EOF cat << EOF
Usage: $0 [-d] <Launchpad URL> Usage: $0 [-d] <Launchpad URL>
This scripts simulates «dget»'s behaviour for files hostead at This scripts simulates «dget»'s behaviour for files hosted at
launchpadlibrarian.net. launchpadlibrarian.net.
If you specify the -d option then it won't do anything, except download the If you specify the -d option then it won't do anything, except download the

37
doc/dgetlp.1 Normal file
View File

@ -0,0 +1,37 @@
.TH DGETLP "1" "27 August 2008" "ubuntu-dev-tools"
.SH NAME
dgetlp \- simulate ``dget'' behaviour for files hosted at
librarian.launchpad.net
.SH SYNOPSIS
.B dgetlp [-d] <\fBLaunchpad DSC URL\fR>
.SH DESCRIPTION
.PP
\fBdgetlp\fR downloads and optionally extracts the <\fBLaunchpad DSC URL\fR> from Launchpad.
.SH OPTIONS
.PP
Listed below are the command line options for dgetlp:
.TP
.B \-d
Download the .dsc file and display the commands that would be run otherwise.
.TP
.B <Launchpad DSC URL>
This is the source package that you would like to be downloaded from Launchpad.
.SH ENVIRONMENT VARIABLES
.TP
DIST
Specifies the default target.
.SH EXAMPLE
.B dgetlp http://launchpadlibrarian.net/10348157/coreutils_5.97-5.4ubuntu1.dsc
.SH AUTHOR
.PP
\fBdgetlp\fR was written written by Terence Simpson <tsimpson@ubuntu.com> and
modified by Siegfried-A. Gevatter <rainct@ubuntu.com>. This man page was written
by Ryan Kavanagh <ryanakca@kubuntu.org>. Both are released under the GNU General
Public License, version 2 or later.

View File

@ -15,7 +15,7 @@ will be downloaded instead.
.SH OPTIONS .SH OPTIONS
.PP .PP
Listed below are the command line options for requestsync: Listed below are the command line options for pull-lp-source:
.TP .TP
.B \-h, --help .B \-h, --help
Display a help message and exit. Display a help message and exit.