Show More
@@ -1,8 +1,6 b'' | |||
|
1 | 1 | # deps, generated via pipdeptree --exclude setuptools,wheel,pipdeptree,pip -f | tr '[:upper:]' '[:lower:]' |
|
2 | 2 | |
|
3 | 3 | atomicwrites==1.4.1 |
|
4 | configobj==5.0.8 | |
|
5 | six==1.16.0 | |
|
6 | 4 | contextlib2==21.6.0 |
|
7 | 5 | cov-core==1.15.0 |
|
8 | 6 | coverage==7.2.1 |
@@ -18,8 +18,7 b'' | |||
|
18 | 18 | import os |
|
19 | 19 | import shutil |
|
20 | 20 | import tempfile |
|
21 | ||
|
22 | import configobj | |
|
21 | import configparser | |
|
23 | 22 | |
|
24 | 23 | |
|
25 | 24 | class ContextINI(object): |
@@ -53,17 +52,17 b' class ContextINI(object):' | |||
|
53 | 52 | with open(self.new_path, 'wb'): |
|
54 | 53 | pass |
|
55 | 54 | |
|
56 |
|
|
|
57 | self.new_path, file_error=True, write_empty_values=True) | |
|
55 | parser = configparser.ConfigParser() | |
|
56 | parser.read(self.ini_file_path) | |
|
58 | 57 | |
|
59 | 58 | for data in self.ini_params: |
|
60 | 59 | section, ini_params = list(data.items())[0] |
|
61 | 60 | key, val = list(ini_params.items())[0] |
|
62 |
if section not in |
|
|
63 |
|
|
|
64 |
|
|
|
65 | ||
|
66 |
|
|
|
61 | if section not in parser: | |
|
62 | parser[section] = {} | |
|
63 | parser[section][key] = val | |
|
64 | with open(self.ini_file_path, 'w') as f: | |
|
65 | parser.write(f) | |
|
67 | 66 | return self.new_path |
|
68 | 67 | |
|
69 | 68 | def __exit__(self, exc_type, exc_val, exc_tb): |
General Comments 0
You need to be logged in to leave comments.
Login now