#441 Make black happy.
Merged 3 years ago by lsedlar. Opened 3 years ago by jkaluza.
jkaluza/odcs black  into  master

file modified
+5 -2
@@ -354,11 +354,14 @@ 

              raise

  

      client = odcs.client.odcs.ODCS(

-         odcs_url, auth_mech=odcs.client.odcs.AuthMech.OpenIDC, openidc_token=token,

+         odcs_url,

+         auth_mech=odcs.client.odcs.AuthMech.OpenIDC,

+         openidc_token=token,

      )

  else:

      client = odcs.client.odcs.ODCS(

-         odcs_url, auth_mech=odcs.client.odcs.AuthMech.Kerberos,

+         odcs_url,

+         auth_mech=odcs.client.odcs.AuthMech.Kerberos,

      )

  

  request_args = {}

@@ -13,7 +13,7 @@ 

  

  

  class ComposeCheckError(Exception):

-     """"

+     """ "

      Raised when compose check fails.

      """

  

@@ -172,9 +172,12 @@ 

          "Time spent for generating compose (%s): %ss"

          % (compose["id"], spent_time.total_seconds())

      )

-     assert spent_time <= threshold, (

-         "Spent time (%ss) over threshold (%s) for generating compose %s."

-         % (spent_time.total_seconds(), time_threshold, compose["id"])

+     assert (

+         spent_time <= threshold

+     ), "Spent time (%ss) over threshold (%s) for generating compose %s." % (

+         spent_time.total_seconds(),

+         time_threshold,

+         compose["id"],

      )

  

  
@@ -427,7 +430,9 @@ 

          sys.exit(2)

  

      client = odcs.client.odcs.ODCS(

-         odcs_api_url, auth_mech=auth_mech, openidc_token=token,

+         odcs_api_url,

+         auth_mech=auth_mech,

+         openidc_token=token,

      )

  

      if profile == "redhat":

file modified
+4 -8
@@ -90,8 +90,7 @@ 

  @console_script_help

  @manager.command

  def upgradedb():

-     """ Upgrades the database schema to the latest revision

-     """

+     """Upgrades the database schema to the latest revision"""

      app.config["SERVER_NAME"] = "localhost"

      migrations_dir = os.path.join(

          os.path.abspath(os.path.dirname(__file__)), "migrations"
@@ -103,8 +102,7 @@ 

  @console_script_help

  @manager.command

  def cleardb():

-     """ Clears the database

-     """

+     """Clears the database"""

      models.Event.query.delete()

      models.ArtifactBuild.query.delete()

      db.session.commit()
@@ -113,8 +111,7 @@ 

  @manager.command

  @console_script_help

  def generatelocalhostcert():

-     """ Creates a public/private key pair for message signing and the frontend

-     """

+     """Creates a public/private key pair for message signing and the frontend"""

      from OpenSSL import crypto

  

      cert_key = crypto.PKey()
@@ -152,8 +149,7 @@ 

  @console_script_help

  @manager.command

  def runssl(host=conf.host, port=conf.port, debug=conf.debug):

-     """ Runs the Flask app with the HTTPS settings configured in config.py

-     """

+     """Runs the Flask app with the HTTPS settings configured in config.py"""

      logging.info("Starting ODCS frontend")

  

      ssl_ctx = _establish_ssl_context()

file modified
+4 -4
@@ -105,7 +105,7 @@ 

              return conf.seconds_to_live

  

      def get(self, id):

-         """ Returns ODCS composes.

+         """Returns ODCS composes.

  

          If ``id`` is set, only the ODCS compose defined by that ID is

          returned.
@@ -150,7 +150,7 @@ 

      @require_scopes("renew-compose")

      @requires_role("allowed_clients")

      def patch(self, id):

-         """ Extends the compose expiration time or regenerates expired compose.

+         """Extends the compose expiration time or regenerates expired compose.

  

          :query number id: :ref:`ID<id>` of the compose to update/regenerate.

          :jsonparam number seconds_to_live: Number of seconds before the compoose expires.
@@ -259,7 +259,7 @@ 

      @require_scopes("new-compose")

      @requires_role("allowed_clients")

      def post(self):

-         """ Creates new ODCS compose request.

+         """Creates new ODCS compose request.

  

          :jsonparam number seconds_to_live: Number of seconds before the compoose expires.

          :jsonparam list flags: List of :ref:`compose flags<flags>` defined as strings.
@@ -583,7 +583,7 @@ 

  

  class AboutAPI(MethodView):

      def get(self):

-         """ Returns information about this ODCS instance in JSON format.

+         """Returns information about this ODCS instance in JSON format.

  

          :resjson string version: The ODCS server version.

          :resjson string auth_backend: The name of authorization backend this

file modified
+2 -1
@@ -1291,7 +1291,8 @@ 

              )

              data = json.loads(rv.get_data(as_text=True))

              self.assertEqual(

-                 data["parent_pungi_compose_ids"], "Fedora-1-1 Fedora-2-2",

+                 data["parent_pungi_compose_ids"],

+                 "Fedora-1-1 Fedora-2-2",

              )

  

      def test_query_compose(self):