def saveTestSatelliteScripts(url, path, ctx): """ uploads all scripts those test or suite depends on to remote server from the context """ document_root = contrib.get_document_root(path) virtual_root = contrib.get_virtual_root(path) log.info('save satellite scripts for: %s' % path) saveAllLibraries(document_root, virtual_root, url, path, ctx) saveToolsAllScripts(url, document_root, virtual_root, ctx)
def search_view_ext(request, path=None, search_pattern=None, as_json=False, global_search=True): path = request.GET.get('path', path) search_pattern = request.GET.get('search_pattern',search_pattern) as_json = request.GET.get('as_json', as_json) document_root = contrib.get_document_root(path) if global_search: path = contrib.get_virtual_root(path) full_path = contrib.get_full_path(document_root, path) print path, full_path, document_root folders = [ full_path ] log.debug(locals()) if os.path.isfile(full_path): folders = [ os.path.dirname(full_path) ] path = os.path.dirname( path ) return search_view(request, folders, path, search_pattern, as_json)
def add_virtual_root(ctximpl, path): vroot = contrib.get_virtual_root(path) if vroot: ctximpl.add('__virtual_root__', vroot)