Skip to content

Commit

Permalink
fix docstring location and silence some minor pylint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Mar 21, 2021
1 parent a6f72f0 commit 9e5f3ce
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 34 deletions.
35 changes: 17 additions & 18 deletions xpra/server/source/client_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,24 @@
counter = AtomicInteger()


"""
This class mediates between the server class (which only knows about actual window objects and display server events)
and the client specific WindowSource instances (which only know about window ids
and manage window pixel compression).
It sends messages to the client via its 'protocol' instance (the network connection),
directly for a number of cases (cursor, sound, notifications, etc)
or on behalf of the window sources for pixel data.
Strategy: if we have 'ordinary_packets' to send, send those.
When we don't, then send packets from the 'packet_queue'. (compressed pixels or clipboard data)
See 'next_packet'.
The UI thread calls damage(), which goes into WindowSource and eventually (batching may be involved)
adds the damage pixels ready for processing to the encode_work_queue,
items are picked off by the separate 'encode' thread (see 'encode_loop')
and added to the damage_packet_queue.
"""

class ClientConnection(StubSourceMixin):
"""
This class mediates between the server class (which only knows about actual window objects and display server events)
and the client specific WindowSource instances (which only know about window ids
and manage window pixel compression).
It sends messages to the client via its 'protocol' instance (the network connection),
directly for a number of cases (cursor, sound, notifications, etc)
or on behalf of the window sources for pixel data.
Strategy: if we have 'ordinary_packets' to send, send those.
When we don't, then send packets from the 'packet_queue'. (compressed pixels or clipboard data)
See 'next_packet'.
The UI thread calls damage(), which goes into WindowSource and eventually (batching may be involved)
adds the damage pixels ready for processing to the encode_work_queue,
items are picked off by the separate 'encode' thread (see 'encode_loop')
and added to the damage_packet_queue.
"""

def __init__(self, protocol, disconnect_cb, session_name,
setting_changed,
Expand Down
6 changes: 3 additions & 3 deletions xpra/server/source/dbus_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from xpra.util import typedict


"""
Expose the ClientConnection using a dbus service
"""
class DBUS_Mixin(StubSourceMixin):
"""
Expose the ClientConnection using a dbus service
"""

@classmethod
def is_needed(cls, caps : typedict) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion xpra/server/source/shell_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def do_shell_exec(self, code):
stderr = io.StringIO()
with redirect_stdout(stdout):
with redirect_stderr(stderr):
exec(code, _globals, {})
exec(code, _globals, {}) #pylint: disable=exec-used
return stdout.getvalue().encode("utf8"), stderr.getvalue().encode("utf8")
except Exception as e:
log("shell_exec(..)", exc_info=True)
Expand Down
2 changes: 1 addition & 1 deletion xpra/server/source/stub_source_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class StubSourceMixin:
"""

@classmethod
def is_needed(cls, caps : typedict) -> bool:
def is_needed(cls, caps : typedict) -> bool: #pylint: disable=unused-argument
"""
Is this mixin needed for the caps given?
"""
Expand Down
8 changes: 4 additions & 4 deletions xpra/server/source/webcam_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def valid_encodings(args):
return encodings


"""
Handle webcam forwarding.
"""
class WebcamMixin(StubSourceMixin):
"""
Handle webcam forwarding.
"""

@classmethod
def is_needed(cls, caps : typedict) -> bool:
Expand Down Expand Up @@ -74,7 +74,7 @@ def get_info(self) -> dict:
}


def get_device_options(self, device_id : int):
def get_device_options(self, device_id : int): #pylint: disable=unused-argument
if not POSIX or OSX or not self.webcam_enabled:
return {}
if self.webcam_device:
Expand Down
14 changes: 7 additions & 7 deletions xpra/server/source/windows_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
PROPERTIES_DEBUG = [x.strip() for x in os.environ.get("XPRA_WINDOW_PROPERTIES_DEBUG", "").split(",")]


"""
Handle window forwarding:
- damage
- geometry
- events
etc
"""
class WindowsMixin(StubSourceMixin):
"""
Handle window forwarding:
- damage
- geometry
- events
etc
"""

@classmethod
def is_needed(cls, caps : typedict) -> bool:
Expand Down

0 comments on commit 9e5f3ce

Please sign in to comment.