Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"window_unmap" : True,
"xsettings-tuple" : True,
"change-quality" : True,
"change-min-quality" : True,
"change-speed" : True,
"change-min-speed" : True,
"client_window_properties" : True,
"sound_sequence" : True,
"notify-startup-complete" : True,
"suspend-resume" : True,
"encoding.generic" : True,
"exit_server" : True,
"sound.server_driven" : True,
"server_type" : "base",
})
add_version_info(capabilities)
for k,v in codec_versions.items():
capabilities["encoding.%s.version" % k] = v
return capabilities
"window_unmap" : True,
"xsettings-tuple" : True,
"change-quality" : True,
"change-min-quality" : True,
"change-speed" : True,
"change-min-speed" : True,
"client_window_properties" : True,
"sound_sequence" : True,
"notify-startup-complete" : True,
"suspend-resume" : True,
"encoding.generic" : True,
"exit_server" : True,
"sound.server_driven" : True,
"server_type" : "base",
})
add_version_info(capabilities)
for k,v in codec_versions.items():
capabilities["encoding.%s.version" % k] = v
return capabilities
def do_get_info(self, proto, server_sources, window_ids):
start = time.time()
info = {}
add_version_info(info, "server.")
info["server.type"] = "Python"
info["server.byteorder"] = sys.byteorder
info["server.platform"] = PLATFORM_NAME
info["server.platform.release"] = python_platform.release()
info["server.platform.platform"] = python_platform.platform()
if sys.platform.startswith("linux"):
info["server.platform.linux_distribution"] = python_platform.linux_distribution()
info["server.pid"] = os.getpid()
for x in ("uid", "gid"):
if hasattr(os, "get%s" % x):
try:
info["server."+x] = getattr(os, "get%s" % x)()
except:
pass
info["server.hostname"] = socket.gethostname()
info["server.start_time"] = int(self.start_time)
#this function is for non UI thread info
info = {
prefix+"pid" : os.getpid(),
prefix+"byteorder" : sys.byteorder,
prefix+"hostname" : socket.gethostname(),
prefix+"python.full_version": sys.version,
prefix+"python.version" : sys.version_info[:3],
}
for x in ("uid", "gid"):
if hasattr(os, "get%s" % x):
try:
info[prefix+x] = getattr(os, "get%s" % x)()
except:
pass
info.update(get_platform_info(prefix))
add_version_info(info, prefix)
return info
"window_refresh_config" : True,
"xsettings-tuple" : True,
"change-quality" : True,
"change-min-quality" : True,
"change-speed" : True,
"change-min-speed" : True,
"client_window_properties" : True,
"sound_sequence" : True,
"notify-startup-complete" : True,
"suspend-resume" : True,
"encoding.generic" : True,
"exit_server" : True,
"sound.server_driven" : True,
"server_type" : "base",
})
add_version_info(capabilities)
for k,v in codec_versions.items():
capabilities["encoding.%s.version" % k] = v
return capabilities
capabilities.update({
"start_time" : int(self.start_time),
"current_time" : int(now),
"elapsed_time" : int(now - self.start_time),
"server_type" : "core",
"info-request" : True,
"uuid" : get_user_uuid(),
})
mid = get_machine_id()
if mid:
capabilities["machine_id"] = mid
if self.session_name:
capabilities["session_name"] = self.session_name
if self._reverse_aliases:
capabilities["aliases"] = self._reverse_aliases
add_version_info(capabilities)
return capabilities
def make_hello(self, challenge_response=None):
capabilities = {}
add_version_info(capabilities)
if challenge_response:
assert self.password
capabilities["challenge_response"] = challenge_response
if self.encryption:
assert self.encryption in ENCRYPTION_CIPHERS
capabilities["cipher"] = self.encryption
iv = get_hex_uuid()[:16]
capabilities["cipher.iv"] = iv
key_salt = get_hex_uuid()
capabilities["cipher.key_salt"] = key_salt
iterations = 1000
capabilities["cipher.key_stretch_iterations"] = iterations
self._protocol.set_cipher_in(self.encryption, iv, self.get_password(), key_salt, iterations)
log("encryption capabilities: %s", [(k,v) for k,v in capabilities.items() if k.startswith("cipher")])
if self.encoding:
capabilities["encoding"] = self.encoding
def make_hello(self, challenge_response=None):
capabilities = {}
add_version_info(capabilities)
capabilities["python.version"] = sys.version_info[:3]
if challenge_response:
assert self.password
capabilities["challenge_response"] = challenge_response
if self.encryption:
assert self.encryption in ENCRYPTION_CIPHERS
capabilities["cipher"] = self.encryption
iv = get_hex_uuid()[:16]
capabilities["cipher.iv"] = iv
key_salt = get_hex_uuid()
capabilities["cipher.key_salt"] = key_salt
iterations = 1000
capabilities["cipher.key_stretch_iterations"] = iterations
self._protocol.set_cipher_in(self.encryption, iv, self.get_password(), key_salt, iterations)
log("encryption capabilities: %s", [(k,v) for k,v in capabilities.items() if k.startswith("cipher")])
capabilities["platform"] = sys.platform
def do_get_info(self, proto, server_sources, window_ids):
start = time.time()
info = {}
add_version_info(info)
add_gtk_version_info(info, gtk)
info["hostname"] = socket.gethostname()
info["root_window_size"] = gtk.gdk.get_default_root_window().get_size()
info["max_desktop_size"] = self.get_max_screen_size()
info["session_name"] = self.session_name or ""
info["password_file"] = self.password_file or ""
info["randr"] = self.randr
info["clipboard"] = self._clipboard_helper is not None
info["cursors"] = self.cursors
info["bell"] = self.bell
info["notifications"] = self.notifications_forwarder is not None
info["pulseaudio"] = self.pulseaudio
info["start_time"] = int(self.start_time)
info["encodings"] = ",".join(ENCODINGS)
info["platform"] = sys.platform
info["python_version"] = python_platform.python_version()