3333class ExporterNameError (NameError ):
3434 """An exporter name error."""
3535
36- pass
37-
3836
3937class ExporterDisabledError (ValueError ):
4038 """An exporter disabled error."""
4139
42- pass
43-
4440
4541def export (exporter , nb , ** kw ):
4642 """
@@ -74,7 +70,7 @@ def export(exporter, nb, **kw):
7470 if exporter is None :
7571 msg = "Exporter is None"
7672 raise TypeError (msg )
77- elif not isinstance (exporter , Exporter ) and not issubclass (exporter , Exporter ):
73+ if not isinstance (exporter , Exporter ) and not issubclass (exporter , Exporter ):
7874 msg = "exporter does not inherit from Exporter (base)"
7975 raise TypeError (msg )
8076 if nb is None :
@@ -95,7 +91,7 @@ def export(exporter, nb, **kw):
9591 return output , resources
9692
9793
98- def get_exporter (name , config = get_config ()): # noqa
94+ def get_exporter (name , config = get_config ()): # noqa: B008
9995 """Given an exporter name or import path, return a class ready to be instantiated
10096
10197 Raises ExporterName if exporter is not found or ExporterDisabledError if not enabled
@@ -110,8 +106,7 @@ def get_exporter(name, config=get_config()): # noqa
110106 exporter = items [0 ].load ()
111107 if getattr (exporter (config = config ), "enabled" , True ):
112108 return exporter
113- else :
114- raise ExporterDisabledError ('Exporter "%s" disabled in configuration' % (name ))
109+ raise ExporterDisabledError ('Exporter "%s" disabled in configuration' % (name ))
115110 except IndexError :
116111 pass
117112
@@ -120,19 +115,18 @@ def get_exporter(name, config=get_config()): # noqa
120115 exporter = import_item (name )
121116 if getattr (exporter (config = config ), "enabled" , True ):
122117 return exporter
123- else :
124- raise ExporterDisabledError ('Exporter "%s" disabled in configuration' % (name ))
118+ raise ExporterDisabledError ('Exporter "%s" disabled in configuration' % (name ))
125119 except ImportError :
126120 log = get_logger ()
127- log .error ("Error importing %s" % name , exc_info = True )
121+ log .error ("Error importing %s" , name , exc_info = True ) # noqa: G201
128122
129123 msg = 'Unknown exporter "{}", did you mean one of: {}?' .format (
130124 name , ", " .join (get_export_names ())
131125 )
132126 raise ExporterNameError (msg )
133127
134128
135- def get_export_names (config = get_config ()): # noqa
129+ def get_export_names (config = get_config ()): # noqa: B008
136130 """Return a list of the currently supported export targets
137131
138132 Exporters can be found in external packages by registering
0 commit comments