Skip to content

Commit

Permalink
fix more pylint warnings
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@21823 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 22, 2019
1 parent f325ea9 commit 0383471
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/xpra/client/mixins/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self):
self.server_randr = False


def init(self, opts, _extra_args=[]):
def init(self, opts, _extra_args=()):
self.desktop_fullscreen = opts.desktop_fullscreen
self.desktop_scaling = opts.desktop_scaling
self.dpi = int(opts.dpi)
Expand Down Expand Up @@ -120,7 +120,9 @@ def get_caps(self):
sinfo = "%i%%" % iround(self.xscale*100)
else:
sinfo = "%i%% x %i%%" % (iround(self.xscale*100), iround(self.yscale*100))
log.info(" %sscaled to %s, virtual screen size: %ix%i", ["down", "up"][int(u_root_w>root_w or u_root_h>root_h)], sinfo, root_w, root_h)
scaled_up = u_root_w>root_w or u_root_h>root_h
log.info(" %sscaled to %s, virtual screen size: %ix%i",
"up" if scaled_up else "down", sinfo, root_w, root_h)
log_screen_sizes(root_w, root_h, sss)
else:
root_w, root_h = u_root_w, u_root_h
Expand Down Expand Up @@ -242,7 +244,8 @@ def process_ui_capabilities(self):
if not self.server_is_desktop and not skip_vfb_size_check and self.server_max_desktop_size:
avail_w, avail_h = self.server_max_desktop_size
root_w, root_h = self.get_root_size()
log("validating server_max_desktop_size=%s vs root size %s scaled to %s", self.server_max_desktop_size, (root_w, root_h), (self.cx(root_w), self.cy(root_h)))
log("validating server_max_desktop_size=%s vs root size %s scaled to %s",
self.server_max_desktop_size, (root_w, root_h), (self.cx(root_w), self.cy(root_h)))
if self.cx(root_w)>(avail_w+1) or self.cy(root_h)>(avail_h+1):
log.warn("Server's virtual screen is too small")
log.warn(" server: %sx%s vs client: %sx%s", avail_w, avail_h, self.cx(root_w), self.cy(root_h))
Expand Down Expand Up @@ -303,15 +306,17 @@ def _process_desktop_size(self, packet):


def may_adjust_scaling(self):
log("may_adjust_scaling() server_is_desktop=%s, desktop_fullscreen=%s", self.server_is_desktop, self.desktop_fullscreen)
log("may_adjust_scaling() server_is_desktop=%s, desktop_fullscreen=%s",
self.server_is_desktop, self.desktop_fullscreen)
if self.server_is_desktop and not self.desktop_fullscreen:
#don't try to make it fit
return
assert self.can_scale
max_w, max_h = self.server_max_desktop_size #ie: server limited to 8192x4096?
w, h = self.get_root_size() #ie: 5760, 2160
sw, sh = self.cp(w, h) #ie: upscaled to: 11520x4320
scalinglog("may_adjust_scaling() server desktop size=%s, client root size=%s", self.server_actual_desktop_size, self.get_root_size())
scalinglog("may_adjust_scaling() server desktop size=%s, client root size=%s",
self.server_actual_desktop_size, self.get_root_size())
scalinglog(" scaled client root size using %sx%s: %s", self.xscale, self.yscale, (sw, sh))
if sw<(max_w+1) and sh<(max_h+1):
#no change needed
Expand Down Expand Up @@ -406,7 +411,8 @@ def screen_size_changed(self, *args):
def do_process_screen_size_change(self):
self.screen_size_change_timer = None
self.update_screen_size()
log("do_process_screen_size_change() MONITOR_CHANGE_REINIT=%s, REINIT_WINDOWS=%s", MONITOR_CHANGE_REINIT, REINIT_WINDOWS)
log("do_process_screen_size_change() MONITOR_CHANGE_REINIT=%s, REINIT_WINDOWS=%s",
MONITOR_CHANGE_REINIT, REINIT_WINDOWS)
if MONITOR_CHANGE_REINIT and MONITOR_CHANGE_REINIT=="0":
return
if MONITOR_CHANGE_REINIT or REINIT_WINDOWS:
Expand Down Expand Up @@ -501,7 +507,8 @@ def scale_change(self, xchange=1, ychange=1):
scalinglog("scale_change(%s, %s) screen size change is already pending", xchange, ychange)
return
if monotonic_time()<self.scale_change_embargo:
scalinglog("scale_change(%s, %s) screen size change not permitted during embargo time - try again", xchange, ychange)
scalinglog("scale_change(%s, %s) screen size change not permitted during embargo time - try again",
xchange, ychange)
return
def clamp(v):
return max(MIN_SCALING, min(MAX_SCALING, v))
Expand Down

0 comments on commit 0383471

Please sign in to comment.