Skip to content

Commit b32ef2d

Browse files
committed
Add get_canonical_path() to public API
1 parent 08674a8 commit b32ef2d

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

clade/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,3 +876,19 @@ def get_ref_from(self, files=None):
876876
files = set(files)
877877

878878
return self.CrossRef.load_ref_from_by_file(files)
879+
880+
@property
881+
def Alternatives(self):
882+
"""Object of "Alternatives" extension."""
883+
return self.__get_ext_obj("Alternatives")
884+
885+
def get_canonical_path(self, path):
886+
"""Returns a canonical path for a given path
887+
888+
For example. if "/lib/header.h" and "/lib/x86_64/header.h" files are the same,
889+
then:
890+
* get_canonical_path("/lib/header.h") == "/lib/header.h"
891+
* get_canonical_path("/lib/x86_64/header.h") == "/lib/header.h"
892+
"""
893+
894+
return self.Alternatives.get_canonical_path(path)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def finalize_options(self):
220220

221221
setuptools.setup(
222222
name="clade",
223-
version="4.0.2",
223+
version="4.0.3",
224224
author="Ilya Shchepetkov",
225225
author_email="shchepetkov@ispras.ru",
226226
url="https://github.com/17451k/clade",

0 commit comments

Comments
 (0)