mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-16 08:44:52 +02:00
Fix invalid escape sequences
This commit is contained in:
parent
1414bdcadf
commit
18002a7580
@ -226,7 +226,7 @@ class Qemu(BaseManager):
|
||||
else:
|
||||
try:
|
||||
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:
|
||||
version = match.group(1)
|
||||
return version
|
||||
|
@ -701,7 +701,7 @@ class VMware(BaseManager):
|
||||
path = ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH)
|
||||
ctypes.windll.shell32.SHGetFolderPathW(None, 5, None, 0, path)
|
||||
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"):
|
||||
return [os.path.expanduser("~/Documents/Virtual Machines.localized")]
|
||||
else:
|
||||
|
@ -60,7 +60,7 @@ def parse_version(version):
|
||||
"""
|
||||
|
||||
release_type_found = False
|
||||
version_infos = re.split('(\.|[a-z]+)', version)
|
||||
version_infos = re.split(r'(\.|[a-z]+)', version)
|
||||
version = []
|
||||
for info in version_infos:
|
||||
if info == '.' or len(info) == 0:
|
||||
|
@ -46,7 +46,7 @@ def _get_windows_interfaces_from_registry():
|
||||
hkeycard = winreg.OpenKey(hkey, network_card_id)
|
||||
guid, _ = winreg.QueryValueEx(hkeycard, "ServiceName")
|
||||
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)
|
||||
name, _ = winreg.QueryValueEx(hkeycon, "Name")
|
||||
interface = r"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{}".format(guid)
|
||||
@ -92,7 +92,7 @@ def get_windows_interfaces():
|
||||
interfaces = []
|
||||
try:
|
||||
locator = win32com.client.Dispatch("WbemScripting.SWbemLocator")
|
||||
service = locator.ConnectServer(".", "root\cimv2")
|
||||
service = locator.ConnectServer(".", r"root\cimv2")
|
||||
network_configs = service.InstancesOf("Win32_NetworkAdapterConfiguration")
|
||||
# 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"):
|
||||
|
Loading…
Reference in New Issue
Block a user