Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# -*- coding: utf-8 -*- 

2# This file is part of Xpra. 

3# Copyright (C) 2020 Antoine Martin <antoine@xpra.org> 

4# Xpra is released under the terms of the GNU GPL v2, or, at your option, any 

5# later version. See the file COPYING for details. 

6#pylint: disable-msg=E1101 

7 

8from xpra.server.mixins.stub_server_mixin import StubServerMixin 

9 

10""" 

11Mixin for adding shell support 

12""" 

13class ShellServer(StubServerMixin): 

14 

15 def get_info(self, _source=None) -> dict: 

16 return { 

17 "shell" : True, 

18 } 

19 

20 def get_server_features(self, _source) -> dict: 

21 return { 

22 "shell" : True, 

23 } 

24 

25 def _process_shell_exec(self, proto, packet): 

26 code = packet[1] 

27 ss = self.get_server_source(proto) 

28 if ss: 

29 ss.shell_exec(code) 

30 

31 

32 def init_packet_handlers(self): 

33 self.add_packet_handlers({ 

34 "shell-exec" : self._process_shell_exec, 

35 }, False)