Example #1
0
def delocalise(nodes=None):
    """Chance localized file paths to remote file paths.
    (eg. /mnt/scratch/localise_path/_asset/wud/ma becomes /asset/wud/ma)"""

    nodes = _smart_nodelist_expand(nodes)
    for knob in _file_knobs(nodes):
        searchreplace.__ReplaceKnobValue(local_root, remote_root, knob)
        k = knob.node().knob('label')
        k.fromScript(k.toScript().replace('\n'+label_text, ''))
        k.fromScript(k.toScript().replace(label_text, ''))
        # Remove warning tile colour from node 
        k.node().knob('tile_color').fromScript('0')
Example #2
0
def delocalise(nodes=None):
    """Chance localized file paths to remote file paths.
    (eg. /mnt/scratch/localise_path/_asset/wud/ma becomes /asset/wud/ma)"""

    nodes = _smart_nodelist_expand(nodes)
    for knob in _file_knobs(nodes):
        searchreplace.__ReplaceKnobValue(local_root, remote_root, knob)
        k = knob.node().knob('label')
        k.fromScript(k.toScript().replace('\n' + label_text, ''))
        k.fromScript(k.toScript().replace(label_text, ''))
        # Remove warning tile colour from node
        k.node().knob('tile_color').fromScript('0')
Example #3
0
def localise_path(nodes=None):
    """Change remote file paths to localised_path file paths. 
    (eg. /asset/wud/ma becomes /mnt/scratch/localise_path/_asset/wud/ma)"""

    nodes = _smart_nodelist_expand(nodes)
    for knob in _file_knobs(nodes):
        # Don't double-localise_path.
        if localised_path(knob.node()): continue
        # Munge path
        searchreplace.__ReplaceKnobValue(remote_root, local_root, knob)
        # Add reminder text to node's label
        k = knob.node().knob('label')
        if k.value() == "": k.fromScript(label_text)
        else: k.fromScript("\n".join([k.toScript(), label_text]))
        # Colour the node as a further reminder that we've mangled the path
        k.node().knob('tile_color').fromScript(warning_colour)
Example #4
0
def localise_path(nodes=None):
    """Change remote file paths to localised_path file paths. 
    (eg. /asset/wud/ma becomes /mnt/scratch/localise_path/_asset/wud/ma)"""

    nodes = _smart_nodelist_expand(nodes)
    for knob in _file_knobs(nodes):
        # Don't double-localise_path.
        if localised_path(knob.node()): continue
        # Munge path
        searchreplace.__ReplaceKnobValue(remote_root, local_root, knob)
        # Add reminder text to node's label
        k = knob.node().knob('label')
        if k.value() == "": k.fromScript(label_text)
        else: k.fromScript("\n".join([k.toScript(), label_text]))
        # Colour the node as a further reminder that we've mangled the path
        k.node().knob('tile_color').fromScript(warning_colour)
Example #5
0
def localise_proxy_path(nodes=None):
    """Set the proxy path to the local path for this file."""

    nodes = _smart_nodelist_expand(nodes)
    print nodes
    for node in [node for node in nodes if 'proxy' in node.knobs()]:
        knob = node.knob('proxy')
        # Don't double-localise_path.
        if localised_proxy_path(node): 
            print 'skipping', knob.name()
            continue
        # Assign and munge path
        knob.fromScript( node.knob('file').toScript() )
        searchreplace.__ReplaceKnobValue(remote_root, local_root, knob)
        # Add reminder text to node's label
        k = knob.node().knob('label')
        if k.value() == "": k.fromScript(proxy_label_text)
        else: k.fromScript("\n".join([k.toScript(), proxy_label_text]))
        # Colour the node as a further reminder that we've mangled the path
        k.node().knob('tile_color').fromScript(proxy_warning_colour)
Example #6
0
def localise_proxy_path(nodes=None):
    """Set the proxy path to the local path for this file."""

    nodes = _smart_nodelist_expand(nodes)
    print nodes
    for node in [node for node in nodes if 'proxy' in node.knobs()]:
        knob = node.knob('proxy')
        # Don't double-localise_path.
        if localised_proxy_path(node):
            print 'skipping', knob.name()
            continue
        # Assign and munge path
        knob.fromScript(node.knob('file').toScript())
        searchreplace.__ReplaceKnobValue(remote_root, local_root, knob)
        # Add reminder text to node's label
        k = knob.node().knob('label')
        if k.value() == "": k.fromScript(proxy_label_text)
        else: k.fromScript("\n".join([k.toScript(), proxy_label_text]))
        # Colour the node as a further reminder that we've mangled the path
        k.node().knob('tile_color').fromScript(proxy_warning_colour)