Created by Will Moggridge and last modified
Get this branch:
bzr branch lp:~willmoggridge/usn-tool/sanitizehtml
Only Will Moggridge can upload to this branch. If you are Will Moggridge please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Will Moggridge
USN Tool

Recent revisions

126. By Will Moggridge

Update markdown sanitization

125. By Steve Beattie

usn.py: add reference to problematic USN for future testing

124. By Steve Beattie

usn.py: add gross hack to not encode template output on old python

When LANG=C is set, modern python 2.7+genshi will fail if the output is
not encoded as utf-8. On old python, it fails if it is encoded
regardless of LANG setting. So add a gross hack that skips encoding if
the python version is older than 2.7.6 (trusty's python).

123. By Steve Beattie

usn.py: coding style cleanups, use with statements

122. By Steve Beattie

usn.py: don't encode genshi's render_template as utf-8, causes failure on 12.04

Calling encode('utf-8') on the generated output from render_template()
fails on Ubuntu 12.04 due to either age of genshi or python, resulting
in utf-8 text breaking the generating and sending of USN emails.
This commit removes the call to encode('utf-8').

121. By Tyler Hicks

usn.py, templates/webpage-markdown.txt: Deduce LP links from source packages

Special care must be taken when building the links from a given binary
package to its source package and source package version on Launchpad
since the USN database has no direct mapping between binary packages and
source packages. This commit injects reasonable guesses, when possible,
at what the corresponding source package and source package version
links are for each binary package in a USN. If reasonable guesses can't
be made, no link is created.

For ESM releases, no links are created since the source package version
links will be dead. The source package links wouldn't be dead but
the pages would have outdated information describing what's in the
regular archive rather than what's in the ESM archive.

120. By Tyler Hicks

templates/webpage-markdown.txt: Don't mention the timezone in the date string

119. By Tyler Hicks

usn.py, templates/webpage-markdown.txt: Force UTC timestamps

118. By Tyler Hicks

usn.py: Allow for all USNs to be ran through a template

If no USN is specified when using the --template option, this patch
makes it so that all USNs in the database are ran through the template.
That change isn't useful on its own because running all USNs through a
template and writing the result to stdout makes it difficult to split
each USN description apart. Therefore, the --output-dir and --output-ext
options are added so that they can be used with --template. The
--output-dir option specifies a directory to write individual, template
generated USN files to. By default, the filenames will be the USN
number. An example is "2561-1". If the --output-ext option is specified,
the value passed with be appended to the filename with a '.' stuck in
the middle. For example, --output-ext=md would result in filenames such
as "2561-1.md".

117. By Tyler Hicks

templates/webpage-markdown.txt: Use the USN title for the page title

Branch metadata

Branch format:
Branch format 6
Repository format:
Bazaar pack repository format 1 (needs bzr 0.92)
This branch contains Public information 
Everyone can see this information.