From 61db34a4d6950eb8cfb3e5f9c624d41a9a96f394 Mon Sep 17 00:00:00 2001 From: Anthony Johnson Date: Tue, 27 Oct 2015 11:28:07 -0700 Subject: [PATCH] Move include path to base object --- autoapi/mappers/base.py | 12 ++++++++++++ autoapi/mappers/dotnet.py | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/autoapi/mappers/base.py b/autoapi/mappers/base.py index 7a9cffe..ce1c5bd 100644 --- a/autoapi/mappers/base.py +++ b/autoapi/mappers/base.py @@ -124,6 +124,18 @@ class PythonMapperBase(object): slug = re.sub(r'[^\w\.]+', '-', slug).strip('-') return os.path.join(*slug.split('.')) + @property + def include_path(self): + """Return 'absolute' path without regarding OS path separator + + This is used in ``toctree`` directives, as Sphinx always expects Unix + path separators + """ + parts = [self.url_root] + parts.extend(self.pathname.split(os.path.sep)) + parts.append('index') + return '/'.join(parts) + @property def ref_type(self): return self.type diff --git a/autoapi/mappers/dotnet.py b/autoapi/mappers/dotnet.py index 05786e0..89bb945 100644 --- a/autoapi/mappers/dotnet.py +++ b/autoapi/mappers/dotnet.py @@ -356,18 +356,6 @@ class DotNetPythonMapper(PythonMapperBase): '''Same as above, return the truncated name instead''' return self.ref_name.split('.')[-1] - @property - def include_path(self): - """Return 'absolute' path without regarding OS path separator - - This is used in ``toctree`` directives, as Sphinx always expects Unix - path separators - """ - parts = [self.url_root] - parts.extend(self.pathname.split(os.path.sep)) - parts.append('index') - return '/'.join(parts) - @staticmethod def transform_doc_comments(text): """