def __ensure_config_setup(cls):
root = cls.__default_settings_root()
if not os.path.exists(root):
os.makedirs(root)
settings_file = os.path.join(root, 'settings.conf')
if not os.path.exists(settings_file):
with open(settings_file, 'w+b') as fh:
content = resource_stream("vpnporthole", "resources/settings.conf").read()
fh.write(content)
print("* Wrote: %s" % settings_file)
root = os.path.join(root, 'profiles')
if not os.path.exists(root):
os.makedirs(root)
profile_file = os.path.join(root, 'example.conf')
if not os.path.exists(profile_file):
with open(profile_file, 'w+b') as fh:
content = resource_stream("vpnporthole", "resources/example.conf").read()
fh.write(content)
print("* Wrote: %s" % profile_file)
评论列表
文章目录