Skip to content

Commit 477d608

Browse files
committed
Add file header note for autogeneration and add comments
1 parent ce90362 commit 477d608

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/techui_builder/builder.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,23 @@ def _create_devsta_pv(self, prefix: str, inputs: list[str]):
111111

112112
def write_devsta_pvs(self):
113113
conf_dir = self._write_directory.parent.joinpath("config")
114+
115+
# Create the config/ dir if it doesn't exist
114116
if not conf_dir.exists():
115117
os.mkdir(conf_dir)
118+
116119
with open(conf_dir.joinpath("ioc.db"), "w") as f:
120+
# Add a header explaining the file is autogenerated
121+
f.write("#" * 51 + "\n")
122+
f.write(
123+
"#" * 2
124+
+ " THIS FILE HAS BEEN AUTOGENERATED; DO NOT EDIT "
125+
+ "#" * 2
126+
+ "\n"
127+
)
128+
f.write("#" * 51 + "\n")
129+
130+
# Write the devsta PVs
117131
for dpv in self.devsta_pvs.values():
118132
dpv.Print(f)
119133

0 commit comments

Comments
 (0)