Skip to content

Commit

Permalink
Fix compatibility issues between pylint and flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
tobspr committed Apr 28, 2016
1 parent 8bcecc7 commit bbb2516
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions rpcore/effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def _parse_shader_template(self, pass_id, stage, data):
shader_path = self._construct_shader_from_data(pass_id, stage, template_src, data)
self._generated_shader_paths[stage + "-" + pass_id] = shader_path

def _construct_shader_from_data(self, pass_id, stage, template_src, data): # pylint: disable=too-many-branches # noqa
def _construct_shader_from_data(self, pass_id, stage, template_src, data): # noqa # pylint: disable=too-many-branches
""" Constructs a shader from a given dataset """
injects = {"defines": []}

Expand Down Expand Up @@ -219,7 +219,7 @@ def _construct_shader_from_data(self, pass_id, stage, template_src, data): # py
cache_key = self.effect_name + "@" + stage + "-" + pass_id + "@" + self.effect_hash
return self._process_shader_template(template_src, cache_key, injects)

def _process_shader_template(self, template_src, cache_key, injections):
def _process_shader_template(self, template_src, cache_key, injections): # noqa # pylint: disable=too-many-branches
""" Generates a compiled shader object from a given shader
source location and code injection definitions. """
with open(template_src, "r") as handle:
Expand Down Expand Up @@ -264,7 +264,7 @@ def _process_shader_template(self, template_src, cache_key, injections):
# When we are in the main function, we have to make sure we
# use a seperate scope, so there are no conflicts with variable
# declarations
header = indent + "/* Hook: " + hook_name + " */" + (" {" if in_main else "") # noqa
header = indent + "/* Hook: " + hook_name + " */" + (" {" if in_main else "") # noqa # pylint: disable=line-too-long
parsed_lines.append(header)

for line_to_insert in insertions:
Expand Down
2 changes: 1 addition & 1 deletion rpcore/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
__all__ = ("RPLoader",)


class timed_loading_operation(object): # pylint: disable=invalid-name,too-few-public-methods # noqa
class timed_loading_operation(object): # noqa # pylint: disable=invalid-name,too-few-public-methods

""" Context manager for a synchronous loading operation, keeping track
on how much time elapsed during the loading process, and warning about
Expand Down
2 changes: 1 addition & 1 deletion rpcore/pynative/ies_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def generate_dataset_texture_into(self, dest_tex, layer_index):

dest_tex.load(dest, layer_index, 0)

def get_candela_value(self, vertical_angle, horizontal_angle): # pylint: disable=unused-argument # noqa
def get_candela_value(self, vertical_angle, horizontal_angle): # noqa # pylint: disable=unused-argument
# NOTICE: Since python is slower, we always only assume a dataset without
# horizontal angles. This still produces convincing results, but does
# generate much faster.
Expand Down
2 changes: 1 addition & 1 deletion rpcore/render_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
__version__ = "2.0"


class setter(object): # pylint: disable=invalid-name,too-few-public-methods # noqa
class setter(object): # noqa # pylint: disable=invalid-name,too-few-public-methods
""" Setter only property """
def __init__(self, func):
self.__func = func
Expand Down
4 changes: 2 additions & 2 deletions rpcore/stages/update_previous_pipes_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ def get_sampler_type(self, tex, can_write=False): # pylint: disable=unused-argu
else:
return "writeonly image2D"

def get_sampler_lookup(self, tex, dest_name, sampler_name, coord_var): # pylint: disable=unused-argument # noqa
def get_sampler_lookup(self, tex, dest_name, sampler_name, coord_var): # noqa # pylint: disable=unused-argument
""" Returns the matching GLSL sampler lookup for a texture, storing the
result in the given glsl variable """
# TODO: Add more lookups based on texture type
return "vec4 " + dest_name + " = texelFetch(" + sampler_name + ", " + coord_var + ", 0);"

def get_store_code(self, tex, sampler_name, coord_var, data_var): # pylint: disable=unused-argument # noqa
def get_store_code(self, tex, sampler_name, coord_var, data_var): # noqa# pylint: disable=unused-argument
""" Returns the matching GLSL code to store the given data in a given
texture """
# TODO: Add more stores based on texture type
Expand Down
6 changes: 3 additions & 3 deletions rpcore/util/display_shader_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _build_fragment_shader(cls, texture, view_width, view_height):
return built

@classmethod
def _generate_sampling_code(cls, texture, view_width, view_height): # pylint: disable=unused-argument,too-many-branches # noqa
def _generate_sampling_code(cls, texture, view_width, view_height): # noqa # pylint: disable=unused-argument,too-many-branches
""" Generates the GLSL code to sample a texture and also returns the
GLSL sampler type """

Expand Down Expand Up @@ -129,8 +129,8 @@ def _generate_sampling_code(cls, texture, view_width, view_height): # pylint: d
# Buffer Textures
elif texture_type == Image.TT_buffer_texture:

def range_check():
return "if (int_index < textureSize(p3d_Texture0)) {" + s + "} else { result = vec3(1.0, 0.6, 0.2);};" # noqa
def range_check(code):
return "if (int_index < textureSize(p3d_Texture0)) {" + code + "} else { result = vec3(1.0, 0.6, 0.2);};" # noqa

if comp_type in float_types:
result = range_check("result = texelFetch(p3d_Texture0, int_index).xyz;"), "samplerBuffer" # noqa
Expand Down
2 changes: 1 addition & 1 deletion rpcore/util/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def do_pstat(*args, **kargs):
return do_pstat


class profile_cpu(object): # pylint: disable=invalid-name,too-few-public-methods # noqa
class profile_cpu(object): # noqa # pylint: disable=invalid-name,too-few-public-methods
"""
Context manager for profiling CPU duration. This is useful for timing
loading of files or other CPU-heavy operations. Example usage:
Expand Down
2 changes: 1 addition & 1 deletion rpplugins/color_correction/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def on_stage_setup(self):
if not self.get_setting("manual_camera_parameters"):
self.exposure_stage = self.create_stage(AutoExposureStage)
else:
self.exposure_stage = self.create_stage(ManualExposureStage) # pylint: disable=redefined-variable-type # noqa
self.exposure_stage = self.create_stage(ManualExposureStage) # noqa # pylint: disable=redefined-variable-type

def on_pipeline_created(self):
self.load_lut()
Expand Down
2 changes: 1 addition & 1 deletion rpplugins/pssm/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def on_pipeline_created(self):
self.node.hide()

# Construct the actual PSSM rig
self.camera_rig = PSSMCameraRig(self.get_setting("split_count")) # pylint: disable=undefined-variable # noqa
self.camera_rig = PSSMCameraRig(self.get_setting("split_count")) # noqa # pylint: disable=undefined-variable
self.camera_rig.set_sun_distance(self.get_setting("sun_distance"))
self.camera_rig.set_pssm_distance(self.get_setting("max_distance"))
self.camera_rig.set_logarithmic_factor(self.get_setting("logarithmic_factor"))
Expand Down
2 changes: 1 addition & 1 deletion rpplugins/scattering/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def on_stage_setup(self):
self.scattering_model = ScatteringMethodEricBruneton(self)
elif method == "hosek_wilkie":
from .scattering_methods import ScatteringMethodHosekWilkie
self.scattering_model = ScatteringMethodHosekWilkie(self) # pylint: disable=redefined-variable-type # noqa
self.scattering_model = ScatteringMethodHosekWilkie(self) # noqa # pylint: disable=redefined-variable-type
else:
self.error("Unrecognized scattering method!")

Expand Down
2 changes: 1 addition & 1 deletion rpplugins/scattering/scattering_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def create_textures(self):
self.textures = {
"transmittance": img_2d("scat-trans", self.trans_w, self.trans_h, tex_format),
"irradiance": img_2d("scat-irrad", self.sky_w, self.sky_h, tex_format),
"inscatter": img_3d("scat-inscat", self.res_mu_s_nu, self.res_mu, self.res_r, tex_format), # pylint: disable=line-too-long # noqa
"inscatter": img_3d("scat-inscat", self.res_mu_s_nu, self.res_mu, self.res_r, tex_format), # noqa # pylint: disable=line-too-long
"delta_e": img_2d("scat-dx-e", self.sky_w, self.sky_h, tex_format),
"delta_sr": img_3d("scat-dx-sr", self.res_mu_s_nu, self.res_mu, self.res_r, tex_format),
"delta_sm": img_3d("scat-dx-sm", self.res_mu_s_nu, self.res_mu, self.res_r, tex_format),
Expand Down
2 changes: 1 addition & 1 deletion toolkit/rp_distributor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
os.chdir(base_dir)

sys.path.insert(0, rp_dir)
from rplibs.six.moves import input # pylint: disable=import-error # noqa
from rplibs.six.moves import input # noqa # pylint: disable=import-error

# TODO: Add option to skip gui folders if debugger is disabled

Expand Down

0 comments on commit bbb2516

Please sign in to comment.