Commit e737c009 authored by Boryslav Larin's avatar Boryslav Larin
Browse files

Fixed flake8 E241

parent ee48f4af
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -6,9 +6,11 @@ from django.utils.six.moves.urllib.request import urlopen

PING_URL = "http://www.google.com/webmasters/tools/ping"


class SitemapNotFound(Exception):
    pass


def ping_google(sitemap_url=None, ping_url=PING_URL):
    """
    Alerts Google that the sitemap for the current site has been updated.
@@ -35,6 +37,7 @@ def ping_google(sitemap_url=None, ping_url=PING_URL):
    params = urlencode({'sitemap': url})
    urlopen("%s?%s" % (ping_url, params))


class Sitemap(object):
    # This limit is defined by Google. See the index documentation at
    # http://sitemaps.org/protocol.php#index.
@@ -105,11 +108,13 @@ class Sitemap(object):
            self.latest_lastmod = latest_lastmod
        return urls


class FlatPageSitemap(Sitemap):
    def items(self):
        current_site = Site.objects.get_current()
        return current_site.flatpage_set.filter(registration_required=False)


class GenericSitemap(Sitemap):
    priority = None
    changefreq = None
+3 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ __all__ = ('SelectDateWidget',)

RE_DATE = re.compile(r'(\d{4})-(\d\d?)-(\d\d?)$')


def _parse_date_fmt():
    fmt = get_format('DATE_FORMAT')
    escaped = False
@@ -39,6 +40,7 @@ def _parse_date_fmt():
            #if not self.first_select: self.first_select = 'day'
    return output


class SelectDateWidget(Widget):
    """
    A Widget that splits date input into three <select> boxes.
+42 −40
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
# Originally from https://bitbucket.org/ned/jslex
import re


class Tok(object):
    """
    A specification for a token class.
@@ -15,6 +16,7 @@ class Tok(object):
        self.regex = regex
        self.next = next


def literals(choices, prefix="", suffix=""):
    """
    Create a regex from a space-separated list of literal `choices`.
+48 −45
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ background = dict((color_names[x], '4%s' % x) for x in range(8))
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink': '5', 'reverse': '7', 'conceal': '8'}


def colorize(text='', opts=(), **kwargs):
    """
    Returns your text, enclosed in ANSI graphics codes.
@@ -55,6 +56,7 @@ def colorize(text='', opts=(), **kwargs):
        text = '%s\x1b[%sm' % (text or '', RESET)
    return '%s%s' % (('\x1b[%sm' % ';'.join(code_list)), text or '')


def make_style(opts=(), **kwargs):
    """
    Returns a function with default parameters for colorize()
@@ -132,6 +134,7 @@ PALETTES = {
}
DEFAULT_PALETTE = DARK_PALETTE


def parse_color_setting(config_string):
    """Parse a DJANGO_COLORS environment variable to produce the system palette

+25 −24
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ from sphinx.util.nodes import set_source_info
simple_option_desc_re = re.compile(
    r'([-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)')


def setup(app):
    app.add_crossref_type(
        directivename="setting",
Loading