add pointer support for include
authorVolker Birk <vb@pep-project.org>
Thu, 08 Apr 2021 14:42:47 +0200
changeset 73 483d99ba1b16
parent 72 e52ee17bca47
child 74 c3c5a089072a
add pointer support for include
yml2/backend.py
--- a/yml2/backend.py	Thu Apr 08 14:37:11 2021 +0200
+++ b/yml2/backend.py	Thu Apr 08 14:42:47 2021 +0200
@@ -719,7 +719,7 @@
 
     elif ctype == "include":
         reverse = False
-        ktext, kxml = False, False
+        ktext, kxml, kpointer = False, False, False
         for arg in obj[1]:
             if type(arg) is tuple or type(arg) is Symbol:
                 if arg[0] == "reverse":
@@ -728,9 +728,14 @@
                     ktext = True
                 elif arg[0] == "kxml":
                     kxml = True
+                elif arg[0] == "kpointer":
+                    kpointer = True
             elif type(arg) is str:
                 filemask = arg
 
+        if kpointer:
+            filemask = pointer(filemask)
+
         if filemask[0] == '/' or filemask[0] == '.':
             files = sorted(glob(filemask))
         else: