Initialize the object. :param content: The content of the ip_category.yaml file.
(self, content: str)
| 35 | _index: int = 0 |
| 36 | |
| 37 | def __init__(self, content: str): |
| 38 | """Initialize the object. |
| 39 | |
| 40 | :param content: The content of the ip_category.yaml file. |
| 41 | """ |
| 42 | self._content = content |
| 43 | self._index = len(CategoryFile.contents) |
| 44 | self._filename = os.path.join(CategoryFile.parent_directory, f'categories{self._index}.yaml') |
| 45 | CategoryFile.contents.append(self) |
| 46 | |
| 47 | def _write(self): |
| 48 | with open(self._filename, 'w') as f: |