From cbdc2e34d7fc499a7edb7c3a2c03a2a50c20cc43 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 20 Nov 2020 02:06:49 -0800 Subject: [PATCH] Remove leading underscore from normalize_percentage. --- rarpar.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/rarpar.py b/rarpar.py index 6bbc7e4..5b7e845 100644 --- a/rarpar.py +++ b/rarpar.py @@ -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(