def main_body(): if not os.path.exists('build'): os.mkdir('build') sys.argv, cmake_args, make_args = parse_args() makefile = os.path.join('build', 'Makefile') if not os.path.exists(makefile): cmake_cmd = ['cmake', '..'] + cmake_args if os.name == 'nt': files_on_path = set() for p in os.environ['PATH'].split(';')[::-1]: if os.path.exists(p): files_on_path.update(os.listdir(p)) if 'cl.exe' in files_on_path: pass elif 'sh.exe' in files_on_path: cmake_cmd += ['-G "MSYS Makefiles"'] elif 'gcc.exe' in files_on_path: cmake_cmd += ['-G "MinGW Makefiles"'] cmake_cmd = ' '.join(cmake_cmd) rtn = subprocess.check_call(cmake_cmd, cwd='build', shell=(os.name=='nt')) rtn = subprocess.check_call(['make'] + make_args, cwd='build') cwd = os.getcwd() os.chdir('build') configure.setup() os.chdir(cwd)
def main_body(): assert_dep_versions() if not os.path.exists('build'): os.mkdir('build') sys.argv, cmake_args, make_args = parse_args() makefile = os.path.join('build', 'Makefile') if not os.path.exists(makefile): if os.name != 'nt': rtn = subprocess.call(['which', 'cmake']) if rtn != 0: sys.exit('CMake is not installed, aborting PyNE build.') cmake_cmd = ['cmake', '..'] + cmake_args cmake_cmd += ['-DPYTHON_EXECUTABLE=' + sys.executable, ] if os.name == 'nt': files_on_path = set() for p in os.environ['PATH'].split(';')[::-1]: if os.path.exists(p): files_on_path.update(os.listdir(p)) if 'cl.exe' in files_on_path: pass elif 'sh.exe' in files_on_path: cmake_cmd += ['-G "MSYS Makefiles"'] elif 'gcc.exe' in files_on_path: cmake_cmd += ['-G "MinGW Makefiles"'] cmake_cmd = ' '.join(cmake_cmd) rtn = subprocess.check_call(cmake_cmd, cwd='build', shell=(os.name=='nt')) rtn = subprocess.check_call(['make'] + make_args, cwd='build') cwd = os.getcwd() os.chdir('build') configure.setup() os.chdir(cwd)
def main_body(): assert_dep_versions() if not os.path.exists('build'): os.mkdir('build') sys.argv, cmake_args, make_args = parse_args() makefile = os.path.join('build', 'Makefile') if not os.path.exists(makefile): if os.name != 'nt': rtn = subprocess.call(['which', 'cmake']) if rtn != 0: sys.exit('CMake is not installed, aborting PyNE build.') cmake_cmd = ['cmake', '..'] + cmake_args cmake_cmd += [ '-DPYTHON_EXECUTABLE=' + sys.executable, ] if os.name == 'nt': files_on_path = set() for p in os.environ['PATH'].split(';')[::-1]: if os.path.exists(p): files_on_path.update(os.listdir(p)) if 'cl.exe' in files_on_path: pass elif 'sh.exe' in files_on_path: cmake_cmd += ['-G "MSYS Makefiles"'] elif 'gcc.exe' in files_on_path: cmake_cmd += ['-G "MinGW Makefiles"'] cmake_cmd = ' '.join(cmake_cmd) rtn = subprocess.check_call(cmake_cmd, cwd='build', shell=(os.name == 'nt')) rtn = subprocess.check_call(['make'] + make_args, cwd='build') cwd = os.getcwd() os.chdir('build') configure.setup() os.chdir(cwd)
def main_body(): if not os.path.exists('build'): os.mkdir('build') sys.argv, cmake_args, make_args = parse_args() makefile = os.path.join('build', 'Makefile') if not os.path.exists(makefile): cmake_cmd = ['cmake', '..'] + cmake_args if os.name == 'nt': files_on_path = set() for p in os.environ['PATH'].split(';')[::-1]: if os.path.exists(p): files_on_path.update(os.listdir(p)) if 'cl.exe' in files_on_path: pass elif 'sh.exe' in files_on_path: cmake_cmd += ['-G "MSYS Makefiles"'] elif 'gcc.exe' in files_on_path: cmake_cmd += ['-G "MinGW Makefiles"'] cmake_cmd = ' '.join(cmake_cmd) rtn = subprocess.check_call(cmake_cmd, cwd='build', shell=(os.name == 'nt')) rtn = subprocess.check_call(['make'] + make_args, cwd='build') cwd = os.getcwd() os.chdir('build') configure.setup() os.chdir(cwd)
def simulation(): """Creates a new simulation""" global app app.destroy() configure.setup(False) app = Gui(None) app.geometry("300x300") app.title("Hearts") app.mainloop()
def single_player_game(): """Creates a new single player game""" global app app.destroy() configure.setup(True) app = Gui(None) app.geometry("300x300") app.title("Hearts") app.mainloop()
def main_body(): print xdress_logo configure.setup()
def main(): print(xdress_logos[0]) configure.setup()
dawn_time) / (night_duration / 4) else: index = 13 + (current_time + 24-dawn_time-day_dur) / \ (night_duration/4) return int(index + 1) if __name__ == '__main__': # Check if -setup was passed if len(sys.argv) == 2: if sys.argv[1] != '-setup': print('Unknown arguement\a') sys.exit(1) elif sys.argv[1] == '-setup': configure.setup() sys.exit(1) else: # Continue exec pass # Get the wallpaper setter defined by the user in config USER_DEFINED_SETTER = configure.get('PAPER_SETTER') username = configure.get('USERNAME') order = [i for i in range(1, 17)] lat, lon = coordinates.get() time_nfo = getAll()
import gui import configure import Tkinter if __name__ == "__main__": configure.setup(False) gui.app = gui.Gui(None) gui.app.geometry("275x300") gui.app.title("Hearts") gui.app.mainloop()
def main_body(): print(xdress_logo) configure.setup()
# submit an empty part without filename if file.filename == '': flash('No selected file') return redirect(request.url) if file and allowed_file(file.filename): filename = file.filename fullpath = os.path.join(app.config['UPLOAD_FOLDER'], filename) file.save(fullpath) uploadPublicFile(fullpath, "bot_test") os.remove(fullpath) return redirect(url_for('upload_file', filename=filename)) return ''' <!doctype html> <title>Upload new File</title> <h1>Upload new File</h1> <form method=post enctype=multipart/form-data> <input type=file name=file> <input type=submit value=Upload> </form> ''' if __name__ == '__main__': setup() port = os.environ.get('PORT') if not port: print("❌ Port is not defined") else: print("✅ Port", port) app.debug = True app.run(host='0.0.0.0', port=port)