Distributed and decentralized pi calculation

greg

+22 -4
+3 -1
.gitignore
··· 159 159 # option (not recommended) you can uncomment the following to ignore the entire idea folder. 160 160 #.idea/ 161 161 162 - picalc/ 162 + # Server 163 + picalc/ 164 + ver.txt
+3 -1
src/server/app.py
··· 40 40 except: 41 41 piresult = "picalc/pi.txt wasn't found on this web server. Sorry!" 42 42 if request.method == 'GET': 43 - return render_template('index.html', pi=piresult, name=name, email=email) 43 + ver = open("ver.txt", "r") 44 + version = ver.read() 45 + return render_template('index.html', pi=piresult, name=name, email=email, version=version) 44 46 else: 45 47 return "Please use GET to access this page." 46 48
+4 -1
src/server/setup.py
··· 22 22 print("Picalc not found, creating") 23 23 with open("picalc/pi.txt", "w") as pifile: 24 24 pifile.write("No clients have connected yet. Become one of the first!") 25 - print("Created picalc/pi.txt successfully. Do NOT edit this file!") 25 + print("Created picalc/pi.txt successfully. Do NOT edit this file!") 26 + with open("ver.txt", "w") as versionfile: 27 + versionfile.write("1.1") 28 + print("Created version file. Server will not work without this!!!")
+1 -1
src/server/templates/index.html
··· 22 22 <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet"> 23 23 </head> 24 24 <body> 25 - <h1>Pistrubuted 1.0</h1> 25 + <h1>Pistrubuted {{ version }}</h1> 26 26 <p>Pistrubuted is an open-source server & client to calculate Pi with distrubuted machines. Get started by downloading the client and connecting to this server.</p> 27 27 <p>{{ pi }}</p> 28 28 <hr>
+11
website/index.html
··· 1 + <!DOCTYPE html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="UTF-8"> 5 + <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 + <title>Pistributed</title> 7 + </head> 8 + <body> 9 + 10 + </body> 11 + </html>