Remove leading underscore from normalize_percentage.

This commit is contained in:
voussoir 2020-11-20 02:06:49 -08:00
parent 26b4a33292
commit cbdc2e34d7

View file

@ -156,7 +156,19 @@ def move(pattern, directory):
print(file)
shutil.move(file, directory)
def _normalize_percentage(rec):
def normalize_password(password):
if password is None:
return None
if not isinstance(password, str):
raise TypeError(f'password must be a {str}, not {type(password)}')
if password == '':
return None
return password
def normalize_percentage(rec):
if rec is None:
return None
@ -173,18 +185,6 @@ def _normalize_percentage(rec):
return rec
def normalize_password(password):
if password is None:
return None
if not isinstance(password, str):
raise TypeError(f'password must be a {str}, not {type(password)}')
if password == '':
return None
return password
def _normalize_volume(volume, pathsize):
if volume is None:
return None
@ -297,9 +297,9 @@ def rarpar(
pathsize = path.size
volume = normalize_volume(volume, pathsize)
rec = _normalize_percentage(rec)
rev = _normalize_percentage(rev)
par = _normalize_percentage(par)
rec = normalize_percentage(rec)
rev = normalize_percentage(rev)
par = normalize_percentage(par)
if RESERVE_SPACE_ON_DRIVE:
assert_enough_space(