Cleanup: use f-strings
[blender.git] / release / scripts / startup / bl_ui / space_text.py
index 98a7da855ca2fa56a7c25971c39ff0e6b72b7e64..d0067012ffe39a18e87169e954d3432f4c0b706a 100644 (file)
@@ -50,9 +50,9 @@ class TEXT_HT_header(Header):
         row.prop(st, "show_syntax_highlight", text="")
 
         if text:
-            osl = text.name.endswith(".osl") or text.name.endswith(".oso")
+            is_osl = text.name.endswith((".osl", ".osl"))
 
-            if osl:
+            if is_osl:
                 row = layout.row()
                 row.operator("node.shader_script_update")
             else:
@@ -66,15 +66,21 @@ class TEXT_HT_header(Header):
             row = layout.row()
             if text.filepath:
                 if text.is_dirty:
-                    row.label(text=iface_("File: *%r (unsaved)") %
-                              text.filepath, translate=False)
+                    row.label(
+                        iface_(f"File: *{text.filepath} (unsaved)"),
+                        translate=False,
+                    )
                 else:
-                    row.label(text=iface_("File: %r") %
-                              text.filepath, translate=False)
+                    row.label(
+                        iface_(f"File: {text.filepath}"),
+                        translate=False,
+                    )
             else:
-                row.label(text="Text: External"
-                          if text.library
-                          else "Text: Internal")
+                row.label(
+                    "Text: External"
+                    if text.library
+                    else "Text: Internal"
+                )
 
 
 class TEXT_MT_editor_menus(Menu):