| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import sys
- import pathlib
- test_file = pathlib.Path(__file__).absolute()
- test_dir = test_file.parent
- project_dir = test_dir.parent
- source_dir = project_dir / "src"
- sys.path.append(str(source_dir))
- import CxPini as pini
- f1 = pini.key()
- f1.name = "x"
- f1.value = 20
- f2 = pini.key()
- f2.name = "y"
- f2.value = 30
- f3 = pini.key()
- f3.name = "z"
- f4 = pini.key()
- f4.name = "a"
- f4.value = "VALUE"
- f4.comment = "This is key comment."
- global_section = pini.section()
- global_section.comment = "This is global section."
- global_section.add(f2)
- global_section.add(f1)
- other_section = pini.section()
- other_section.name = "Other"
- other_section.comment = "This is other section."
- other_section.add(f3)
- other_section.add(f4)
- other_section.add(f1)
- last_section = pini.section()
- last_section.name = "last"
- last_section.comment = "This is very last section."
- last_section.add(f1)
- last_section.add(f2)
- test = pini.pini()
- test.add(global_section)
- test.add(other_section)
- test.add(last_section)
- print(test)
|