Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ jobs:
- name: Install borgbackup
run: |
if [[ "$TOXENV" == *"llfuse"* ]]; then
pip install -ve ".[llfuse]"
pip install -ve ".[llfuse,cockpit,s3,sftp]"
elif [[ "$TOXENV" == *"pyfuse3"* ]]; then
pip install -ve ".[pyfuse3]"
pip install -ve ".[pyfuse3,cockpit,s3,sftp]"
elif [[ "$TOXENV" == *"mfusepy"* ]]; then
pip install -ve ".[mfusepy]"
pip install -ve ".[mfusepy,cockpit,s3,sftp]"
else
pip install -ve .
pip install -ve ".[cockpit,s3,sftp]"
fi

- name: Build Borg fat binaries (${{ matrix.binary }})
Expand All @@ -295,6 +295,8 @@ jobs:
./borg-dir/borg.exe -V
tar czf borg.tgz borg-dir
popd
# Ensure locally built binary in ./dist/binary/borg-dir is found during tests
export PATH="$GITHUB_WORKSPACE/dist/binary/borg-dir:$PATH"
echo "borg.exe binary in PATH"
borg.exe -V

Expand Down Expand Up @@ -425,7 +427,7 @@ jobs:
pip -V
python -m pip install --upgrade pip wheel
pip install -r requirements.d/development.txt
pip install -e ".[mfusepy]"
pip install -e ".[mfusepy,cockpit,s3,sftp]"
tox -e py311-mfusepy

if [[ "${{ matrix.do_binaries }}" == "true" && "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
Expand Down Expand Up @@ -582,7 +584,7 @@ jobs:
run: |
# build borg.exe
. env/bin/activate
pip install -e .
pip install -e ".[cockpit,s3,sftp]"
mkdir -p dist/binary
pyinstaller -y --clean --distpath=dist/binary scripts/borg.exe.spec
# build sdist and wheel in dist/...
Expand Down
1 change: 1 addition & 0 deletions scripts/borg.exe.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ a = Analysis([os.path.join(basepath, 'src', 'borg', '__main__.py'), ],
binaries=[],
datas=[
(os.path.join(basepath, 'src', 'borg', 'paperkey.html'), 'borg'),
(os.path.join(basepath, 'src', 'borg', 'cockpit', 'cockpit.tcss'), os.path.join('borg', 'cockpit')),
],
hiddenimports=hiddenimports,
hookspath=[],
Expand Down
19 changes: 12 additions & 7 deletions src/borg/cockpit/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,27 @@ def on_load(self) -> None:

def on_mount(self) -> None:
"""Initialize components."""
from .runner import BorgRunner

self.query_one("#logo").styles.animate("opacity", 1, duration=1)
self.query_one("#slogan").styles.animate("opacity", 1, duration=1)

self.start_time = time.monotonic()
self.process_running = True
args = getattr(self, "borg_args", ["--version"]) # Default to safe command if none passed
self.runner = BorgRunner(args, self.handle_log_event)
self.runner_task = asyncio.create_task(self.runner.start())
# Delay runner start until after widgets are fully mounted
self.call_after_refresh(self.start_runner)

def start_runner(self) -> None:
"""Start the Borg runner after all widgets are mounted."""
from .runner import BorgRunner

# Speed tracking
self.total_lines_processed = 0
self.last_lines_processed = 0
self.speed_timer = self.set_interval(1.0, self.compute_speed)

self.start_time = time.monotonic()
self.process_running = True
args = getattr(self, "borg_args", ["--version"]) # Default to safe command if none passed
self.runner = BorgRunner(args, self.handle_log_event)
self.runner_task = asyncio.create_task(self.runner.start())

def compute_speed(self) -> None:
"""Calculate and update speed (lines per second)."""
current_lines = self.total_lines_processed
Expand Down
Loading