'Create a link from a path'

def make_link(self, path):

    tryFile = path.replace('\\', '/')
    if (os.path.isabs(tryFile) and os.path.isfile(tryFile)):
        (folder, filename) = os.path.split(tryFile)
        (base, ext) = os.path.splitext(filename)
        app = current.request.args[0]
        editable = {'controllers': '.py', 'models': '.py', 'views': '.html'}
        l_ext = ext.lower()
        f_endswith = folder.endswith
        for key in editable.keys():
            check_extension = f_endswith(('%s/%s' % (app, key)))
            if ((l_ext == editable[key]) and check_extension):
                return A((('"' + tryFile) + '"'), _href=URL(('edit/%s/%s/%s' % (app, key, filename)))).xml()
    return ''
