def getEditorURL(tag, name, path):
    basePath = ""
    lineNo = 0
    colNo1 = 0
    colNo2 = 0

    if "basePath" in tag.attributes:
        basePath = tag.attributes["basePath"]
    if "lineNo" in tag.attributes:
        lineNo = tag.attributes["lineNo"]
    if "colNo1" in tag.attributes:
        colNo1 = tag.attributes["colNo1"]
    if "colNo2" in tag.attributes:
        colNo2 = tag.attributes["colNo2"]

    escapedBasePath = basePath.replace("\\", "/")
    escapedPath = path.replace("\\", "/")

    return {name: "javascript: parent.edit('%s', '%s', %s, %s, %s);" \
        % (escapedBasePath, escapedPath, lineNo, colNo1, colNo2)}
dataset/ETHPy150Open joehewitt/devon/devon/renderers/html.py/getEditorURL/original