Skip to content

Commit 01c97af

Browse files
committed
pylint pass
1 parent 3ed49f2 commit 01c97af

File tree

28 files changed

+75
-78
lines changed

28 files changed

+75
-78
lines changed

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ disable=print-statement,
136136
comprehension-escape,
137137
missing-docstring,
138138
duplicate-code,
139-
no-member
139+
no-member,
140+
C0326
140141

141142

142143
# Enable the message, report, category or checker with the given id(s). You can

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,11 @@ Features
4949
--------
5050

5151
* A simple effect system based on python packages
52-
* Supports loading GLTF and obj files/scenes
52+
* Supports loading GLTF 2.0 and obj files/scenes
5353
* Support for the rocket sync-tracker system to create interesting keyframe data (Using [pyrocket](https://github.com/Contraz/pyrocket))
5454
* Management commands to create new projects and effects
5555
* Convenient wrappers for VAO, Shader, Texture, FBO etc
56-
* On-the-fly Shader and VAO negotiation of the needed buffer binding
5756
* Runtime re-loading shaders (press R)
58-
* Strict validation in most OpenGL operations with reasonable error feedback
5957
* Time line / Timer support
6058
* A highly pluggable framework
6159
* Support for custom management commands

TODO.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
- Framebuffer Blitting
2626
- Textures:
2727
- 3D
28-
- Texture Array
2928
- Texture Cube
3029
- FBOs
3130
- Support layers

demosys/conf/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ def __repr__(self):
5252
settings_module=self.SETTINGS_MODULE,
5353
)
5454

55-
def add_shader_dir(self, dir):
55+
def add_shader_dir(self, directory):
5656
"""Hack in shader directory"""
5757
dirs = list(self.SHADER_DIRS)
58-
dirs.append(dir)
58+
dirs.append(directory)
5959
self.SHADER_DIRS = dirs
6060

6161

demosys/conf/settingsfile.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def create(settings):
1717
value = ",\n".join(' "{}": {}'.format(k, to_s(v)) for k, v in value.items())
1818

1919
# Add comma after the last dict entry
20-
if len(value) > 0:
20+
if value:
2121
value += ','
2222

2323
data += "%s = {\n%s\n}\n\n" % (name, value)
@@ -26,7 +26,7 @@ def create(settings):
2626
value = ",\n".join(" {}".format(to_s(v)) for v in value)
2727

2828
# Add comma after the last tuple entry
29-
if len(value) > 0:
29+
if value:
3030
value += ","
3131

3232
data += "{} = (\n{}\n)\n\n".format(name, value)
@@ -38,8 +38,8 @@ def create(settings):
3838
return data[:-1]
3939

4040

41-
def to_s(t):
42-
if isinstance(t, str):
43-
return '"{}"'.format(t)
41+
def to_s(var):
42+
if isinstance(var, str):
43+
return '"{}"'.format(var)
4444
else:
45-
return str(t)
45+
return str(var)

demosys/context/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ def swap_buffers(self):
7070

7171
def resize(self, width, height):
7272
"""Resize window"""
73+
self.width = width
74+
self.height = height
7375
self._calc_viewport()
7476

7577
def close(self):

demosys/core/finders.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def _find(self, path):
3030
:param path: The path to find
3131
:return: The absolute path to the file or None if not found
3232
"""
33-
for p in self.paths:
34-
abspath = os.path.join(p, path)
33+
for entry in self.paths:
34+
abspath = os.path.join(entry, path)
3535
if os.path.exists(abspath):
3636
self.cache(abspath, abspath)
3737
return abspath
@@ -48,9 +48,9 @@ def find_cached(self, path):
4848
:param path: The path to the file
4949
:return: The absolute path to the file or None
5050
"""
51-
e = self._cache.get(path)
52-
if e.exists:
53-
return e.abspath
51+
entry = self._cache.get(path)
52+
if entry.exists:
53+
return entry.abspath
5454
return None
5555

5656
def cache(self, path, abspath, exists=True):

demosys/core/management/commands/run.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ def handle(self, *args, **options):
1919
print(manager_path)
2020
try:
2121
manager_cls = import_string(manager_path)
22-
except ImportError as e:
23-
raise ImproperlyConfigured("EFFECT_MANAGER '{}' failed to initialize: {}".format(manager_path, e))
22+
except ImportError as err:
23+
raise ImproperlyConfigured(
24+
"EFFECT_MANAGER '{}' failed to initialize: {}".format(manager_path, err))
2425

2526
manager = manager_cls()
2627
demosys.run(manager=manager)

demosys/deferred/effect.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33

44

55
class DeferredEffect(Effect):
6-
pass
6+
7+
def draw(self, time, frametime, target):
8+
pass

demosys/deferred/renderer.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import moderngl
22
from demosys import context, geometry, resources
3-
from demosys.opengl import FBO, DepthTexture, Texture2D, samplers
3+
from demosys.opengl import FBO, DepthTexture, Texture2D
44
from pyrr import matrix44
55

66

@@ -30,10 +30,6 @@ def __init__(self, width, height, gbuffer=None, lightbuffer=None):
3030
self.width = width
3131
self.height = height
3232
self.size = (width, height)
33-
self.depth_sampler = samplers.create(
34-
texture_compare_mode=False,
35-
min_filter=moderngl.LINEAR, mag_filter=moderngl.LINEAR
36-
)
3733

3834
# FBOs
3935
self.gbuffer = gbuffer
@@ -113,16 +109,13 @@ def render_lights(self, camera_matrix, projection):
113109
self.point_light_shader.uniform("m_light", m_light.astype('f4').tobytes())
114110
self.gbuffer.color_buffers[1].use(location=0)
115111
self.point_light_shader.uniform("g_normal", 0)
116-
self.depth_sampler.use(location=1)
117112
self.gbuffer.depth_buffer.use(location=1)
118113
self.point_light_shader.uniform("g_depth", 1)
119114
self.point_light_shader.uniform("screensize", (self.width, self.height))
120115
self.point_light_shader.uniform("proj_const", projection.projection_constants)
121116
self.point_light_shader.uniform("radius", light_size)
122117
self.unit_cube.draw(self.point_light_shader)
123118

124-
self.depth_sampler.release()
125-
126119
self.ctx.disable(moderngl.BLEND)
127120
self.ctx.disable(moderngl.CULL_FACE)
128121

0 commit comments

Comments
 (0)