module documentation

String utilities

Function find_available_file Find a non-existing file name, with an index.
Function get_child_path Get last child of a path or itself if is the root directory.
Function get_parent_path Get parent directory or itself if is the root directory.
Function getchar Returns a single character from standard input
Function lJust Undocumented
Function lJustList Undocumented
Function mJust Undocumented
Function mJustList Undocumented
Function rJust Undocumented
Function rJustList Undocumented
Function sanitize_filename Replaces non-safe filename characters with '_'. Handles reserved window file names.
Function timedelta_format Undocumented
Variable filename_pattern Undocumented
Variable reserved_filename_pattern Undocumented
Variable time_periods Undocumented
def find_available_file(file: str, start_index: int = 0, separator: str = '-') -> str:

Find a non-existing file name, with an index.

The separator and the index will be added if the specified file already exist.

Accepted formatting:
  • '{sep}': separator between name and index, can be changed with 'separator' parameter
  • '{index}': file index

(e.g. 'log{sep}{index}.txt')

def get_child_path(path: str) -> str:

Get last child of a path or itself if is the root directory.

def get_parent_path(path: str) -> str:

Get parent directory or itself if is the root directory.

def getchar() -> str:

Returns a single character from standard input

def lJust(str: str, newLength: int, filler: str = ' ') -> str:

Undocumented

def lJustList(lst: list[str], newLength: int, filler: str = ' ') -> list[str]:

Undocumented

def mJust(left: str, right: str, newLength: int, filler: str = ' ') -> str:

Undocumented

def mJustList(left: list[str], right: list[str], newLength: int, filler: str = ' ') -> list[str]:

Undocumented

def rJust(str: str, newLength: int, filler: str = ' ') -> str:

Undocumented

def rJustList(lst: list[str], newLength: int, filler: str = ' ') -> list[str]:

Undocumented

def sanitize_filename(filename: str) -> str:

Replaces non-safe filename characters with '_'. Handles reserved window file names.

Source: https://github.com/Anuken/Arc/blob/master/arc-core/src/arc/util/Strings.java

def timedelta_format(delta_ms):

Undocumented

filename_pattern =

Undocumented

reserved_filename_pattern =

Undocumented

time_periods =

Undocumented