diff options
author | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2021-05-12 14:27:15 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2021-05-12 20:33:36 +0200 |
commit | c5db9d63277201ee58829f7eb0656c534d04c249 (patch) | |
tree | ef67e9547943c49497bffc52d041bb2aa93243a7 /examples/opengl/contextinfo/contextinfo.py | |
parent | 7118ab7a34b1c3c6a9b0b1d29e0a9d2011a2d887 (diff) |
examples: use f-strings
Change-Id: I0360f1476af666494c730e4f3c8f4f3c562abc09
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/opengl/contextinfo/contextinfo.py')
-rw-r--r-- | examples/opengl/contextinfo/contextinfo.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/examples/opengl/contextinfo/contextinfo.py b/examples/opengl/contextinfo/contextinfo.py index 5a64f168e..4e2704f1c 100644 --- a/examples/opengl/contextinfo/contextinfo.py +++ b/examples/opengl/contextinfo/contextinfo.py @@ -238,13 +238,19 @@ class RenderWindow(QWindow): if not self.context.makeCurrent(self): raise Exception("makeCurrent() failed") functions = self.context.functions() - text = """Vendor: {}\nRenderer: {}\nVersion: {}\nShading language: {} -\nContext Format: {}\n\nSurface Format: {}""".format( - functions.glGetString(GL.GL_VENDOR), functions.glGetString(GL.GL_RENDERER), - functions.glGetString(GL.GL_VERSION), - functions.glGetString(GL.GL_SHADING_LANGUAGE_VERSION), - print_surface_format(self.context.format()), - print_surface_format(self.format())) + gl_vendor = functions.glGetString(GL.GL_VENDOR) + gl_renderer = functions.glGetString(GL.GL_RENDERER) + gl_version = functions.glGetString(GL.GL_VERSION) + gl_lang_version = functions.glGetString(GL.GL_SHADING_LANGUAGE_VERSION) + context_surface_format = print_surface_format(self.context.format()) + surface_format = print_surface_format(self.format()) + + text = ("Vendor: {gl_vendor}\n" + "Renderer: {gl_renderer}\n" + "Version: {gl_version}\n" + "Shading language: {gl_lang_version}\n" + "Context Format: {context_surface_format}\n\n" + "Surface Format: {surface_format}") self.context.doneCurrent() return text |