Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add ability to supply custom start_time #232

Copy link
Copy link

Description

@mueslo
Issue body actions

Description

When hooking onto an existing "real" progress after it starts, e.g. one already running for a while in a thread, some of the displayed widget values are wildly wrong. AdaptiveETA() seems to deal with this quickly and well, however, Timer() erroneously starts from 0, and therefore also FileTransferSpeed() is very wrong.

Expected functionality

This is would be the interface that would make sense.

t = Thread(target=worker_thread,args=(path, progress, result, abort), daemon=True)
start_time = datetime.now()
t.start()

yield/time.sleep(10)  # pause this function for a while

with pb.ProgressBar(max_value=fsize, max_error=False,
                    widgets=widgets, start_time=start_time) as bar:
    while t.is_alive():
        bar.update(progress.value)

Proposed fix

I'm not familiar with the codebase, but #233 seems to work, but I have not done any in-depth testing.

Versions

  • Python version: 3.8.3
  • Package version: 3.51.3
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.