Example #1
0
def register_diff_tool(tool):
  """
  Register a known diff tool, using an exemplar of its class.
  
  This exemplar will be cloned to create a new instance on each tool
  invocation, so any options provided to the exemplar will be used
  for all other instances of this tool (as will the exemplar's class).
  
  If the same tool is registered more than once, the last one wins.
  """
  ExternalTool.register('diff', tool)
  return
Example #2
0
def register_diff_tool(tool):
    """
  Register a known diff tool, using an exemplar of its class.
  
  This exemplar will be cloned to create a new instance on each tool
  invocation, so any options provided to the exemplar will be used
  for all other instances of this tool (as will the exemplar's class).
  
  If the same tool is registered more than once, the last one wins.
  """
    ExternalTool.register('diff', tool)
    return
Example #3
0
def find_diff_tool(name):
  """
  Find or create an instance of this diff tool. (DiffTool Factory)
  
  By default, create a generic TreeDiffTool, but do not register it; 
  options added to this instance should not be shared with other
  instances.
  """
  tool = ExternalTool.find('diff', name)
  if not tool:
    tool = TreeDiffTool(name)
    ExternalTool.check_path(name)

  return tool

# The End.
Example #4
0
def find_diff_tool(name):
    """
  Find or create an instance of this diff tool. (DiffTool Factory)
  
  By default, create a generic TreeDiffTool, but do not register it; 
  options added to this instance should not be shared with other
  instances.
  """
    tool = ExternalTool.find('diff', name)
    if not tool:
        tool = TreeDiffTool(name)
        ExternalTool.check_path(name)

    return tool


# The End.