equal
deleted
inserted
replaced
6 # GNU General Public License version 2 or any later version. |
6 # GNU General Public License version 2 or any later version. |
7 |
7 |
8 |
8 |
9 import errno |
9 import errno |
10 import os |
10 import os |
|
11 |
|
12 from typing import ( |
|
13 List, |
|
14 Tuple, |
|
15 ) |
11 |
16 |
12 from .i18n import _ |
17 from .i18n import _ |
13 from . import ( |
18 from . import ( |
14 encoding, |
19 encoding, |
15 error, |
20 error, |
105 return result[2] |
110 return result[2] |
106 |
111 |
107 def sections(self): |
112 def sections(self): |
108 return sorted(self._data.keys()) |
113 return sorted(self._data.keys()) |
109 |
114 |
110 def items(self, section): |
115 def items(self, section: bytes) -> List[Tuple[bytes, bytes]]: |
111 items = self._data.get(section, {}).items() |
116 items = self._data.get(section, {}).items() |
112 return [(k, v[0]) for (k, v) in items] |
117 return [(k, v[0]) for (k, v) in items] |
113 |
118 |
114 def set(self, section, item, value, source=b""): |
119 def set(self, section, item, value, source=b""): |
115 assert not isinstance( |
120 assert not isinstance( |