Skip to content
Permalink
Browse files
Reformat via black.
  • Loading branch information
captainhammy committed Jan 27, 2020
1 parent f16ba09 commit a13bd34f4d60c05082e4c60ece13f52a59dffa70
Show file tree
Hide file tree
Showing 112 changed files with 5,936 additions and 2,387 deletions.
@@ -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")