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
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
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)
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()