Merge lp:~t20100/pyopengl/async into lp:pyopengl

Proposed by Thomas VINCENT
Status: Needs review
Proposed branch: lp:~t20100/pyopengl/async
Merge into: lp:pyopengl
Diff against target: 57 lines (+9/-6)
2 files modified
OpenGL/GL/SGIX/async_.py (+3/-3)
src/codegenerator.py (+6/-3)
To merge this branch: bzr merge lp:~t20100/pyopengl/async
Reviewer Review Type Date Requested Status
Mike C. Fletcher Pending
Review via email: mp+352013@code.launchpad.net

Commit message

Rename SGIX.async module to SGIX.async_ to avoid collision with async keyword

Description of the change

This is a proposition to rename the OpenGL.GL.SGIX.async module to async_ to avoid collision with new Python keyword async.

This seems to be the way fedora and debian are patching PyOpenGL for python3.7 (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903218)

This patch updates the generation script, renames and updates OpenGL.GL.SGIX.async and OpenGL.raw.GL.SGIX.async.
When I run the generation script quite a few other extension files were updated/added. Those files are not included here.

Also, to test it on Windows, I had to patch Win32Platform.constructFunction to support a force_extension argument (in OpenGL.platform.win32). This is also not included here.

To post a comment you must log in.

Unmerged revisions

1063. By Thomas Vincent <email address hidden>

Fix docstring generation

1062. By Thomas Vincent <email address hidden>

Rename GL.SGIX.async to GL.SGIX.async_

1061. By Thomas Vincent <email address hidden>

Avoid using keyword async as module name (use async_ instead)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed file 'OpenGL/GL/SGIX/async.py' => 'OpenGL/GL/SGIX/async_.py'
2--- OpenGL/GL/SGIX/async.py 2014-04-16 14:20:21 +0000
3+++ OpenGL/GL/SGIX/async_.py 2018-08-01 12:48:03 +0000
4@@ -1,7 +1,7 @@
5 '''OpenGL extension SGIX.async
6
7 This module customises the behaviour of the
8-OpenGL.raw.GL.SGIX.async to provide a more
9+OpenGL.raw.GL.SGIX.async_ to provide a more
10 Python-friendly API
11
12 Overview (from the spec)
13@@ -55,8 +55,8 @@
14 from OpenGL import extensions, wrapper
15 import ctypes
16 from OpenGL.raw.GL import _types, _glgets
17-from OpenGL.raw.GL.SGIX.async import *
18-from OpenGL.raw.GL.SGIX.async import _EXTENSION_NAME
19+from OpenGL.raw.GL.SGIX.async_ import *
20+from OpenGL.raw.GL.SGIX.async_ import _EXTENSION_NAME
21
22 def glInitAsyncSGIX():
23 '''Return boolean indicating whether this extension is available'''
24
25=== renamed file 'OpenGL/raw/GL/SGIX/async.py' => 'OpenGL/raw/GL/SGIX/async_.py'
26=== modified file 'src/codegenerator.py'
27--- src/codegenerator.py 2018-02-20 04:26:34 +0000
28+++ src/codegenerator.py 2018-08-01 12:48:03 +0000
29@@ -195,14 +195,14 @@
30 from OpenGL import extensions
31 return extensions.hasGLExtension( _EXTENSION_NAME )
32 """
33- FINAL_MODULE_TEMPLATE = """'''OpenGL extension %(owner)s.%(module)s
34+ FINAL_MODULE_TEMPLATE = """'''OpenGL extension %(owner)s.%(rawModule)s
35
36 This module customises the behaviour of the
37 OpenGL.raw.%(prefix)s.%(owner)s.%(module)s to provide a more
38 Python-friendly API
39
40 %(overview)sThe official definition of this extension is available here:
41-%(ROOT_EXTENSION_SOURCE)s%(owner)s/%(module)s.txt
42+%(ROOT_EXTENSION_SOURCE)s%(owner)s/%(rawModule)s.txt
43 '''
44 from OpenGL import platform, constant, arrays
45 from OpenGL import extensions, wrapper
46@@ -247,7 +247,10 @@
47 self.module = '%s_%s'%(self.prefix,self.module,)
48 self.camelModule = "".join([x.title() for x in self.module.split('_')])
49 self.rawModule = self.module
50-
51+
52+ if self.module == 'async': # Avoid collision with async keyword
53+ self.module = 'async_'
54+
55 self.rawOwner = self.owner
56 while self.owner and self.owner[0].isdigit():
57 self.owner = self.owner[1:]

Subscribers

People subscribed via source and target branches