fix PEP8 "E302 expected 2 blank lines, found 1"

This commit is contained in:
Hans-Christoph Steiner 2014-05-01 23:39:33 -04:00
parent 2f2618e06c
commit 3f4f7a544b
16 changed files with 84 additions and 0 deletions

View file

@ -23,6 +23,7 @@ import glob
import cgi
import logging
class MetaDataException(Exception):
def __init__(self, value):
self.value = value
@ -183,6 +184,7 @@ valuetypes = {
[])
}
# Check an app's metadata information for integrity errors
def check_metadata(info):
for k, t in valuetypes.iteritems():
@ -200,6 +202,7 @@ def check_metadata(info):
elif k == 'bool':
build[attr] = False
# Formatter for descriptions. Create an instance, and call parseline() with
# each line of the description source from the metadata. At the end, call
# end() and then text_plain, text_wiki and text_html will contain the result.
@ -344,6 +347,7 @@ class DescriptionFormatter:
def end(self):
self.endcur()
# Parse multiple lines of description as written in a metadata file, returning
# a single string in plain text format.
def description_plain(lines, linkres):
@ -353,6 +357,7 @@ def description_plain(lines, linkres):
ps.end()
return ps.text_plain
# Parse multiple lines of description as written in a metadata file, returning
# a single string in wiki format. Used for the Maintainer Notes field as well,
# because it's the same format.
@ -363,6 +368,7 @@ def description_wiki(lines):
ps.end()
return ps.text_wiki
# Parse multiple lines of description as written in a metadata file, returning
# a single string in HTML format.
def description_html(lines, linkres):
@ -372,6 +378,7 @@ def description_html(lines, linkres):
ps.end()
return ps.text_html
def parse_srclib(metafile, **kw):
thisinfo = {}
@ -407,6 +414,7 @@ def parse_srclib(metafile, **kw):
return thisinfo
# Read all metadata. Returns a list of 'app' objects (which are dictionaries as
# returned by the parse_metadata function.
def read_metadata(xref=True, package=None, store=True):
@ -439,6 +447,7 @@ def read_metadata(xref=True, package=None, store=True):
return apps
# Get the type expected for a given metadata field.
def metafieldtype(name):
if name in ['Description', 'Maintainer Notes']:
@ -455,6 +464,7 @@ def metafieldtype(name):
return 'unknown'
return 'string'
def flagtype(name):
if name in ['extlibs', 'srclibs', 'patch', 'rm', 'buildjni',
'update', 'scanignore', 'scandelete']:
@ -463,6 +473,7 @@ def flagtype(name):
return 'script'
return 'string'
# Parse metadata for a single application.
#
# 'metafile' - the filename to read. The package id for the application comes
@ -689,6 +700,7 @@ def parse_metadata(metafile):
return thisinfo
# Write a metadata file.
#
# 'dest' - The path to the output file