
The methodology used to generate this CL is documented in https://crbug.com/1098010#c95. No-Try: true No-Presubmit: true Bug: 1098010 Change-Id: I3a8a7b150e7bd64690534727150646081df50439 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3900697 Reviewed-by: Mark Mentovai <mark@chromium.org> Auto-Submit: Avi Drissman <avi@chromium.org> Owners-Override: Avi Drissman <avi@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/main@{#1047644}
22 lines
539 B
Python
22 lines
539 B
Python
# Copyright 2022 The Chromium Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
def GetFileNameFromPath(file_path: str) -> str:
|
|
return Path(file_path).name
|
|
|
|
|
|
def GetFileNameWithoutExtensionFromPath(file_path: str) -> str:
|
|
return Path(file_path).stem
|
|
|
|
|
|
def GetDirNameFromPath(file_path: str) -> str:
|
|
return str(Path(file_path).parent)
|
|
|
|
|
|
def JoinPath(dir_path: str, file_name: str) -> str:
|
|
return str(Path(dir_path).joinpath(file_name))
|