mirror of
https://github.com/GNS3/gns3-server
synced 2025-07-06 23:02:38 +00:00
Fix invalid escape sequences
This commit is contained in:
parent
1414bdcadf
commit
18002a7580
@ -226,7 +226,7 @@ class Qemu(BaseManager):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
output = await subprocess_check_output(qemu_path, "-version", "-nographic")
|
output = await subprocess_check_output(qemu_path, "-version", "-nographic")
|
||||||
match = re.search("version\s+([0-9a-z\-\.]+)", output)
|
match = re.search(r"version\s+([0-9a-z\-\.]+)", output)
|
||||||
if match:
|
if match:
|
||||||
version = match.group(1)
|
version = match.group(1)
|
||||||
return version
|
return version
|
||||||
|
@ -701,7 +701,7 @@ class VMware(BaseManager):
|
|||||||
path = ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH)
|
path = ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH)
|
||||||
ctypes.windll.shell32.SHGetFolderPathW(None, 5, None, 0, path)
|
ctypes.windll.shell32.SHGetFolderPathW(None, 5, None, 0, path)
|
||||||
documents_folder = path.value
|
documents_folder = path.value
|
||||||
return ['{}\My Virtual Machines'.format(documents_folder), '{}\Virtual Machines'.format(documents_folder)]
|
return [r'{}\My Virtual Machines'.format(documents_folder), r'{}\Virtual Machines'.format(documents_folder)]
|
||||||
elif sys.platform.startswith("darwin"):
|
elif sys.platform.startswith("darwin"):
|
||||||
return [os.path.expanduser("~/Documents/Virtual Machines.localized")]
|
return [os.path.expanduser("~/Documents/Virtual Machines.localized")]
|
||||||
else:
|
else:
|
||||||
|
@ -60,7 +60,7 @@ def parse_version(version):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
release_type_found = False
|
release_type_found = False
|
||||||
version_infos = re.split('(\.|[a-z]+)', version)
|
version_infos = re.split(r'(\.|[a-z]+)', version)
|
||||||
version = []
|
version = []
|
||||||
for info in version_infos:
|
for info in version_infos:
|
||||||
if info == '.' or len(info) == 0:
|
if info == '.' or len(info) == 0:
|
||||||
|
@ -46,7 +46,7 @@ def _get_windows_interfaces_from_registry():
|
|||||||
hkeycard = winreg.OpenKey(hkey, network_card_id)
|
hkeycard = winreg.OpenKey(hkey, network_card_id)
|
||||||
guid, _ = winreg.QueryValueEx(hkeycard, "ServiceName")
|
guid, _ = winreg.QueryValueEx(hkeycard, "ServiceName")
|
||||||
netcard, _ = winreg.QueryValueEx(hkeycard, "Description")
|
netcard, _ = winreg.QueryValueEx(hkeycard, "Description")
|
||||||
connection = r"SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}" + "\{}\Connection".format(guid)
|
connection = r"SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}" + r"\{}\Connection".format(guid)
|
||||||
hkeycon = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, connection)
|
hkeycon = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, connection)
|
||||||
name, _ = winreg.QueryValueEx(hkeycon, "Name")
|
name, _ = winreg.QueryValueEx(hkeycon, "Name")
|
||||||
interface = r"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{}".format(guid)
|
interface = r"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{}".format(guid)
|
||||||
@ -92,7 +92,7 @@ def get_windows_interfaces():
|
|||||||
interfaces = []
|
interfaces = []
|
||||||
try:
|
try:
|
||||||
locator = win32com.client.Dispatch("WbemScripting.SWbemLocator")
|
locator = win32com.client.Dispatch("WbemScripting.SWbemLocator")
|
||||||
service = locator.ConnectServer(".", "root\cimv2")
|
service = locator.ConnectServer(".", r"root\cimv2")
|
||||||
network_configs = service.InstancesOf("Win32_NetworkAdapterConfiguration")
|
network_configs = service.InstancesOf("Win32_NetworkAdapterConfiguration")
|
||||||
# more info on Win32_NetworkAdapter: http://msdn.microsoft.com/en-us/library/aa394216%28v=vs.85%29.aspx
|
# more info on Win32_NetworkAdapter: http://msdn.microsoft.com/en-us/library/aa394216%28v=vs.85%29.aspx
|
||||||
for adapter in service.InstancesOf("Win32_NetworkAdapter"):
|
for adapter in service.InstancesOf("Win32_NetworkAdapter"):
|
||||||
|
Loading…
Reference in New Issue
Block a user