コード例 #1
0
def start_bitdust():
    executable_path = os.getcwd()
    print('start_bitdust executable_path=%r' % executable_path)
    try:
        os.chdir('bitdust')
    except:
        pass
    print('executable_path after : %r' % os.getcwd())
    from main.bpmain import main
    # reactor.callLater(0, main, executable_path, start_reactor=False)  # @UndefinedVariable
    main(executable_path, start_reactor=False)
    return True
コード例 #2
0
def main():
    executable_path = os.getcwd()

    try:
        os.chdir(os.path.dirname(__file__))
    except:
        pass

    try:
        from main.bpmain import main
    except:
        dirpath = os.path.dirname(os.path.abspath(sys.argv[0]))
        sys.path.insert(0, os.path.abspath(os.path.join(dirpath, '..')))
        from distutils.sysconfig import get_python_lib
        sys.path.append(os.path.join(get_python_lib(), 'bitdust'))
        try:
            from main.bpmain import main
        except:
            print('ERROR! can not import working code.  Python Path:')
            print('\n'.join(sys.path))
            return 1

    from main.bpmain import main

    ret = main(executable_path)

    os._exit(ret)

    return ret
コード例 #3
0
ファイル: bitdust.py プロジェクト: re2005/bitdust-devel
def main():
    executable_path = os.getcwd()
    try:
        os.chdir(os.path.dirname(__file__))
    except:
        pass
    from main.bpmain import main
    ret = main(executable_path)
    os._exit(ret)
コード例 #4
0
    try:
        os.chdir(os.path.dirname(__file__))
    except:
        pass

    try:
        from main.bpmain import main
    except:
        dirpath = os.path.dirname(os.path.abspath(sys.argv[0]))
        sys.path.insert(0, os.path.abspath(os.path.join(dirpath, '..')))
        from distutils.sysconfig import get_python_lib
        sys.path.append(os.path.join(get_python_lib(), 'bitdust'))
        try:
            from main.bpmain import main
        except:
            print('ERROR! can not import working code.  Python Path:')
            print('\n'.join(sys.path))
            return 1

    from main.bpmain import main

    ret = main(executable_path)

    os._exit(ret)

    return ret


if __name__ == "__main__":
    main()