lpcmanager

c059320c8bbb
Parents 169d6c59873d
Children a57a5267f11a
WIP reworked imports and declarations at head of LPCManager.py
  • +16 -21
    LPCManager.py
  • --- a/LPCManager.py Mon Jan 29 13:57:06 2018 +0100
    +++ b/LPCManager.py Mon Jan 29 14:32:37 2018 +0100
    @@ -1,36 +1,31 @@
    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    +import sys
    +import os
    +
    +# On Windows install schema, we compute path to beremiz
    +# relative to path to python folder (sys.path[0] in that case)
    +# note: beware that wx import messes up sys.path[0]
    +_dist_folder = os.path.split(sys.path[0])[0]
    +_beremiz_folder = os.path.join(_dist_folder, "beremiz")
    +# Then we add it to sys.path, to make "import Beremiz" possible
    +sys.path.append(_beremiz_folder)
    +
    import fnmatch
    import shutil
    import socket
    -import sys
    import threading
    import zipfile
    -
    -__version__ = "$Revision$"
    -
    -import os, getopt, tempfile
    +import tempfile
    +import getopt
    import __builtin__
    from types import StringType, UnicodeType
    from blinker import signal
    import time
    -
    -
    +import wx
    +
    +# Path of directory containing current python file
    _lpcmanager_path = os.path.split(__file__)[0]
    -_dist_folder = os.path.split(sys.path[0])[0]
    -_beremiz_folder = os.path.join(_dist_folder, "beremiz")
    -sys.path.append(_beremiz_folder)
    -
    -if __name__ == '__main__':
    - import wxversion
    - #wxversion.select(['2.8', '3.0'])
    - wxversion.select(['3.0'])
    - import wx
    -
    -
    -def Bpath(*args):
    - return os.path.join(CWD, *args)
    -
    if __name__ == '__main__':