Fix tinc-gui on Windows.
This commit is contained in:
parent
11d562e9b2
commit
ab583f7e8c
1 changed files with 4 additions and 4 deletions
|
@ -27,7 +27,7 @@ import time
|
||||||
from wx.lib.mixins.listctrl import ColumnSorterMixin
|
from wx.lib.mixins.listctrl import ColumnSorterMixin
|
||||||
from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin
|
from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin
|
||||||
|
|
||||||
if platform.system == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
import _winreg
|
import _winreg
|
||||||
|
|
||||||
# Classes to interface with a running tinc daemon
|
# Classes to interface with a running tinc daemon
|
||||||
|
@ -233,9 +233,9 @@ class VPN:
|
||||||
return int(resp[2])
|
return int(resp[2])
|
||||||
|
|
||||||
def __init__(self, netname = None, pidfile = None):
|
def __init__(self, netname = None, pidfile = None):
|
||||||
if platform.system == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
try:
|
try:
|
||||||
reg = _winreg.ConnectRegistry(None, HKEY_LOCAL_MACHINE)
|
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
|
||||||
key = _winreg.OpenKey(reg, "SOFTWARE\\tinc")
|
key = _winreg.OpenKey(reg, "SOFTWARE\\tinc")
|
||||||
VPN.confdir = _winreg.QueryValue(key, None)
|
VPN.confdir = _winreg.QueryValue(key, None)
|
||||||
except WindowsError:
|
except WindowsError:
|
||||||
|
@ -252,7 +252,7 @@ class VPN:
|
||||||
if pidfile != None:
|
if pidfile != None:
|
||||||
self.pidfile = pidfile
|
self.pidfile = pidfile
|
||||||
else:
|
else:
|
||||||
if platform.system == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
self.pidfile = os.path.join(self.confbase, 'pid')
|
self.pidfile = os.path.join(self.confbase, 'pid')
|
||||||
else:
|
else:
|
||||||
if netname:
|
if netname:
|
||||||
|
|
Loading…
Add table
Reference in a new issue