This is an automated email from the ASF dual-hosted git repository.

dill0wn pushed a commit to branch dw/8519
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/dw/8519 by this push:
     new 9e56f5cea [#8519] ran 'pyupgrade --py38-plus --keep-mock ./**/*.py'
9e56f5cea is described below

commit 9e56f5ceabe13459f2a9de4c25c479874a64daff
Author: Dillon Walls <[email protected]>
AuthorDate: Thu Sep 14 15:49:39 2023 -0400

    [#8519] ran 'pyupgrade --py38-plus --keep-mock ./**/*.py'
---
 scripts/ApacheAccessHandler.py |  6 +++---
 scripts/teamforge-import.py    | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/ApacheAccessHandler.py b/scripts/ApacheAccessHandler.py
index 63ed8431f..872a5be25 100644
--- a/scripts/ApacheAccessHandler.py
+++ b/scripts/ApacheAccessHandler.py
@@ -51,7 +51,7 @@ def load_requests_lib(req):
         try:
             exec(compile(open(activate_this, "rb").read(), activate_this, 
'exec'), {'__file__': activate_this})
         except Exception as e:
-            log(req, "Couldn't activate venv via {}: {}".format(activate_this, 
repr(e)))
+            log(req, f"Couldn't activate venv via {activate_this}: {repr(e)}")
     global requests
     import requests as requests_lib
     requests = requests_lib
@@ -66,7 +66,7 @@ def mangle(path):
     if len(parts) < 4:
         return None
     scm, nbhd, proj, rest = parts[0], parts[1], parts[2], parts[3:]
-    parts = ['/SCM/{}.{}'.format(proj, nbhd)] + rest
+    parts = [f'/SCM/{proj}.{nbhd}'] + rest
     return '/'.join(parts)
 
 
@@ -193,7 +193,7 @@ def check_permissions(req):
     permission = get_permission_name(req_path, req_query, req.method)
     authorized = cred.get(permission, False)
 
-    log(req, "{} -> {} -> {} -> authorized:{}".format(r.url, cred, permission, 
authorized))
+    log(req, f"{r.url} -> {cred} -> {permission} -> authorized:{authorized}")
     return authorized
 
 
diff --git a/scripts/teamforge-import.py b/scripts/teamforge-import.py
index 939ae1e7f..7c68ede2b 100644
--- a/scripts/teamforge-import.py
+++ b/scripts/teamforge-import.py
@@ -883,13 +883,13 @@ def _dir_sql(created_on, project, dir_name, rel_path):
         parent_directory = "(SELECT pfs_path FROM pfs_path WHERE path_name = 
'%s/')" % rel_path
     sql = """
     UPDATE pfs
-      SET file_crtime = '%s'
-      WHERE source_pk = (SELECT project.project FROM project WHERE 
project.project_name = '%s.%s')
+      SET file_crtime = '{}'
+      WHERE source_pk = (SELECT project.project FROM project WHERE 
project.project_name = '{}.{}')
       AND source_table = 'project'
       AND pfs_type = 'd'
-      AND pfs_name = '%s'
-      AND parent_directory = %s;
-    """ % (created_on, convert_project_shortname(project.path), 
options.neighborhood_shortname,
+      AND pfs_name = '{}'
+      AND parent_directory = {};
+    """.format(created_on, convert_project_shortname(project.path), 
options.neighborhood_shortname,
            dir_name, parent_directory)
     return sql
 

Reply via email to