[O] Make directories constant
This commit is contained in:
@@ -59,28 +59,6 @@ def debug(msg: object) -> None:
|
||||
print(f'[DEBUG] {caller}: {msg}')
|
||||
|
||||
|
||||
def normalize_directory(directory: str) -> str:
|
||||
"""
|
||||
Normalize a directory input: Ensure that the directory doesn't end with "/", and ensure that an
|
||||
empty directory input will be relative (".")
|
||||
|
||||
>>> normalize_directory('')
|
||||
'.'
|
||||
>>> normalize_directory('path/')
|
||||
'path'
|
||||
>>> normalize_directory('path')
|
||||
'path'
|
||||
|
||||
:param directory: Input directory
|
||||
:return: Normalized directory
|
||||
"""
|
||||
if directory == '':
|
||||
directory = '.'
|
||||
if directory.endswith('/'):
|
||||
directory = directory[:-1]
|
||||
return directory
|
||||
|
||||
|
||||
def calculate_rate_delay(rate_limit: float) -> float:
|
||||
"""
|
||||
Calculate the rate delay for each request given rate limit in request per minute
|
||||
|
||||
Reference in New Issue
Block a user