CDLUC3 / ezid

CDLUC3 ezid
MIT License
10 stars 4 forks source link

Fix format has unused arguments error #758

Open jsjiang opened 1 month ago

jsjiang commented 1 month ago

Flake8 reported F523 '...'.format(...) has unused arguments errors in api.py and nog_sql/ezid_minter.py:

ezid/impl/api.py:185:25: F523 '...'.format(...) has unused arguments at position(s): 0 ezid/impl/nog_sql/ezid_minter.py:319:29: F523 '...'.format(...) has unused arguments at position(s): 1

api.py

def _validateOptions(request, options):
...

                if not found:
                    return (
                        "error: bad request - invalid value for URL query parameter "
                        "'%s'".format(k)
                    )
       else:
            return "error: bad request - unrecognized URL query parameter '%s'" % impl.util.oneLine(
                # has the effect of XML encoding non-ascii chars
                k.encode("ASCII", "xmlcharrefreplace").decode()
            )
    return d

ezid_minter.py

def create(self, shoulder_str, mask_str='eedk'):
        """Set minter to initial, unused state."""

        self.template_str = '{}{{}}'.format(shoulder_str, mask_str)
        self.mask_str = mask_str