mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
move grouper to extractor
This commit is contained in:
parent
3ac01c5543
commit
8d74d69a01
3 changed files with 12 additions and 14 deletions
|
|
@ -24,7 +24,6 @@ from .lib_old import (
|
|||
add_tool_to_environment,
|
||||
modified_environ,
|
||||
pairwise,
|
||||
grouper,
|
||||
is_latest,
|
||||
any_outdated,
|
||||
_rreplace,
|
||||
|
|
|
|||
|
|
@ -235,18 +235,6 @@ def pairwise(iterable):
|
|||
return itertools.izip(a, a)
|
||||
|
||||
|
||||
def grouper(iterable, n, fillvalue=None):
|
||||
"""Collect data into fixed-length chunks or blocks
|
||||
|
||||
Examples:
|
||||
grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx
|
||||
|
||||
"""
|
||||
|
||||
args = [iter(iterable)] * n
|
||||
return itertools.izip_longest(fillvalue=fillvalue, *args)
|
||||
|
||||
|
||||
def is_latest(representation):
|
||||
"""Return whether the representation is from latest version
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Extract camera as Maya Scene."""
|
||||
import os
|
||||
import itertools
|
||||
|
||||
from maya import cmds
|
||||
|
||||
import avalon.maya
|
||||
import pype.api
|
||||
from pype.lib import grouper
|
||||
from pype.hosts.maya import lib
|
||||
|
||||
|
||||
|
|
@ -36,6 +36,17 @@ def massage_ma_file(path):
|
|||
f.close()
|
||||
|
||||
|
||||
def grouper(iterable, n, fillvalue=None):
|
||||
"""Collect data into fixed-length chunks or blocks.
|
||||
|
||||
Examples:
|
||||
grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx
|
||||
|
||||
"""
|
||||
args = [iter(iterable)] * n
|
||||
return itertools.izip_longest(fillvalue=fillvalue, *args)
|
||||
|
||||
|
||||
def unlock(plug):
|
||||
"""Unlocks attribute and disconnects inputs for a plug.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue