From 23d7e3a00efb2c5c772391925ba9e382067a0b47 Mon Sep 17 00:00:00 2001
From: "michele.maris" <michele.maris@inaf.it>
Date: Sat, 18 Feb 2023 22:45:27 +0100
Subject: [PATCH] u

---
 src/yapsut/template_subs.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/yapsut/template_subs.py b/src/yapsut/template_subs.py
index 703bff5..f024b16 100644
--- a/src/yapsut/template_subs.py
+++ b/src/yapsut/template_subs.py
@@ -23,7 +23,9 @@ def discoverKeys(template,kbraeket,verbose=False) :
       except : 
          raise Exception('file ended while scanning end of keyword')
       if verbose : print(i1,i2)
-      out.append(template[i1:i2+1])
+      kkk=template[i1:i2+1]
+      if not kkk in out :
+         out.append(kkk)
       i1=i2+1
    return out
    
@@ -108,7 +110,7 @@ class templateFiller:
       if not self.isfilled() :
          raise Exception('Error, not all the keywords are filled')
       #
-      tout=template
+      tout=self._t
       for ik,k in enumerate(self._k) :
          keyName=self._kfill[ik]
          tout=tout.replace(keyName,self._d[k])
-- 
GitLab