From ad96bfd4d7f6442444750c08d412c8fae6bde827 Mon Sep 17 00:00:00 2001 From: Janne Jakob Fleischer Date: Thu, 16 Jan 2025 17:34:09 +0100 Subject: [PATCH] updated location + added readme.md --- tools/templaterenderer-djangotemplates/README.md | 11 +++++++++++ tools/templaterenderer.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tools/templaterenderer-djangotemplates/README.md diff --git a/tools/templaterenderer-djangotemplates/README.md b/tools/templaterenderer-djangotemplates/README.md new file mode 100644 index 00000000..a028fe8b --- /dev/null +++ b/tools/templaterenderer-djangotemplates/README.md @@ -0,0 +1,11 @@ +The script `templaterenderer.py' can be used to combine a django-template in plain xml and a xml-skeleton into one view-template that holds the skeleton and the (partially) html-encoded django-template which can be imported into RDMO. + +just start the script from your command line: + +```bash +python templaterenderer.py +``` + +It looks in the directory templaterenderer-djangotemplates for a pair of files. One ending with `.django`, one with `.xmlskeleton`. + +It exports a file into the shared folder. diff --git a/tools/templaterenderer.py b/tools/templaterenderer.py index 3bde295f..555a1cda 100644 --- a/tools/templaterenderer.py +++ b/tools/templaterenderer.py @@ -21,7 +21,7 @@ except IndexError: print('# The files do not hold a template-section. We try the next one.\n') continue - outfile_path = os.path.join(os.getcwd(), 'rdmorganiser/views', os.path.basename(template).rsplit('.',1)[0] + '.xml') + outfile_path = os.path.join(os.path.dirname(__file__), '..', 'shared', os.path.basename(template).rsplit('.',1)[0] + '.xml') with open( outfile_path, 'w',