1.1 --- a/moinformat/links/common.py Thu Apr 11 23:13:56 2019 +0200
1.2 +++ b/moinformat/links/common.py Fri Apr 12 00:08:39 2019 +0200
1.3 @@ -19,6 +19,27 @@
1.4 this program. If not, see <http://www.gnu.org/licenses/>.
1.5 """
1.6
1.7 +class Link:
1.8 +
1.9 + "A link abstraction."
1.10 +
1.11 + def __init__(self, target, label, type):
1.12 +
1.13 + "Initialise the link with the given 'target', 'label' and 'type'."
1.14 +
1.15 + self.target = target
1.16 + self.label = label
1.17 + self.type = type
1.18 +
1.19 + def get_target(self):
1.20 + return self.target
1.21 +
1.22 + def get_label(self):
1.23 + return self.label or self.target
1.24 +
1.25 + def get_type(self):
1.26 + return self.type
1.27 +
1.28 class Linker:
1.29
1.30 "Translate Moin links into other forms."
1.31 @@ -41,6 +62,7 @@
1.32
1.33 self.mapping = metadata.get("mapping", {})
1.34 self.root_pagename = metadata.get("root_pagename", "FrontPage")
1.35 + self.attachments_dir = metadata.get("attachments", "attachments")
1.36
1.37 def resolve(path, pagename, root_pagename):
1.38