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@21813 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 22, 2019
1 parent 44eedf1 commit 653b9d0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/xpra/platform/darwin/shadow_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import Quartz.CoreGraphics as CG #@UnresolvedImport

from xpra.util import envbool
from xpra.os_util import memoryview_to_bytes, _buffer
from xpra.server.gtk_server_base import GTKServerBase
from xpra.server.shadow.gtk_shadow_server_base import GTKShadowServerBase
from xpra.platform.darwin.keyboard_config import KeyboardConfig
Expand All @@ -28,13 +29,13 @@
CG.kCGImageAlphaNoneSkipFirst : "SkipFirst",
}

BTYPES = tuple(x for x in (str, bytes, memoryview, _buffer, bytearray) if x is not None)

#ensure that picture_encode can deal with pixels as NSCFData:
def patch_picture_encode():
from CoreFoundation import CFDataGetBytes, CFDataGetLength #@UnresolvedImport
from xpra.os_util import memoryview_to_bytes, _buffer
btypes = [x for x in (str, bytes, memoryview, _buffer, bytearray) if x is not None]
def pixels_to_bytes(v):
if type(v) in btypes:
if isinstance(v, BTYPES):
return memoryview_to_bytes(v)
l = CFDataGetLength(v)
return CFDataGetBytes(v, (0, l), None)
Expand Down Expand Up @@ -94,7 +95,8 @@ def get_keyboard_config(self, _props=None):

def make_tray_widget(self):
from xpra.client.gtk_base.statusicon_tray import GTKStatusIconTray
return GTKStatusIconTray(self, 0, self.tray, "Xpra Shadow Server", None, None, self.tray_click_callback, mouseover_cb=None, exit_cb=self.tray_exit_callback)
return GTKStatusIconTray(self, 0, self.tray, "Xpra Shadow Server", None, None,
self.tray_click_callback, mouseover_cb=None, exit_cb=self.tray_exit_callback)


def setup_capture(self):
Expand Down Expand Up @@ -138,9 +140,8 @@ def start_refresh(self, wid):
if err==0:
self.refresh_registered = True
return
else:
log.warn("Warning: CGRegisterScreenRefreshCallback failed with error %i", err)
log.warn(" using fallback timer method")
log.warn("Warning: CGRegisterScreenRefreshCallback failed with error %i", err)
log.warn(" using fallback timer method")
GTKShadowServerBase.start_refresh(self, wid)

def stop_refresh(self, wid):
Expand Down

0 comments on commit 653b9d0

Please sign in to comment.