Permalink
Browse files

Mostly code/doc style cleanup.

Fixed an issue with outputting AOV groups.
  • Loading branch information...
captainhammy committed Aug 8, 2016
1 parent f6a12e4 commit 1451676c7f6c92ac3df31b6f90e1c9fc3aec1140
@@ -58,8 +58,7 @@ static PRM_Name languages[] =
};
static PRM_ChoiceList languageMenu(
(PRM_ChoiceListType)(PRM_CHOICELIST_EXCLUSIVE
| PRM_CHOICELIST_REPLACE),
(PRM_ChoiceListType)(PRM_CHOICELIST_EXCLUSIVE | PRM_CHOICELIST_REPLACE),
languages);
static PRM_Template *
@@ -77,7 +76,7 @@ getTemplates()
// Separator between frame/take parms and the code parm.
theTemplate[0] = PRM_Template(PRM_SEPARATOR, 1, &names[0]);
// String paramater containing the code to run. Horizontally
// String parameter containing the code to run. Horizontally
// joined to the next parm.
theTemplate[1] = PRM_Template(PRM_STRING, 1, &names[1], &defaults[0]);
theTemplate[1].setJoinNext(true);
View
@@ -1,9 +1,5 @@
#!/usr/bin/python
"""Launch Houdini related applications.
"""
__author__ = "Graham Thompson"
__email__ = "captainhammy@gmail.com"
"""Launch Houdini related applications."""
# =============================================================================
# IMPORTS
@@ -18,7 +14,7 @@ import sys
import ht.houdini.wrapper
# =============================================================================
# CONSTANTS
# GLOBALS
# =============================================================================
# Signals we want to handle and their names.
@@ -30,24 +26,17 @@ SIGNALS = {
}
# =============================================================================
# FUNCTIONS
# NON-PUBLIC FUNCTIONS
# =============================================================================
# -----------------------------------------------------------------------------
# Name: _handler
# Args: signalNum : (int)
# The signal number.
# frame : (object)
# The current stack frame.
# Raises: N/A
# Returns: None
# Desc: Signal handler to catch incoming signals and kill the process
# group. This allows things like the Render Scheduler to kill
# Mantra renders.
# -----------------------------------------------------------------------------
def _handler(signalNum, frame):
signalName = SIGNALS[signalNum]
print "Houdini wrapper caught sig SIG{0}".format(signalName)
def _handler(signal_num, frame):
"""Signal handler to catch incoming signals and kill the process group.
This allows things like the Render Scheduler to kill Mantra renders.
"""
signal_name = SIGNALS[signal_num]
print "Houdini wrapper caught sig SIG{}".format(signal_name)
# Ignore further signals.
for sig in SIGNALS:
@@ -62,13 +51,12 @@ def _handler(signalNum, frame):
# Exit with non-default status.
sys.exit(1)
# -----------------------------------------------------------------------------
# Name: main
# Raises: N/A
# Returns: None
# Desc: Main function.
# -----------------------------------------------------------------------------
# =============================================================================
# FUNCTIONS
# =============================================================================
def main():
"""Main function."""
# Handle specified signals.
for sig in SIGNALS:
signal.signal(sig, _handler)
@@ -1,7 +1,5 @@
#!/usr/bin/python
"""Handle creating and removing symlinks for custom Houdini wrapper.
"""
"""Handle creating and removing symlinks for custom Houdini wrapper."""
# =============================================================================
# IMPORTS
@@ -15,7 +13,7 @@ import stat
import ht.argument
# =============================================================================
# CONSTANTS
# GLOBALS
# =============================================================================
# Default applications to install.
@@ -40,17 +38,11 @@ _DEFAULT_APPS = [
]
# =============================================================================
# FUNCTIONS
# NON-PUBLIC FUNCTIONS
# =============================================================================
# -----------------------------------------------------------------------------
# Name: _buildParser
# Raises: N/A
# Returns: ht.argument.ArgumentParser
# The application argument parser.
# Desc: Build an argument parser to handle input.
# -----------------------------------------------------------------------------
def _buildParser():
"""Build an argument parser to handle input."""
parser = ht.argument.ArgumentParser()
parser.add_argument(
@@ -74,16 +66,16 @@ def _buildParser():
# Create an exclusive group since we can only either install or uninstall
# at the same time.
installGroup = parser.add_mutually_exclusive_group()
install_group = parser.add_mutually_exclusive_group()
installGroup.add_argument(
install_group.add_argument(
"-install",
action="store_true",
default=False,
help="Install symlinks."
)
installGroup.add_argument(
install_group.add_argument(
"-uninstall",
action="store_true",
default=False,
@@ -92,13 +84,12 @@ def _buildParser():
return parser
# -----------------------------------------------------------------------------
# Name: main
# Raises: N/A
# Returns: None
# Desc: Main function.
# -----------------------------------------------------------------------------
# =============================================================================
# FUNCTIONS
# =============================================================================
def main():
"""Main function."""
# Build the parser and parse the args.
parser = _buildParser()
arguments = parser.parse_args()
@@ -125,39 +116,39 @@ def main():
# Process each application to handle.
for application in arguments.apps:
# Build the link path.
linkPath = os.path.join(directory, application)
link_path = os.path.join(directory, application)
# Create the link.
if arguments.install:
print "Creating {link} -> {target}".format(
link=linkPath,
link=link_path,
target=wrapper
)
os.symlink(wrapper, linkPath)
os.symlink(wrapper, link_path)
# Set links to be executable.
st = os.stat(linkPath)
os.chmod(linkPath, st.st_mode | stat.S_IEXEC)
st = os.stat(link_path)
os.chmod(link_path, st.st_mode | stat.S_IEXEC)
# Try to remove the link.
elif arguments.uninstall:
# If the link isn't pointing to the specified wrapper we can't
# remove it.
if os.path.realpath(linkPath) != wrapper:
print "Warning: Cannot remove {0}. Not linked to {1}".format(
linkPath,
if os.path.realpath(link_path) != wrapper:
print "Warning: Cannot remove {}. Not linked to {}".format(
link_path,
wrapper
)
continue
print "Removing {link} -> {target}".format(
link=linkPath,
link=link_path,
target=wrapper
)
# Remove the link.
os.unlink(linkPath)
os.unlink(link_path)
# =============================================================================
@@ -18,9 +18,6 @@ def main():
ht.nodes.colors.colorNode(node)
# if ht.nodes.naming.isNamespacedType(node.type()):
# ht.nodes.naming.setNamespacedFormattedName(node)
# =============================================================================
main()
Oops, something went wrong.

0 comments on commit 1451676

Please sign in to comment.