Exemplo n.º 1
0
    def init(self, opts):
        self.compression_level = opts.compression_level
        self.display = opts.display
        self.username = opts.username
        self.password = opts.password
        self.password_file = opts.password_file
        self.encryption = opts.encryption or opts.tcp_encryption
        if self.encryption:
            crypto_backend_init()
        self.encryption_keyfile = opts.encryption_keyfile or opts.tcp_encryption_keyfile
        self.quality = opts.quality
        self.min_quality = opts.min_quality
        self.speed = opts.speed
        self.min_speed = opts.min_speed
        #printing and file transfer:
        FileTransferHandler.init_opts(self, opts)

        if DETECT_LEAKS:
            from xpra.util import detect_leaks
            detailed = []
            #example: warning, uses ugly direct import:
            #try:
            #    from xpra.x11.bindings.ximage import XShmImageWrapper       #@UnresolvedImport
            #    detailed.append(XShmImageWrapper)
            #except:
            #    pass
            print_leaks = detect_leaks(log, detailed)
            self.timeout_add(10 * 1000, print_leaks)
Exemplo n.º 2
0
 def __init__(self):
     StubClientMixin.__init__(self)
     FileTransferHandler.__init__(self)
     self.printer_attributes = []
     self.send_printers_timer = 0
     self.exported_printers = None
     self.remote_request_file = False
Exemplo n.º 3
0
    def init(self, opts):
        self.compression_level = opts.compression_level
        self.display = opts.display
        self.username = opts.username
        self.password_file = opts.password_file
        self.encryption = opts.encryption or opts.tcp_encryption
        self.encryption_keyfile = opts.encryption_keyfile or opts.tcp_encryption_keyfile
        self.quality = opts.quality
        self.min_quality = opts.min_quality
        self.speed = opts.speed
        self.min_speed = opts.min_speed
        #printing and file transfer:
        FileTransferHandler.init(self, opts)

        if DETECT_LEAKS:
            from xpra.util import detect_leaks
            detailed = []
            #example: warning, uses ugly direct import:
            #try:
            #    from xpra.x11.bindings.ximage import XShmImageWrapper       #@UnresolvedImport
            #    detailed.append(XShmImageWrapper)
            #except:
            #    pass
            print_leaks = detect_leaks(log, detailed)
            self.timeout_add(10*1000, print_leaks)
Exemplo n.º 4
0
 def test_file_transfer_handler(self):
     fth = FileTransferHandler()
     fth.init_attributes()
     assert fth.get_open_env()
     caps = typedict()
     fth.parse_file_transfer_caps(caps)
     assert fth.get_info()
     fth.cleanup()
Exemplo n.º 5
0
 def cleanup(self):
     FileTransferHandler.cleanup(self)
     reaper_cleanup()
     p = self._protocol
     log("XpraClientBase.cleanup() protocol=%s", p)
     if p:
         log("calling %s", p.close)
         p.close()
         self._protocol = None
     self.cleanup_printing()
     log("cleanup done")
     dump_all_frames()
Exemplo n.º 6
0
 def __init__(self):
     FileTransferHandler.__init__(self)
     self.supports_mmap = False
     self.mmap = None
     self.mmap_enabled = False
     self.session_name = ""
     self._focused = None
     self.readonly = False
     self.windows_enabled = True
     self.can_scale = True
     self.start_new_commands = True
     self.server_supports_bell = True
     self.client_supports_bell = True
     self.notifications_enabled = True
     self.client_supports_notifications = True
     self.cursors_enabled = True
     self.server_supports_cursors = True
     self.client_supports_cursors = True
     self.server_supports_clipboard = True
     self.client_supports_clipboard = True
     self.client_clipboard_direction = "both"
     self.quality = 80
     self.speed = 80
     self.encoding = "png"
     self.server_encodings_with_quality = []
     self.server_encodings_with_speed = []
     self.speaker_allowed = True
     self.speaker_enabled = True
     self.microphone_allowed = True
     self.microphone_enabled = True
     self.server_sound_send = True
     self.server_sound_receive = True
     self.server_readonly = False
     self.bell_enabled = True
     self.webcam_forwarding = True
     self.webcam_device = None
     self.server_virtual_video_devices = 0
     self.client_supports_opengl = False
     self.title = "test"
     self.keyboard_helper = None
     self.clipboard_helper = None
     self._id_to_window = {}
     self._window_to_id = {}
     self.server_window_decorations = False
     self.server_window_frame_extents = False
     self.encoding_defaults = {}
     self.window_configure_skip_geometry = True
     self.window_configure_pointer = True
     self.xscale = 1
     self.yscale = 1
     self.log_events = True
     self.handshake_callbacks = []
Exemplo n.º 7
0
 def __init__(self):
     FileTransferHandler.__init__(self)
     self.supports_mmap = False
     self.mmap = None
     self.mmap_enabled = False
     self.session_name = ""
     self._focused = None
     self.readonly = False
     self.windows_enabled = True
     self.can_scale = True
     self.start_new_commands = True
     self.server_supports_bell = True
     self.client_supports_bell = True
     self.notifications_enabled = True
     self.client_supports_notifications = True
     self.cursors_enabled = True
     self.server_supports_cursors = True
     self.client_supports_cursors = True
     self.server_supports_clipboard = True
     self.client_supports_clipboard = True
     self.client_clipboard_direction = "both"
     self.quality = 80
     self.speed = 80
     self.encoding = "png"
     self.server_encodings_with_quality = []
     self.server_encodings_with_speed = []
     self.speaker_allowed = True
     self.speaker_enabled = True
     self.microphone_allowed = True
     self.microphone_enabled = True
     self.server_sound_send = True
     self.server_sound_receive = True
     self.server_readonly = False
     self.bell_enabled = True
     self.webcam_forwarding = True
     self.webcam_device = None
     self.server_virtual_video_devices = 0
     self.client_supports_opengl = False
     self.title = "test"
     self.keyboard_helper = None
     self.clipboard_helper = None
     self._id_to_window = {}
     self._window_to_id = {}
     self.server_window_decorations = False
     self.server_window_frame_extents = False
     self.encoding_defaults = {}
     self.window_configure_skip_geometry = True
     self.window_configure_pointer = True
     self.xscale = 1
     self.yscale = 1
     self.log_events = True
     self.handshake_callbacks = []
Exemplo n.º 8
0
 def cleanup(self):
     reaper_cleanup()
     # we must clean printing before FileTransferHandler, which turns the printing flag off!
     self.cleanup_printing()
     FileTransferHandler.cleanup(self)
     p = self._protocol
     log("XpraClientBase.cleanup() protocol=%s", p)
     if p:
         log("calling %s", p.close)
         p.close()
         self._protocol = None
     log("cleanup done")
     dump_all_frames()
Exemplo n.º 9
0
 def cleanup(self):
     reaper_cleanup()
     #we must clean printing before FileTransferHandler, which turns the printing flag off!
     self.cleanup_printing()
     FileTransferHandler.cleanup(self)
     p = self._protocol
     log("XpraClientBase.cleanup() protocol=%s", p)
     if p:
         log("calling %s", p.close)
         p.close()
         self._protocol = None
     log("cleanup done")
     dump_all_frames()
Exemplo n.º 10
0
 def get_info(self):
     return {
         "printers": self.printers,
         "file-transfers": FileTransferHandler.get_info(self),
     }
Exemplo n.º 11
0
 def parse_client_caps(self, c):
     FileTransferHandler.parse_file_transfer_caps(self, c)
Exemplo n.º 12
0
 def parse_client_caps(self, c : dict):
     FileTransferHandler.parse_file_transfer_caps(self, c)
     self.machine_id = c.strget("machine_id")
Exemplo n.º 13
0
 def cleanup(self):
     #we must clean printing before FileTransferHandler, which turns the printing flag off!
     self.cleanup_printing()
     FileTransferHandler.cleanup(self)
Exemplo n.º 14
0
 def init(self, opts):
     #printing and file transfer:
     FileTransferHandler.init_opts(self, opts)
Exemplo n.º 15
0
 def init(self, opts, _extra_args=[]):
     #printing and file transfer:
     FileTransferHandler.init_opts(self, opts)
Exemplo n.º 16
0
 def __init__(self):
     FileTransferHandler.__init__(self)
     #this may be called more than once,
     #skip doing internal init again:
     if not hasattr(self, "exit_code"):
         self.defaults_init()
Exemplo n.º 17
0
 def __init__(self):
     FileTransferHandler.__init__(self)
     #this may be called more than once,
     #skip doing internal init again:
     if not hasattr(self, "exit_code"):
         self.defaults_init()
Exemplo n.º 18
0
 def test_file_transfer_handler(self):
     fth = FileTransferHandler()
     fth.init_attributes()
     assert fth.get_open_env()
     caps = typedict()
     fth.parse_file_transfer_caps(caps)
     assert fth.get_info()
     fth.check_digest("foo", "000", "000", "xor")
     try:
         fth.check_digest("foo", "000", "001", "sha1")
     except Exception:
         pass
     else:
         raise Exception("digest mismatch should trigger an exception!")
     fth.cleanup()