# HG changeset patch # User Edouard Tisserant # Date 1516801729 -3600 # Node ID 87c908079bc666ca10113576bbb75281ce1afc70 # Parent 084256be365877896d45348b352f51b8f76760cd Changed way to deal with extensions arguments (-e) so that path and filename are stored independently and accessible for extensions themselves. diff -r 084256be3658 -r 87c908079bc6 Beremiz_service.py --- a/Beremiz_service.py Fri Jan 19 15:12:23 2018 +0100 +++ b/Beremiz_service.py Wed Jan 24 14:48:49 2018 +0100 @@ -110,7 +110,9 @@ elif o == "-s": wampsecret = None if a == "off" else a elif o == "-e": - extensions.append(a) + l = os.path.split(os.path.realpath(a)) + l.reverse() + extensions.append(l) else: usage() sys.exit() @@ -588,10 +590,9 @@ wampconf = None # Load extensions -for extfilename in extensions: - extension_folder = os.path.split(os.path.realpath(extfilename))[0] +for extention_file, extension_folder in extensions: sys.path.append(extension_folder) - execfile(extfilename, locals()) + execfile(os.path.join(extension_folder, extention_file), locals()) if havetwisted: if webport is not None: