Skip to content
Permalink
Browse files

Reformat via black.

  • Loading branch information
captainhammy committed Jan 27, 2020
1 parent f16ba09 commit a13bd34f4d60c05082e4c60ece13f52a59dffa70
Showing with 5,936 additions and 2,387 deletions.
  1. +6 −4 .pylint.rc
  2. +1 −1 bin/run_lint
  3. +4 −1 houdini/pyfilter/ht-pyfilter.py
  4. +5 −2 houdini/python2.7libs/nodegraphhooks.py
  5. +1 −0 houdini/python2.7libs/pythonrc.py
  6. +1 −0 houdini/scripts/456.py
  7. +1 −0 houdini/scripts/OnCreated.py
  8. +1 −0 houdini/scripts/OnDeleted.py
  9. +1 −0 houdini/scripts/OnInputChanged.py
  10. +1 −0 houdini/scripts/OnInstall.py
  11. +1 −0 houdini/scripts/OnLoaded.py
  12. +1 −0 houdini/scripts/OnNameChanged.py
  13. +1 −0 houdini/scripts/OnUninstall.py
  14. +1 −0 houdini/scripts/OnUpdated.py
  15. +1 −0 houdini/scripts/PostLastDelete.py
  16. +1 −0 houdini/scripts/PreFirstCreate.py
  17. +1 −0 houdini/scripts/SyncNodeVersion.py
  18. +8 −1 houdini/scripts/externaldragdrop.py
  19. +1 −0 houdini/soho/IFDuserhooks.py
  20. +10 −2 icons/icons.py
  21. +1 −1 pytest.ini
  22. +6 −1 python/ht/events/__init__.py
  23. +2 −0 python/ht/events/callbacks.py
  24. +1 −0 python/ht/events/event.py
  25. +9 −2 python/ht/events/events/rop_render.py
  26. +5 −6 python/ht/events/events/scene_load.py
  27. +1 −0 python/ht/events/group.py
  28. +5 −4 python/ht/events/item.py
  29. +5 −1 python/ht/events/manager.py
  30. +13 −7 python/ht/events/stats.py
  31. +3 −0 python/ht/events/types.py
  32. +7 −7 python/ht/geometry/pointcloud.py
  33. +3 −3 python/ht/inline/api.py
  34. +97 −191 python/ht/inline/lib.py
  35. +8 −19 python/ht/inline/utils.py
  36. +5 −1 python/ht/logging/adapters.py
  37. +2 −1 python/ht/logging/config.py
  38. +2 −1 python/ht/logging/shellio.py
  39. +26 −15 python/ht/machinery/argparser.py
  40. +47 −92 python/ht/machinery/package.py
  41. +69 −47 python/ht/machinery/sidefx_web_api.py
  42. +4 −9 python/ht/nodes/badges.py
  43. +24 −28 python/ht/nodes/helpcard.py
  44. +1 −0 python/ht/nodes/naming.py
  45. +1 −0 python/ht/nodes/styles/event.py
  46. +13 −21 python/ht/nodes/styles/manager.py
  47. +4 −0 python/ht/nodes/styles/styles.py
  48. +5 −1 python/ht/pyfilter/manager.py
  49. +35 −14 python/ht/pyfilter/operations/deepimage.py
  50. +63 −19 python/ht/pyfilter/operations/ipoverrides.py
  51. +2 −1 python/ht/pyfilter/operations/logoutput.py
  52. +4 −5 python/ht/pyfilter/operations/operation.py
  53. +5 −4 python/ht/pyfilter/operations/primaryimage.py
  54. +20 −37 python/ht/pyfilter/operations/setproperties.py
  55. +1 −0 python/ht/pyfilter/operations/settilecallback.py
  56. +3 −5 python/ht/pyfilter/operations/zdepth.py
  57. +2 −0 python/ht/pyfilter/property.py
  58. +1 −0 python/ht/pyfilter/utils.py
  59. +1 −4 python/ht/sohohooks/aovs/__init__.py
  60. +24 −34 python/ht/sohohooks/aovs/aov.py
  61. +12 −24 python/ht/sohohooks/aovs/manager.py
  62. +3 −4 python/ht/sohohooks/manager.py
  63. +56 −86 python/ht/ui/aovs/dialogs.py
  64. +27 −29 python/ht/ui/aovs/models.py
  65. +16 −25 python/ht/ui/aovs/utils.py
  66. +117 −124 python/ht/ui/aovs/widgets.py
  67. +1,290 −7 python/ht/ui/icons.py
  68. +6 −3 python/ht/ui/menus/opmenu.py
  69. +10 −2 python/ht/ui/menus/parmmenu.py
  70. +4 −1 python/ht/ui/paste/__init__.py
  71. +52 −10 python/ht/ui/paste/dialogs.py
  72. +73 −10 python/ht/ui/paste/helpers.py
  73. +78 −9 python/ht/ui/paste/models.py
  74. +13 −5 python/ht/ui/paste/sources.py
  75. +6 −3 python/ht/ui/paste/utils.py
  76. +186 −50 python/ht/ui/paste/widgets.py
  77. +1 −0 python/ht/utils.py
  78. +2 −4 tests/conftest.py
  79. +30 −10 tests/events/events/test_rop_render.py
  80. +5 −2 tests/events/events/test_scene_load.py
  81. +7 −2 tests/events/test_callbacks.py
  82. +44 −12 tests/events/test_event.py
  83. +7 −2 tests/events/test_group.py
  84. +99 −27 tests/events/test_item.py
  85. +91 −36 tests/events/test_manager.py
  86. +78 −25 tests/events/test_stats.py
  87. +908 −316 tests/inline/test_api.py
  88. +89 −101 tests/inline/test_api_integration.py
  89. +8 −13 tests/inline/test_utils.py
  90. +168 −62 tests/logging/test_adapters.py
  91. +24 −8 tests/logging/test_shellio.py
  92. +7 −2 tests/nodes/styles/test_event.py
  93. +230 −92 tests/nodes/styles/test_manager.py
  94. +79 −21 tests/nodes/styles/test_styles.py
  95. +45 −20 tests/nodes/test_badges.py
  96. +4 −1 tests/pyfilter/operations/conftest.py
  97. +61 −31 tests/pyfilter/operations/test_deepimage.py
  98. +163 −78 tests/pyfilter/operations/test_ipoverrides.py
  99. +6 −4 tests/pyfilter/operations/test_logoutput.py
  100. +2 −0 tests/pyfilter/operations/test_operation.py
  101. +22 −6 tests/pyfilter/operations/test_primaryimage.py
  102. +226 −89 tests/pyfilter/operations/test_setproperties.py
  103. +8 −2 tests/pyfilter/operations/test_settilecallback.py
  104. +24 −14 tests/pyfilter/operations/test_zdepth.py
  105. +46 −26 tests/pyfilter/test_manager.py
  106. +1 −0 tests/pyfilter/test_property.py
  107. +4 −1 tests/pyfilter/test_utils.py
  108. +505 −190 tests/sohohooks/aovs/test_aov.py
  109. +275 −110 tests/sohohooks/aovs/test_manager.py
  110. +15 −5 tests/sohohooks/test_manager.py
  111. +2 −3 tests/ui/menus/test_opmenu.py
  112. +123 −88 tests/ui/menus/test_parmmenu.py
@@ -1,7 +1,7 @@

[MASTER]

extension-pkg-whitelist=PySide2
extension-pkg-whitelist=PySide2,PySide2.QtGui

ignore=CVS
ignore-patterns=icons.py
@@ -22,9 +22,11 @@ disable=import-error,
no-absolute-import,
duplicate-code,
fixme,
too-many-lines
too-many-lines,
bad-continuation

enable=c-extension-no-member
enable=c-extension-no-member,
no-else-return

[REPORTS]

@@ -153,7 +155,7 @@ ignored-classes=optparse.Values,
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=
ignored-modules=PySide2

# Show a hint with possible names when a member name was not found. The aspect
# of finding the hint is based on edit distance.
@@ -26,7 +26,7 @@ from six.moves import StringIO
# GLOBALS
# =============================================================================

_LINT_RC = '.pylint.rc'
_LINT_RC = ".pylint.rc"


# =============================================================================
@@ -37,6 +37,7 @@
# FUNCTIONS
# =============================================================================


def filterCamera():
"""Modify image related properties.
@@ -80,7 +81,9 @@ def filterError(level, message, prefix):
This function allows you to disable the printing of messages.
"""
result = _PYFILTER_MANAGER.run_operations_for_stage("filter_error", level, message, prefix)
result = _PYFILTER_MANAGER.run_operations_for_stage(
"filter_error", level, message, prefix
)

return result

@@ -16,14 +16,17 @@
# GLOBALS
# ==============================================================================

KEY_HIT_TYPES = ('keyhit', 'menukeyhit', 'parentkeyhit')
KEY_HIT_TYPES = ("keyhit", "menukeyhit", "parentkeyhit")


# ==============================================================================
# FUNCTIONS
# ==============================================================================

def createEventHandler(uievent, pending_actions): # pylint: disable=invalid-name,unused-argument

def createEventHandler(
uievent, pending_actions
): # pylint: disable=invalid-name,unused-argument
"""Create an event handler for Houdini's network editor.
:param uievent: The occurring event.
@@ -13,6 +13,7 @@
# Shell panes. We explicitly provide an alternate stream handler for output
# to only these pane tabs.
import ht.logging

ht.logging.init_config()

import ht.events
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def main():
"""Main function."""
run_event(SceneEvents.Load)
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def main():
"""Main function."""
run_event(NodeEvents.OnCreated, kwargs) # pylint: disable=undefined-variable
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def main():
"""Main function."""
run_event(NodeEvents.OnDeleted, kwargs) # pylint: disable=undefined-variable
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def main():
"""Main function."""
run_event(NodeEvents.OnInputChanged, kwargs) # pylint: disable=undefined-variable
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def main():
"""Main function."""
run_event(NodeEvents.OnInstall, kwargs) # pylint: disable=undefined-variable
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def main():
"""Main function."""
run_event(NodeEvents.OnLoaded, kwargs) # pylint: disable=undefined-variable
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def main():
"""Main function."""
run_event(NodeEvents.OnNameChanged, kwargs) # pylint: disable=undefined-variable
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def main():
"""Main function."""
run_event(NodeEvents.OnUninstall, kwargs) # pylint: disable=undefined-variable
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def main():
"""Main function."""
run_event(NodeEvents.OnUpdated, kwargs) # pylint: disable=undefined-variable
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def main():
"""Main function."""
run_event(NodeEvents.PostLastDelete, kwargs) # pylint: disable=undefined-variable
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def main():
"""Main function."""
run_event(NodeEvents.PreFirstCreate, kwargs) # pylint: disable=undefined-variable
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def main():
"""Main function."""
run_event(NodeEvents.SyncNodeVersion, kwargs) # pylint: disable=undefined-variable
@@ -15,6 +15,7 @@
# FUNCTIONS
# =============================================================================


def dropAccept(file_paths): # pylint: disable=invalid-name
"""Accept a list of files.
@@ -27,7 +28,13 @@ def dropAccept(file_paths): # pylint: disable=invalid-name
"""
# Let Houdini handle dropping .hip files.
if any([file_path for file_path in file_paths if os.path.splitext(file_path)[1] == ".hip"]):
if any(
[
file_path
for file_path in file_paths
if os.path.splitext(file_path)[1] == ".hip"
]
):
return False

scriptargs = {"file_paths": file_paths}
@@ -12,6 +12,7 @@
# FUNCTIONS
# =============================================================================


def call(hook_name="", *args, **kwargs): # pylint: disable=keyword-arg-before-vararg
"""Hook callback function.

Large diffs are not rendered by default.

@@ -1,3 +1,3 @@
[pytest]
addopts = --cov --cov-report=html --color=yes

qt_api=pyside2
@@ -6,7 +6,12 @@

# Houdini Toolbox Imports
from ht.events.events import rop_render, scene_load
from ht.events.manager import register_event_group, register_function, register_item, run_event
from ht.events.manager import (
register_event_group,
register_function,
register_item,
run_event,
)
from ht.events.types import HipFileEvents, NodeEvents, RopEvents, SceneEvents

# =============================================================================
@@ -19,6 +19,7 @@
# NON-PUBLIC FUNCTIONS
# =============================================================================


def _atexit_callback(*args, **kwargs): # pylint: disable=unused-argument
"""Run SceneEvents.Exit events.
@@ -73,6 +74,7 @@ def _register_when_ui_available():
# FUNCTIONS
# =============================================================================


def register_callbacks():
"""Register any dynamic callback functions.
@@ -13,6 +13,7 @@
# CLASSES
# =============================================================================


class HoudiniEventFactory(object):
"""Class responsible for determining event classes."""

@@ -26,6 +26,7 @@
# CLASSES
# =============================================================================


class RopRenderEvent(HoudiniEventGroup):
"""Event to run on ROP render script events."""

@@ -130,7 +131,9 @@ def post_write(self, scriptargs): # pylint: disable=no-self-use
"""
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"])
@@ -140,6 +143,7 @@ def post_write(self, scriptargs): # pylint: disable=no-self-use
# NON-PUBLIC FUNCTIONS
# =============================================================================


def _get_target_file(node):
"""Attempt to determine the target output file:
@@ -186,13 +190,16 @@ 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"]
)


# =============================================================================
# FUNCTIONS
# =============================================================================


def build_scriptargs(node=None):
"""Build relevant scriptargs for this action.
@@ -17,6 +17,7 @@
# CLASSES
# =============================================================================


class SceneLoadEvent(HoudiniEventGroup):
"""Event to run on scene load (456)."""

@@ -25,17 +26,15 @@ def __init__(self):

load_item = HoudiniEventItem((self.clear_session_settings,))

self.event_map.update(
{
SceneEvents.Load: load_item
}
)
self.event_map.update({SceneEvents.Load: load_item})

# -------------------------------------------------------------------------
# METHODS
# -------------------------------------------------------------------------

def clear_session_settings(self, scriptargs): # pylint: disable=no-self-use,unused-argument
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")
@@ -5,6 +5,7 @@
# CLASSES
# =============================================================================


class HoudiniEventGroup(object):
"""The Houdini event group class.
@@ -12,6 +12,7 @@
# IMPORTS
# =============================================================================


class HoudiniEventItem(object):
"""Class responsible for calling callable methods.
@@ -79,9 +80,7 @@ def __hash__(self):

def __repr__(self):
return "<{} {} ({} callables)>".format(
self.__class__.__name__,
self.name,
len(self.callables)
self.__class__.__name__, self.name, len(self.callables)
)

# -------------------------------------------------------------------------
@@ -146,7 +145,9 @@ class ExclusiveHoudiniEventItem(HoudiniEventItem):
_exclusive_map = {}

def __init__(self, callables, name, priority=1, stat_tags=None):
super(ExclusiveHoudiniEventItem, self).__init__(callables, name, priority, stat_tags)
super(ExclusiveHoudiniEventItem, self).__init__(
callables, name, priority, stat_tags
)

# Get the current entry (or add this item if one isn't set.)
exclusive_item = self._exclusive_map.setdefault(name, self)
@@ -21,6 +21,7 @@
# CLASSES
# =============================================================================


class HoudiniEventManager(object):
"""Manager and execute events in Houdini."""

@@ -139,7 +140,9 @@ def register_event_group(self, event_group):
"""
if not isinstance(event_group, HoudiniEventGroup):
raise TypeError("Expected HoudiniEventGroup, got {}".format(type(event_group)))
raise TypeError(
"Expected HoudiniEventGroup, got {}".format(type(event_group))
)

event_mappings = event_group.event_map

@@ -202,6 +205,7 @@ def run_event(self, event_name, scriptargs=None):
# FUNCTIONS
# =============================================================================


def register_event_group(event_group):
"""Register a HoudiniEvent.

0 comments on commit a13bd34

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