Skip to content
Permalink
Browse files

Pylint related cleanup.

  • Loading branch information...
captainhammy committed Jun 9, 2019
1 parent d7cf239 commit 417f51a91f80b64c4d54d2ab707766a2adf5541b
Showing with 391 additions and 374 deletions.
  1. +1 −1 .gitignore
  2. +2 −0 houdini/otls/Sop-cppwrangle.1.otl/com.houdinitoolbox_8_8Sop_1cppwrangle_8_81/PythonCook
  3. +1 −1 houdini/otls/Sop-cppwrangle.1.otl/com.houdinitoolbox_8_8Sop_1cppwrangle_8_81/PythonModule
  4. +33 −32 houdini/pyfilter/ht-pyfilter.py
  5. +3 −2 python/ht/events/callbacks.py
  6. +1 −0 python/ht/events/event.py
  7. +13 −17 python/ht/events/events/rop_render.py
  8. +2 −1 python/ht/events/events/scene_load.py
  9. +1 −0 python/ht/events/group.py
  10. +1 −0 python/ht/events/item.py
  11. +3 −0 python/ht/events/manager.py
  12. +14 −18 python/ht/events/stats.py
  13. +1 −0 python/ht/events/types.py
  14. +1 −1 python/ht/geometry/pointcloud.py
  15. +5 −6 python/ht/houdini/package.py
  16. +0 −2 python/ht/inline/__init__.py
  17. +1 −0 python/ht/inline/lib.py
  18. +1 −0 python/ht/inline/utils.py
  19. +1 −1 python/ht/logging/shellio.py
  20. +1 −0 python/ht/nodes/naming.py
  21. +1 −0 python/ht/nodes/styles/__init__.py
  22. +1 −0 python/ht/nodes/styles/event.py
  23. +4 −0 python/ht/nodes/styles/manager.py
  24. +3 −3 python/ht/nodes/styles/styles.py
  25. +7 −11 python/ht/pyfilter/manager.py
  26. +10 −16 python/ht/pyfilter/operations/deepimage.py
  27. +13 −10 python/ht/pyfilter/operations/ipoverrides.py
  28. +7 −10 python/ht/pyfilter/operations/logoutput.py
  29. +6 −10 python/ht/pyfilter/operations/operation.py
  30. +5 −10 python/ht/pyfilter/operations/primaryimage.py
  31. +10 −13 python/ht/pyfilter/operations/setproperties.py
  32. +4 −3 python/ht/pyfilter/operations/settilecallback.py
  33. +4 −4 python/ht/pyfilter/operations/zdepth.py
  34. +2 −0 python/ht/pyfilter/property.py
  35. +2 −6 python/ht/pyfilter/utils.py
  36. +10 −6 python/ht/sohohooks/aovs/aov.py
  37. +7 −4 python/ht/sohohooks/aovs/manager.py
  38. +7 −1 python/ht/sohohooks/manager.py
  39. +9 −6 python/ht/ui/aovs/dialogs.py
  40. +78 −75 python/ht/ui/aovs/models.py
  41. +57 −53 python/ht/ui/aovs/widgets.py
  42. +1 −0 python/ht/ui/paste/dialogs.py
  43. +3 −0 python/ht/ui/paste/helpers.py
  44. +5 −4 python/ht/ui/paste/models.py
  45. +4 −2 python/ht/ui/paste/widgets.py
  46. +11 −11 tests/events/events/test_rop_render.py
  47. +2 −2 tests/events/test_stats.py
  48. +7 −7 tests/pyfilter/operations/test_deepimage.py
  49. +1 −1 tests/pyfilter/operations/test_ipoverrides.py
  50. +4 −4 tests/pyfilter/operations/test_logoutput.py
  51. +1 −1 tests/pyfilter/operations/test_operation.py
  52. +4 −4 tests/pyfilter/operations/test_primaryimage.py
  53. +6 −6 tests/pyfilter/operations/test_setproperties.py
  54. +1 −1 tests/pyfilter/operations/test_settilecallback.py
  55. +1 −1 tests/pyfilter/operations/test_zdepth.py
  56. +6 −6 tests/pyfilter/test_manager.py
  57. +1 −1 tests/pyfilter/test_utils.py
@@ -57,4 +57,4 @@ plugins/build
*.ifd
*/backup/*
houdini/otls/backup

*pylint.*.out
@@ -1,3 +1,5 @@
# pylint: disable=missing-docstring

# Houdini Imports
import hou
import hutil.cppinline
@@ -1,4 +1,4 @@

# pylint: disable=missing-docstring
# Python Imports
import ast
import os
@@ -23,13 +23,14 @@
# Houdini Imports
import mantra

logger = logging.getLogger("ht-pyfilter")


# =============================================================================
# GLOBALS
# =============================================================================

LOGGER = logging.getLogger("ht-pyfilter")

PYFILTER_MANAGER = None
_PYFILTER_MANAGER = None


# =============================================================================
@@ -49,9 +50,9 @@ def filterCamera():
don't declare the property explicitly.
"""
LOGGER.debug("filterCamera")
logger.debug("filterCamera")

PYFILTER_MANAGER.run_operations_for_stage("filterCamera")
_PYFILTER_MANAGER.run_operations_for_stage("filterCamera")


def filterCameraSegment():
@@ -61,16 +62,16 @@ def filterCameraSegment():
camera motion segment.
"""
LOGGER.debug("filterCameraSegment")
logger.debug("filterCameraSegment")

PYFILTER_MANAGER.run_operations_for_stage("filterCameraSegment")
_PYFILTER_MANAGER.run_operations_for_stage("filterCameraSegment")


def filterEndRender():
"""Perform actions just after the image has been rendered."""
LOGGER.debug("filterEndRender")
logger.debug("filterEndRender")

PYFILTER_MANAGER.run_operations_for_stage("filterEndRender")
_PYFILTER_MANAGER.run_operations_for_stage("filterEndRender")


def filterError(level, message, prefix):
@@ -79,7 +80,7 @@ def filterError(level, message, prefix):
This function allows you to disable the printing of messages.
"""
result = PYFILTER_MANAGER.run_operations_for_stage("filterError", level, message, prefix)
result = _PYFILTER_MANAGER.run_operations_for_stage("filterError", level, message, prefix)

return result

@@ -91,9 +92,9 @@ def filterFog():
a fog object. The function can query fog: settings and possibly alter them.
"""
LOGGER.debug("filterFog ({})".format(mantra.property("object:name")[0]))
logger.debug("filterFog ({})".format(mantra.property("object:name")[0]))

PYFILTER_MANAGER.run_operations_for_stage("filterFog")
_PYFILTER_MANAGER.run_operations_for_stage("filterFog")


def filterGeometry():
@@ -104,9 +105,9 @@ def filterGeometry():
alter them.
"""
LOGGER.debug("filterGeometry")
logger.debug("filterGeometry")

PYFILTER_MANAGER.run_operations_for_stage("filterGeometry")
_PYFILTER_MANAGER.run_operations_for_stage("filterGeometry")


def filterInstance():
@@ -117,8 +118,8 @@ def filterInstance():
alter them.
"""
LOGGER.debug("filterInstance ({})".format(mantra.property("object:name")[0]))
PYFILTER_MANAGER.run_operations_for_stage("filterInstance")
logger.debug("filterInstance ({})".format(mantra.property("object:name")[0]))
_PYFILTER_MANAGER.run_operations_for_stage("filterInstance")


def filterLight():
@@ -129,9 +130,9 @@ def filterLight():
them.
"""
LOGGER.debug("filterLight ({})".format(mantra.property("object:name")[0]))
logger.debug("filterLight ({})".format(mantra.property("object:name")[0]))

PYFILTER_MANAGER.run_operations_for_stage("filterLight")
_PYFILTER_MANAGER.run_operations_for_stage("filterLight")


def filterMaterial():
@@ -142,9 +143,9 @@ def filterMaterial():
add or change properties on the material.
"""
LOGGER.debug("filterMaterial")
logger.debug("filterMaterial")

PYFILTER_MANAGER.run_operations_for_stage("filterMaterial")
_PYFILTER_MANAGER.run_operations_for_stage("filterMaterial")


def filterOutputAssets(assets):
@@ -154,9 +155,9 @@ def filterOutputAssets(assets):
during the render.
"""
LOGGER.debug("filterOutputAssets")
logger.debug("filterOutputAssets")

PYFILTER_MANAGER.run_operations_for_stage("filterOutputAssets")
_PYFILTER_MANAGER.run_operations_for_stage("filterOutputAssets")


def filterPlane():
@@ -165,18 +166,18 @@ def filterPlane():
channel = mantra.property("plane:channel")[0]

if variable == channel or channel == "":
LOGGER.debug("filterPlane ({})".format(variable))
logger.debug("filterPlane ({})".format(variable))
else:
LOGGER.debug("filterPlane ({} -> {})".format(variable, channel))
logger.debug("filterPlane ({} -> {})".format(variable, channel))

PYFILTER_MANAGER.run_operations_for_stage("filterPlane")
_PYFILTER_MANAGER.run_operations_for_stage("filterPlane")


def filterQuit():
"""Perform actions just before Mantra quits."""
LOGGER.debug("filterQuit")
logger.debug("filterQuit")

PYFILTER_MANAGER.run_operations_for_stage("filterQuit")
_PYFILTER_MANAGER.run_operations_for_stage("filterQuit")


def filterRender():
@@ -187,19 +188,19 @@ def filterRender():
statistics or validation, it might be useful to have this method available.
"""
LOGGER.debug("filterRender")
logger.debug("filterRender")

PYFILTER_MANAGER.run_operations_for_stage("filterRender")
_PYFILTER_MANAGER.run_operations_for_stage("filterRender")


def main():
"""Build the manager."""
global PYFILTER_MANAGER
global _PYFILTER_MANAGER

_PYFILTER_MANAGER = PyFilterManager()

PYFILTER_MANAGER = PyFilterManager()

# =============================================================================

if __name__ == "__main__":
main()

@@ -14,11 +14,12 @@
# Houdini Imports
import hou


# =============================================================================
# NON-PUBLIC FUNCTIONS
# =============================================================================

def _atexit_callback(*args, **kwargs):
def _atexit_callback(*args, **kwargs): # pylint: disable=unused-argument
"""Run SceneEvents.Exit events.
:return:
@@ -27,7 +28,7 @@ def _atexit_callback(*args, **kwargs):
run_event(SceneEvents.Exit)


def _emit_ui_available(*args, **kwargs):
def _emit_ui_available(*args, **kwargs): # pylint: disable=unused-argument
"""Run SceneEvents.WhenUIAvailable events.
:return:
@@ -8,6 +8,7 @@
from ht.events.item import HoudiniEventItem
from ht.events.stats import HoudiniEventStats


# =============================================================================
# CLASSES
# =============================================================================
@@ -19,12 +19,7 @@
# Houdini Imports
import hou


# =============================================================================
# GLOBALS
# =============================================================================

LOGGER = logging.getLogger(__name__)
logger = logging.getLogger(__name__)


# =============================================================================
@@ -66,7 +61,7 @@ def pre_frame(self, scriptargs):
# frame is completed to get the duration.
self._frame_start = scriptargs["time"]

LOGGER.info("Starting Frame: %s", scriptargs["frame"])
logger.info("Starting Frame: %s", scriptargs["frame"])

def pre_render(self, scriptargs):
"""Action run before the render starts.
@@ -83,10 +78,10 @@ def pre_render(self, scriptargs):
if frame_range is not None:
start, end, inc = frame_range

LOGGER.info("Starting render: %s-%s:%s", start, end, inc)
logger.info("Starting render: %s-%s:%s", start, end, inc)

else:
LOGGER.info("Starting render")
logger.info("Starting render")

def post_frame(self, scriptargs):
"""Action run after the frame has rendered.
@@ -104,11 +99,11 @@ def post_frame(self, scriptargs):
duration = end_time - self._frame_start

# Print a complete message that includes our calculated duration.
LOGGER.info("Completed Frame: %s (%0.5fs)", scriptargs["frame"], duration)
logger.info("Completed Frame: %s (%0.5fs)", scriptargs["frame"], duration)

# If we somehow didn't, just print the complete message.
else:
LOGGER.info("Completed Frame: %s", scriptargs["frame"])
logger.info("Completed Frame: %s", scriptargs["frame"])

def post_render(self, scriptargs):
"""Action run after the render is complete.
@@ -121,12 +116,12 @@ def post_render(self, scriptargs):
if self._render_start is not None:
end_time = scriptargs["time"]

LOGGER.info("Completed Render: %0.5fs", end_time-self._render_start)
logger.info("Completed Render: %0.5fs", end_time-self._render_start)

else:
LOGGER.info("Completed Render")
logger.info("Completed Render")

def post_write(self, scriptargs):
def post_write(self, scriptargs): # pylint: disable=no-self-use
"""Action run after the frame is written to disk.
:param scriptargs: Event data.
@@ -135,10 +130,10 @@ def post_write(self, scriptargs):
"""
if "path" in scriptargs:
LOGGER.info("Wrote frame %s to %s", scriptargs["frame"], scriptargs["path"])
logger.info("Wrote frame %s to %s", scriptargs["frame"], scriptargs["path"])

else:
LOGGER.info("Wrote frame %s", scriptargs["frame"])
logger.info("Wrote frame %s", scriptargs["frame"])


# =============================================================================
@@ -191,7 +186,7 @@ def _print_frame_write(scriptargs):
pass

else:
LOGGER.info("Wrote frame %s to %s", scriptargs["frame"], scriptargs["path"])
logger.info("Wrote frame %s to %s", scriptargs["frame"], scriptargs["path"])


# =============================================================================
@@ -227,3 +222,4 @@ def build_scriptargs(node=None):
scriptargs["path"] = _get_target_file(node)

return scriptargs

@@ -12,6 +12,7 @@
# Houdini Imports
import hou


# =============================================================================
# CLASSES
# =============================================================================
@@ -34,7 +35,7 @@ def __init__(self):
# METHODS
# =========================================================================

def clear_session_settings(self, scriptargs):
def clear_session_settings(self, scriptargs): # pylint: disable=no-self-use,unused-argument
"""Clear out potentially annoying/bad settings."""
# Remove an icon cache directory variable if it exists.
hou.hscript("set -u HOUDINI_ICON_CACHE_DIR")
@@ -1,5 +1,6 @@
"""This module contains the Houdini event group class."""


# =============================================================================
# CLASSES
# =============================================================================
@@ -7,6 +7,7 @@
# Houdini Toolbox Imports
from ht.events.stats import HoudiniEventItemStats


# =============================================================================
# IMPORTS
# =============================================================================
@@ -16,6 +16,7 @@
from ht.events.group import HoudiniEventGroup
from ht.events.item import HoudiniEventItem


# =============================================================================
# CLASSES
# =============================================================================
@@ -192,6 +193,7 @@ def run_event(self, event_name, scriptargs=None):

event.run(scriptargs)


# =============================================================================
# FUNCTIONS
# =============================================================================
@@ -262,6 +264,7 @@ def run_event(event_name, scriptargs=None):
"""
MANAGER.run_event(event_name, scriptargs)


# =============================================================================

MANAGER = HoudiniEventManager()

0 comments on commit 417f51a

Please sign in to comment.
You can’t perform that action at this time.