acdcli.utils package

Submodules

acdcli.utils.conf module

acdcli.utils.conf.get_conf(path, filename, default_conf: configparser.ConfigParser) → configparser.ConfigParser[source]

acdcli.utils.hashing module

class acdcli.utils.hashing.IncrementalHasher[source]

Bases: object

__init__()[source]
get_result() → str[source]
hasher
update(chunk)[source]
acdcli.utils.hashing.hash_file(file_name: str) → str[source]
acdcli.utils.hashing.hash_file_obj(fo) → str[source]

acdcli.utils.progress module

class acdcli.utils.progress.FileProgress(total_sz: int, current: int = 0)[source]

Bases: object

__init__(total_sz: int, current: int = 0)[source]
current
done()[source]
reset()[source]
status
total
update(chunk)[source]
class acdcli.utils.progress.MultiProgress[source]

Bases: object

Container that accumulates multiple FileProgress objects

__init__()[source]
add(progress: acdcli.utils.progress.FileProgress)[source]
end()[source]
print_progress()[source]
acdcli.utils.progress.file_size_str(num: int, suffix='B') → str[source]
acdcli.utils.progress.speed_str(num: int, suffix='B', time_suffix='/s') → str[source]
acdcli.utils.progress.time_str(num: float) → str[source]

acdcli.utils.threading module

class acdcli.utils.threading.QueuedLoader(workers=1, print_progress=True, max_retries=0)[source]

Bases: object

Multi-threaded loader intended for file transfer jobs.

MAX_NUM_WORKERS = 8
MAX_RETRIES = 4
REFRESH_PROGRESS_INT = 0.3
__init__(workers=1, print_progress=True, max_retries=0)[source]
add_jobs(jobs: list)[source]
Parameters:jobs – list of partials that return a RetryRetVal and have a pg_handler kwarg
start() → int[source]

Starts worker threads and, if applicable, progress printer thread. :returns: accumulated return value

acdcli.utils.time module

acdcli.utils.time.datetime_to_timestamp(dt: datetime.datetime) → float[source]

Module contents