From bcb813f8397d88c250cfd54e5b4d42c260b7798f Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Fri, 19 Aug 2016 20:24:20 +0300 Subject: [PATCH] Don't track actual default configuration file. Instead create it from tracked default --- .gitignore | 1 + pupy/{pupy.conf => pupy.conf.default} | 0 pupy/pupylib/PupyServer.py | 4 ++++ 3 files changed, 5 insertions(+) rename pupy/{pupy.conf => pupy.conf.default} (100%) diff --git a/.gitignore b/.gitignore index 76ecae0a..8bf4d79a 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ pupy/modules/lib/*.py[cod] pupy/modules/lib/**/*.py[cod] pupy/network/**/*.pyc pupy/scriptlets/**/*.pyc +pupy/pupy.conf # do not ignore package & templates files !pupy/packages/ diff --git a/pupy/pupy.conf b/pupy/pupy.conf.default similarity index 100% rename from pupy/pupy.conf rename to pupy/pupy.conf.default diff --git a/pupy/pupylib/PupyServer.py b/pupy/pupylib/PupyServer.py index becb0071..1ee08b2b 100644 --- a/pupy/pupylib/PupyServer.py +++ b/pupy/pupylib/PupyServer.py @@ -29,6 +29,8 @@ from pupylib.utils.rpyc_utils import obtain from .PupyTriggers import on_connect from network.lib.utils import parse_transports_args from network.lib.base_launcher import LauncherError +from os import path +from shutil import copyfile import network.conf import rpyc import shlex @@ -53,6 +55,8 @@ class PupyServer(threading.Thread): self.clients_lock=threading.Lock() self.current_id=1 self.config = configparser.ConfigParser() + if not path.exists('pupy.conf'): + copyfile('pupy.conf.default', 'pupy.conf') self.config.read("pupy.conf") if port is None: self.port=self.config.getint("pupyd", "port")