mirror of
https://github.com/httpie/cli.git
synced 2024-11-24 08:22:22 +02:00
Remove unused code in BasicConfig
(#1123)
This commit is contained in:
parent
4ff22defe4
commit
54c8612452
@ -93,7 +93,7 @@ class BaseConfigDict(dict):
|
|||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise ConfigFileError(f'cannot read {config_type} file: {e}')
|
raise ConfigFileError(f'cannot read {config_type} file: {e}')
|
||||||
|
|
||||||
def save(self, fail_silently=False):
|
def save(self):
|
||||||
self['__meta__'] = {
|
self['__meta__'] = {
|
||||||
'httpie': __version__
|
'httpie': __version__
|
||||||
}
|
}
|
||||||
@ -111,18 +111,7 @@ class BaseConfigDict(dict):
|
|||||||
sort_keys=True,
|
sort_keys=True,
|
||||||
ensure_ascii=True,
|
ensure_ascii=True,
|
||||||
)
|
)
|
||||||
try:
|
|
||||||
self.path.write_text(json_string + '\n', encoding=UTF8)
|
self.path.write_text(json_string + '\n', encoding=UTF8)
|
||||||
except OSError:
|
|
||||||
if not fail_silently:
|
|
||||||
raise
|
|
||||||
|
|
||||||
def delete(self):
|
|
||||||
try:
|
|
||||||
# TODO: use `missing_ok` kwarg when supporting Python 3.8+ only
|
|
||||||
self.path.unlink()
|
|
||||||
except FileNotFoundError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class Config(BaseConfigDict):
|
class Config(BaseConfigDict):
|
||||||
|
Loading…
Reference in New Issue
Block a user