Skip to content

Commit

Permalink
- changed the try/except for gef restore to indicate which sett…
Browse files Browse the repository at this point in the history
…ing name is missing
  • Loading branch information
hugsy committed Jan 30, 2022
1 parent 545fa28 commit 8c8c838
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions gef.py
Expand Up @@ -4623,7 +4623,7 @@ def pre_load(self) -> None: pass
def post_load(self) -> None: pass

def __get_setting_name(self, name: str) -> str:
clsname = self.__class__._cmdline_.replace(" ", "_")
clsname = self.__class__._cmdline_.replace(" ", "-")
return f"{clsname}.{name}"

def __iter__(self) -> Generator[str, None, None]:
Expand Down Expand Up @@ -10854,16 +10854,16 @@ def invoke(self, args: str, from_tty: bool) -> None:

# load the other options
for optname in cfg.options(section):
key = f"{section}.{optname}"
try:
key = f"{section}.{optname}"
new_value = cfg.get(section, optname)
_type = gef.config.raw_entry(key).type
if _type == bool:
new_value = True if new_value.upper() in ("TRUE", "T", "1") else False
new_value = _type(new_value)
gef.config[key] = new_value
setting = gef.config.raw_entry(key)
except Exception as e:
warn(e)
warn(f"Invalid setting '{key}': {e}")
continue
new_value = cfg.get(section, optname)
if setting.type == bool:
new_value = True if new_value.upper() in ("TRUE", "T", "1") else False
setting.value = setting.type(new_value)

# ensure that the temporary directory always exists
gef_makedirs(gef.config["gef.tempdir"])
Expand Down

0 comments on commit 8c8c838

Please sign in to comment.