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) print(file)
shutil.move(file, directory) 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: if rec is None:
return None return None
@ -173,18 +185,6 @@ def _normalize_percentage(rec):
return 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): def _normalize_volume(volume, pathsize):
if volume is None: if volume is None:
return None return None
@ -297,9 +297,9 @@ def rarpar(
pathsize = path.size pathsize = path.size
volume = normalize_volume(volume, pathsize) volume = normalize_volume(volume, pathsize)
rec = _normalize_percentage(rec) rec = normalize_percentage(rec)
rev = _normalize_percentage(rev) rev = normalize_percentage(rev)
par = _normalize_percentage(par) par = normalize_percentage(par)
if RESERVE_SPACE_ON_DRIVE: if RESERVE_SPACE_ON_DRIVE:
assert_enough_space( assert_enough_space(