Skip to content

Commit 1ec0ba5

Browse files
committed
Minor refactoring
1 parent 2c39e7d commit 1ec0ba5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

osbot_utils/utils/Misc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,15 +428,15 @@ def random_password(length=24, prefix=''):
428428
password = password.replace(item, '_')
429429
return password
430430

431-
def random_string(length=8,prefix=''):
431+
def random_string(length:int=8,prefix:str=''):
432432
return prefix + ''.join(random.choices(string.ascii_uppercase, k=length)).lower()
433433

434-
def random_string_and_numbers(length=6,prefix=''):
434+
def random_string_and_numbers(length:int=6,prefix:str=''):
435435
return prefix + ''.join(random.choices(string.ascii_uppercase + string.digits, k=length))
436436

437-
def random_text(prefix=None,length=12):
437+
def random_text(prefix:str=None,length:int=12):
438438
if prefix is None: prefix = 'text_'
439-
if last_letter(prefix) != '_':
439+
if last_letter(prefix) not in ['_','/']:
440440
prefix += '_'
441441
return random_string_and_numbers(length=length, prefix=prefix)
442442

0 commit comments

Comments
 (0)