Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update compare_resolution function (BugFix) #1683

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
1 change: 1 addition & 0 deletions checkbox-core-snap/series16/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ parts:
- python3-requests-unixsocket
- python3-serial
- python3-setuptools
- python3-tk
- python3-yaml
- pyotherside
- libbluetooth3
Expand Down
1 change: 1 addition & 0 deletions checkbox-core-snap/series18/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ parts:
source-type: local
stage-packages:
- python3-requests-unixsocket
- python3-tk
- libbluetooth3
- libsystemd0
- v4l-utils
Expand Down
1 change: 1 addition & 0 deletions checkbox-core-snap/series20/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ parts:
- python3-distutils
- python3-pkg-resources
- python3.8-minimal
- python3-tk
build-packages:
- libbluetooth-dev
- libsystemd-dev
Expand Down
1 change: 1 addition & 0 deletions checkbox-core-snap/series22/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ parts:
- python3-distutils
- python3-pkg-resources
- python3.10-minimal
- python3-tk
build-packages:
- libbluetooth-dev
- libsystemd-dev
Expand Down
1 change: 1 addition & 0 deletions checkbox-core-snap/series24/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ parts:
- python3-minimal
- python3-pkg-resources
- python3.12-minimal
- python3-tk
build-packages:
- libbluetooth-dev
- libsystemd-dev
Expand Down
15 changes: 10 additions & 5 deletions providers/base/bin/resolution_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import gi
import sys
import tkinter as tk

Check warning on line 5 in providers/base/bin/resolution_test.py

View check run for this annotation

Codecov / codecov/patch

providers/base/bin/resolution_test.py#L5

Added line #L5 was not covered by tests

from argparse import ArgumentParser

Expand All @@ -19,12 +20,16 @@


def compare_resolution(min_h, min_v):
# Evaluate just the primary display
screen = Gdk.Screen.get_default()
geom = screen.get_monitor_geometry(screen.get_primary_monitor())
try:
root = tk.Tk()
except tk.TclError as e:
print(e)
print("Are you sure the device is logged in and has a screen?")
width = root.winfo_screenwidth()
height = root.winfo_screenheight()

Check warning on line 29 in providers/base/bin/resolution_test.py

View check run for this annotation

Codecov / codecov/patch

providers/base/bin/resolution_test.py#L23-L29

Added lines #L23 - L29 were not covered by tests
print("Minimum acceptable display resolution: %d x %d" % (min_h, min_v))
print("Detected display resolution: %d x %d" % (geom.width, geom.height))
return geom.width >= min_h and geom.height >= min_v
print("Detected display resolution: %d x %d" % (width, height))
return width >= min_h and height >= min_v

Check warning on line 32 in providers/base/bin/resolution_test.py

View check run for this annotation

Codecov / codecov/patch

providers/base/bin/resolution_test.py#L31-L32

Added lines #L31 - L32 were not covered by tests


def main():
Expand Down
4 changes: 4 additions & 0 deletions providers/base/units/graphics/packaging.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ Depends: gnome-randr
unit: packaging meta-data
os-id: debian
Depends: gnome-screenshot

unit: packaging meta-data
os-id: debian
Depends: python3-tk
Loading