Commit cce42d4c authored by Alex Gaynor's avatar Alex Gaynor
Browse files

Merge pull request #1762 from alasdairnicol/ticket_21270

Fixed #21270 -- Fixed E701 pep8 warnings
parents 650b6fd9 eb214452
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -198,8 +198,10 @@ class ChangeList(six.with_metaclass(RenameChangeListMethods)):
            six.reraise(IncorrectLookupParameters, IncorrectLookupParameters(e), sys.exc_info()[2])

    def get_query_string(self, new_params=None, remove=None):
        if new_params is None: new_params = {}
        if remove is None: remove = []
        if new_params is None:
            new_params = {}
        if remove is None:
            remove = []
        p = self.params.copy()
        for r in remove:
            for k in list(p):
+8 −4
Original line number Diff line number Diff line
@@ -94,15 +94,19 @@ ROLES = {

def create_reference_role(rolename, urlbase):
    def _role(name, rawtext, text, lineno, inliner, options=None, content=None):
        if options is None: options = {}
        if content is None: content = []
        if options is None:
            options = {}
        if content is None:
            content = []
        node = docutils.nodes.reference(rawtext, text, refuri=(urlbase % (inliner.document.settings.link_base, text.lower())), **options)
        return [node], []
    docutils.parsers.rst.roles.register_canonical_role(rolename, _role)

def default_reference_role(name, rawtext, text, lineno, inliner, options=None, content=None):
    if options is None: options = {}
    if content is None: content = []
    if options is None:
        options = {}
    if content is None:
        content = []
    context = inliner.document.settings.default_reference_context
    node = docutils.nodes.reference(rawtext, text, refuri=(ROLES[context] % (inliner.document.settings.link_base, text.lower())), **options)
    return [node], []
+4 −2
Original line number Diff line number Diff line
@@ -70,8 +70,10 @@ class GeoModelAdmin(ModelAdmin):
        """
        is_collection = db_field.geom_type in ('MULTIPOINT', 'MULTILINESTRING', 'MULTIPOLYGON', 'GEOMETRYCOLLECTION')
        if is_collection:
            if db_field.geom_type == 'GEOMETRYCOLLECTION': collection_type = 'Any'
            else: collection_type = OGRGeomType(db_field.geom_type.replace('MULTI', ''))
            if db_field.geom_type == 'GEOMETRYCOLLECTION':
                collection_type = 'Any'
            else:
                collection_type = OGRGeomType(db_field.geom_type.replace('MULTI', ''))
        else:
            collection_type = 'None'

+2 −1
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@ class OpenLayersWidget(Textarea):
    """
    def render(self, name, value, attrs=None):
        # Update the template parameters with any attributes passed in.
        if attrs: self.params.update(attrs)
        if attrs:
            self.params.update(attrs)

        # Defaulting the WKT value to a blank string -- this
        # will be tested in the JavaScript and the appropriate
+4 −2
Original line number Diff line number Diff line
@@ -201,8 +201,10 @@ class SpatialRefSysMixin(object):
            return self.srs.ellipsoid
        else:
            m = self.spheroid_regex.match(self.wkt)
            if m: return (float(m.group('major')), float(m.group('flattening')))
            else: return None
            if m:
                return (float(m.group('major')), float(m.group('flattening')))
            else:
                return None

    @property
    def name(self):
Loading