def enforcedLocalPath(relpath, dirpath, context='Path'):
 parsed_dir = urlparse(dirpath)
 parsed_rel = urlparse(relpath)
 if (parsed_rel.scheme not in ('file', '')):
  raise Core.KnownUnknown(('%s path must be a local file path, absolute or "file://", not "%s".' % (context, relpath)))
 if ((parsed_dir.scheme not in ('file', '')) and (parsed_rel.scheme != 'file')):
  raise Core.KnownUnknown(('%s path must start with "file://" in a remote configuration ("%s" relative to %s)' % (context, relpath, dirpath)))
 if (parsed_rel.scheme == 'file'):
  return parsed_rel.path
 if (parsed_dir.scheme == 'file'):
  return urljoin(parsed_dir.path, parsed_rel.path)
 return pathjoin(dirpath, relpath)

def enforcedLocalPath ( relpath , dirpath , context = 'Path' ) : parsed_dir = urlparse ( dirpath ) parsed_rel = urlparse ( relpath ) if ( parsed_rel . scheme not in ( 'file' , '' ) ) : raise Core . KnownUnknown ( ( '%s path must be a local file path, absolute or "file://", not "%s".' % ( context , relpath ) ) ) if ( ( parsed_dir . scheme not in ( 'file' , '' ) ) and ( parsed_rel . scheme != 'file' ) ) : raise Core . KnownUnknown ( ( '%s path must start with "file://" in a remote configuration ("%s" relative to %s)' % ( context , relpath , dirpath ) ) ) if ( parsed_rel . scheme == 'file' ) : return parsed_rel . path if ( parsed_dir . scheme == 'file' ) : return urljoin ( parsed_dir . path , parsed_rel . path ) return pathjoin ( dirpath , relpath )
return a forced local path .