Skip to content

Commit 48c25c9

Browse files
committed
feat: TemplateList proxy for configuration
Introduce a new proxy TemplateList similar to TemplateDict to handle list in configuration data structures, both TemplateList and TemplateDict interplay through the visitation.
1 parent a40caf0 commit 48c25c9

File tree

11 files changed

+411
-352
lines changed

11 files changed

+411
-352
lines changed

incipyt/_internal/dumpers.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,13 @@ def dump_in(self, config):
7575

7676

7777
class TextFile(BaseDumper):
78-
def dump_in(self, config):
79-
with self.open() as file:
80-
file.write(config[None])
81-
78+
def __init__(self, path, sep="\n", sanitizer=None):
79+
super().__init__(path, sanitizer)
80+
self._sep = sep
8281

83-
class Requirement(BaseDumper):
8482
def dump_in(self, config):
8583
with self.open() as file:
86-
file.write("\n".join(config[None]))
84+
file.write(self._sep.join(config) + self._sep)
8785

8886

8987
class Toml(BaseDumper):

0 commit comments

Comments
 (0)