From 71df99e9200223027d59f985a7db05c96fdcd471 Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Fri, 25 Nov 2022 21:31:54 +0000 Subject: [PATCH 1/3] getWorkingSpaces function. --- static/Coworking_Functions.py | 16 ++++++++++++ .../coworking_functions.cpython-310.pyc | Bin 530 -> 1075 bytes tempServer.py | 23 ++++++------------ 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/static/Coworking_Functions.py b/static/Coworking_Functions.py index a5c9134..0d170f2 100644 --- a/static/Coworking_Functions.py +++ b/static/Coworking_Functions.py @@ -1,5 +1,21 @@ +from flask import request from csv import writer +def getCoworkingSpaces(): + + recordName = request.form['recordName'] + recordAddress = request.form['recordAddress'] + recordMainPhotos = request.form['recordMainPhotos'] + recordAdditionalPhotos = request.form['recordAdditionalPhotos'] + recordDescription = request.form['recordDescription'] + recordWebsite = request.form['recordWebsite'] + recordEmail = request.form['recordEmail'] + recordPhoneNumber = request.form['recordPhoneNumber'] + recordOpeningHours = request.form['recordOpeningHours'] + recordCheckinInstructions = request.form['recordCheckinInstructions'] + recordData = [recordName, recordAddress, recordMainPhotos, recordAdditionalPhotos, recordDescription, recordWebsite, recordEmail, recordPhoneNumber, recordOpeningHours, recordCheckinInstructions] + return recordData + def addCoworkingSpaces(data): with open('coworking_spaces.csv', 'a') as addToFile: diff --git a/static/__pycache__/coworking_functions.cpython-310.pyc b/static/__pycache__/coworking_functions.cpython-310.pyc index 686c5e64725d8003e480164cad09f9b2c489d099..75827615d0172035b54e3fc75e88671308f27448 100644 GIT binary patch literal 1075 zcmZ9L&u`N(6vu5RZPT=atxT|Snh=*rbZ7@I2qB<jf&&Fn(4Z<pneDFGlDOFJs!gc` z8h8ExgtQ&`mwe^KzkoRK>}=JBEr0#-dyap-7qPGqA}Am3exdJtgnrq<#X?~42%5SB z!VtqL%5WcJ%OoY4*Y|)u=6^+fpH)~D`U<P{P!#-zFHnR{bt)6hB~VTBPZO>*#nyFJ zJm>>x9cbz`h=yGlIVRt3&alP>KE^XrkP}j%Q`on_C*CQ79({*>e~@iN;4D7WV>n3< zZ6I}P3iE7z4~>B>^1DaNR7{23Px9T5Y8+Fp)~Px$I6kVa#f)*b9{I)>W1dTU<$h2e zT1-uarb6+^Gd_!T+^@szH)1PEdA|-TY`eStMABa2&%u-XgB~3Tkq$bsWXW*2_BKxr zxKxQg9K7eTT-zAXG~u~!kEPh-RI7oOai&I`wKb=s_GK^F;;g-KZ=iIn6FTV3FR?Yr zsZK<$*2jmY1&5ludhU7<Or)A1O%mV`2T*VSl{VNE+PpM?tkJ#xX8?`%FvF{8RuTci z&gKCTM?R3}r~>3WssdFU)qtvw0-&0sI#A#!1gaMh#ex)G;TM&nTGWc5sPBfeum~Ym zjjjnLr$VxBoN=>I@?*v%SIR7w!xwRqzZwZGl({~ikl6Q#(=+>0Y2W0E%4BR^=WA{A z9f$`vjdI4*EKX8$HXT0Bd3TcSaA{hl|0N^^q|Gxik;<%=w$6xC$ff7G(sEM9AtKVI zvhjyPW>G`hmz6dEa>2?KD_5;7T3NEvvU1JJGRXP0HzCbjI+aqluGTKs{{`4CtyVxn z5<-A4*A?Ouc>|o?sM_}+PhD1<$}o-9zB{K&1vllwUN(uP+c0>L2{uXjL;I^LYj2_^ I4oEZj2eAwe_W%F@ delta 181 zcmdnYF^PpQpO=@50SHcCtxx{LFp*D2R|3dOVMt-jVaR2SVq|1UVM<|cVTfW%VF_l? zWPJ%ztjTzbt-L6+B(-Q_*%e0i$=-~q+{yXn`9;~8dFk<KlXo-9hcg4!74rZI9wrV( zE=CR@RQXfH2^8?tWR7A^E-ou#0&>72MeHCJg5UshZ*kb<=BJeAq}nk8dBrS1f(K|8 E0FX{3;Q#;t diff --git a/tempServer.py b/tempServer.py index bd1f86d..f5fab1f 100644 --- a/tempServer.py +++ b/tempServer.py @@ -8,27 +8,18 @@ ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) @app.route("/AddRecord", methods=['POST']) def addRecord(): - print('Processing record.') - infoMessage = 'Add record failed.' - if (request.method == 'POST'): - - recordName = request.form['recordName'] - recordAddress = request.form['recordAddress'] - recordMainPhotos = request.form['recordMainPhotos'] - recordAdditionalPhotos = request.form['recordAdditionalPhotos'] - recordDescription = request.form['recordDescription'] - recordWebsite = request.form['recordWebsite'] - recordEmail = request.form['recordEmail'] - recordPhoneNumber = request.form['recordPhoneNumber'] - recordOpeningHours = request.form['recordOpeningHours'] - recordCheckinInstructions = request.form['recordCheckinInstructions'] - recordData = [recordName, recordAddress, recordMainPhotos, recordAdditionalPhotos, recordDescription, recordWebsite, recordEmail, recordPhoneNumber, recordOpeningHours, recordCheckinInstructions] + print('Processing record.') + infoMessage = ('Add record failed.') + if (request.method == 'POST'): + + recordData = Coworking_Functions.getCoworkingSpaces() Coworking_Functions.addCoworkingSpaces(recordData) + infoMessage = (f'{recordData} Record added.') print(infoMessage) - return infoMessage + return (infoMessage) if __name__ == "__main__": app.run(debug=True) -- GitLab From 868a79248cacc59887e82c991b9eaf01763d856a Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Tue, 29 Nov 2022 10:13:53 +0000 Subject: [PATCH 2/3] Resorted repository as a team. --- .flaskenv | 2 - .gitignore | 3 + ...ing_Functions.py => Coworking_Functions.py | 0 OurSpaces.html | 16 --- html | 64 --------- landingpage.html | 9 -- locations | 31 ---- main.py | 40 ------ our locations.html | 136 ------------------ __init__.py => project_db.sql | 0 project_server.py | 12 ++ static/.gitkeep | 0 static/__init__.py | 0 static/__pycache__/__init__.cpython-310.pyc | Bin 200 -> 0 bytes .../coworking_functions.cpython-310.pyc | Bin 1075 -> 0 bytes ...coworking_spaces_functions.cpython-310.pyc | Bin 535 -> 0 bytes static/test | 33 ----- style.css | 32 ----- tempServer.py | 25 ---- templates/.gitkeep | 0 20 files changed, 15 insertions(+), 388 deletions(-) delete mode 100644 .flaskenv create mode 100644 .gitignore rename static/Coworking_Functions.py => Coworking_Functions.py (100%) delete mode 100644 OurSpaces.html delete mode 100644 html delete mode 100644 landingpage.html delete mode 100644 locations delete mode 100644 main.py delete mode 100644 our locations.html rename __init__.py => project_db.sql (100%) create mode 100644 project_server.py delete mode 100644 static/.gitkeep delete mode 100644 static/__init__.py delete mode 100644 static/__pycache__/__init__.cpython-310.pyc delete mode 100644 static/__pycache__/coworking_functions.cpython-310.pyc delete mode 100644 static/__pycache__/coworking_spaces_functions.cpython-310.pyc delete mode 100644 static/test delete mode 100644 style.css delete mode 100644 tempServer.py delete mode 100644 templates/.gitkeep diff --git a/.flaskenv b/.flaskenv deleted file mode 100644 index f84f451..0000000 --- a/.flaskenv +++ /dev/null @@ -1,2 +0,0 @@ -FLASK_APP=main.py -FLASK_ENV=development diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5056a5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +Database Files +*.db +Coworking_Spaces.db diff --git a/static/Coworking_Functions.py b/Coworking_Functions.py similarity index 100% rename from static/Coworking_Functions.py rename to Coworking_Functions.py diff --git a/OurSpaces.html b/OurSpaces.html deleted file mode 100644 index e70fe50..0000000 --- a/OurSpaces.html +++ /dev/null @@ -1,16 +0,0 @@ -<head> - <link rel="stylesheet" href="framework.css"> -</head> - -<body class="body"> - -<header> <img src="header.png"/> </header> - - - - - -<div class="box"> - -</div> -</body> diff --git a/html b/html deleted file mode 100644 index 2b5216d..0000000 --- a/html +++ /dev/null @@ -1,64 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <link rel="stylesheet" href= "css/locations.css"> - <title> Locations </title> -</head> -<body> - <h1> - <img src="https://www.4piproductions.com/wp-content/uploads/2017/04/tramshed_.png" class="logo"> - OUR LOCATIONS </h1> - <div class="contain"> - <ul class= "list"> - <li> -<div class="container"> - <img src="https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" class="image" > - - <div class="middle"> - <div class="text"> Codebase </div> - </div> - </div> - </li> - - <li> - <div class="container"> - <img src="https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg" class="image" > - - <div class="middle"> - <div class="text"> Catalyst </div> - </div> - </div> - </li> - <li> - <div class="container"> - <img src="https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w" Class="image" > - - <div class="middle"> - <div class="text"> C4DI </div> - </div> - </div> - </li> - - <li> - <div class="container"> - <img src="https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg" class="image" > - - <div class="middle"> - <div class="text"> Dogpatch </div> - </div> - </div> - </li> - - <li> - <div class="container"> - <img src="https://stationf.co/img/misc/create-zone.jpg" class="image" > - - <div class="middle"> - <div class="text"> Station F </div> - </div> - </div> - </li> - </ul> -</div> - -</body> diff --git a/landingpage.html b/landingpage.html deleted file mode 100644 index 5ee32a8..0000000 --- a/landingpage.html +++ /dev/null @@ -1,9 +0,0 @@ -<html> -<head><link rel="stylesheet" href="style.css"></head> -<header> - <img src="logo.jpg"/><br><br><br><br> -</header> -<body class="body"> - <img src="title.png"/> - <button id= "ViewLocations" type="ViewLocations" href="locations.html">View Locations</button> -</html> diff --git a/locations b/locations deleted file mode 100644 index a0b601e..0000000 --- a/locations +++ /dev/null @@ -1,31 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <title> Locations </title> - -<style> - body{ - background-color: white; - color: black; -} - -header{ - background-color: white; - color: black; - display: block; - margin-left: auto; - margin-right: auto; - float: center; -} -</style> -<body> - <h1> OUR LOCATIONS </h> - <ul> - <li><img src="https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" wedth="200" height="200" ><p> Codebase </p></li> - <li><img src="https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg" wedth="200" height="200" ><p> Catalyst </p></li> - <li><img src="https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w" wedth="200" height="200" ><p> C4DI </p></li> - <li><img src="https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg "wedth="200" height="200" ><p> Dogpatch </p></li> - <li><img src="https://stationf.co/img/misc/create-zone.jpg" wedth="200" height="200" ><p> Stafion F </p></li> - </ul> - -</body> diff --git a/main.py b/main.py deleted file mode 100644 index 3a9489b..0000000 --- a/main.py +++ /dev/null @@ -1,40 +0,0 @@ -from flask import Flask, request, render_template, redirect -import database -import csv -import re - - -def import_workspace(data): - workspace = database.Workspace( - data["name"], - data["address"], - data["main_photo"], - data["additional_photos"], - data["description"], - data["website"], - data["email"], - data["phone_number"], - data["opening_hours"], - data["checkin_instructions"] - ) - -app = Flask(__name__) - - - - -file = open("coworking_spaces.csv") -csvreader = csv.reader(file) -header = next(csvreader) - -Rows= [] -for Row in csvreader: - Rows.append(Row) -print(Row) - -with open('coworking_spaces.csv') as file: - content = file.readlines() -header = content[2:] -rows = content[1:] -print(header) -print(Rows) diff --git a/our locations.html b/our locations.html deleted file mode 100644 index 25b69bc..0000000 --- a/our locations.html +++ /dev/null @@ -1,136 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <title> Locations </title> - -<style> - body{ - background-color: white; - color: black; -} - -header{ - background-color: white; - color: black; - display: block; - margin-left: auto; - margin-right: auto; - float: center; -} - -.container { - position: relative; - padding: 5px; - width: 50%; - height: 70%; - background-color: white; - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - margin-bottom: 25px; -} - - -.image { - opacity: 1; - display: block; - width: 100%; - height: 75%; - transition: .5s ease; - backface-visibility: hidden; - -} - -.middle { - transition: .5s ease; - opacity: 0; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - -ms-transform: translate(-50%, -50%) - -} - -.container:hover .image { - opacity: 0.3; -} - -.container:hover .middle { - opacity: 1; -} - -.text { - background-color: black; - color: white; - font-size: 16px; - padding: 16px 32px; -} - - - -div.contain { - text-align: center; -} - -ul.list { - display: inline-block; - text-align: left; - list-style-type: none; -} - -</style> -<body> - <h1> OUR LOCATIONS </h1> - <div class="contain"> - <ul class= "list"> - <li> -<div class="container"> - <img src="https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" class="image" > - - <div class="middle"> - <div class="text"> Codebase </div> - </div> - </div> - </li> - - <li> - <div class="container"> - <img src="https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg" class="image" > - - <div class="middle"> - <div class="text"> Catalyst </div> - </div> - </div> - </li> - <li> - <div class="container"> - <img src="https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w" Class="image" > - - <div class="middle"> - <div class="text"> C4DI </div> - </div> - </div> - </li> - - <li> - <div class="container"> - <img src="https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg" class="image" > - - <div class="middle"> - <div class="text"> Dogpatch </div> - </div> - </div> - </li> - - <li> - <div class="container"> - <img src="https://stationf.co/img/misc/create-zone.jpg" class="image" > - - <div class="middle"> - <div class="text"> Station F </div> - </div> - </div> - </li> - </ul> -</div> - -</body> diff --git a/__init__.py b/project_db.sql similarity index 100% rename from __init__.py rename to project_db.sql diff --git a/project_server.py b/project_server.py new file mode 100644 index 0000000..8c59c25 --- /dev/null +++ b/project_server.py @@ -0,0 +1,12 @@ +import os +from flask import Flask, redirect, request, render_template, jsonify +from . import Coworking_Functions + +app = Flask(__name__) + +ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) + +#PUT ROUTES HERE + +if __name__ == "__main__": + app.run(debug=True) diff --git a/static/.gitkeep b/static/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/static/__init__.py b/static/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/static/__pycache__/__init__.cpython-310.pyc b/static/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 2e099c12ae40d9f36336371daeaa85bcd52de30f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 200 zcmd1j<>g`k0t>ImWDxxrL?8o3AjbiSi&=m~3PUi1CZpd<h9ZzKg7}r~WEB&foROcO z6XTp%l#-d2rVyH!S(aK<oLN#C6PcP=q+l46oRgWFSE5@`l%JKFTv8lUQk0lmoRONM zTaucbp^GXD6idw2H8hPWE=erOOpb|<&&<m#iI3MSsJz8tlbfGXnv-e=azrr`kYHf| E03Y@={{R30 diff --git a/static/__pycache__/coworking_functions.cpython-310.pyc b/static/__pycache__/coworking_functions.cpython-310.pyc deleted file mode 100644 index 75827615d0172035b54e3fc75e88671308f27448..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1075 zcmZ9L&u`N(6vu5RZPT=atxT|Snh=*rbZ7@I2qB<jf&&Fn(4Z<pneDFGlDOFJs!gc` z8h8ExgtQ&`mwe^KzkoRK>}=JBEr0#-dyap-7qPGqA}Am3exdJtgnrq<#X?~42%5SB z!VtqL%5WcJ%OoY4*Y|)u=6^+fpH)~D`U<P{P!#-zFHnR{bt)6hB~VTBPZO>*#nyFJ zJm>>x9cbz`h=yGlIVRt3&alP>KE^XrkP}j%Q`on_C*CQ79({*>e~@iN;4D7WV>n3< zZ6I}P3iE7z4~>B>^1DaNR7{23Px9T5Y8+Fp)~Px$I6kVa#f)*b9{I)>W1dTU<$h2e zT1-uarb6+^Gd_!T+^@szH)1PEdA|-TY`eStMABa2&%u-XgB~3Tkq$bsWXW*2_BKxr zxKxQg9K7eTT-zAXG~u~!kEPh-RI7oOai&I`wKb=s_GK^F;;g-KZ=iIn6FTV3FR?Yr zsZK<$*2jmY1&5ludhU7<Or)A1O%mV`2T*VSl{VNE+PpM?tkJ#xX8?`%FvF{8RuTci z&gKCTM?R3}r~>3WssdFU)qtvw0-&0sI#A#!1gaMh#ex)G;TM&nTGWc5sPBfeum~Ym zjjjnLr$VxBoN=>I@?*v%SIR7w!xwRqzZwZGl({~ikl6Q#(=+>0Y2W0E%4BR^=WA{A z9f$`vjdI4*EKX8$HXT0Bd3TcSaA{hl|0N^^q|Gxik;<%=w$6xC$ff7G(sEM9AtKVI zvhjyPW>G`hmz6dEa>2?KD_5;7T3NEvvU1JJGRXP0HzCbjI+aqluGTKs{{`4CtyVxn z5<-A4*A?Ouc>|o?sM_}+PhD1<$}o-9zB{K&1vllwUN(uP+c0>L2{uXjL;I^LYj2_^ I4oEZj2eAwe_W%F@ diff --git a/static/__pycache__/coworking_spaces_functions.cpython-310.pyc b/static/__pycache__/coworking_spaces_functions.cpython-310.pyc deleted file mode 100644 index 97f919c253eb91632b309dafbbf07caa64c515c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 535 zcmZ8ePfG$p6rY)0a}|XS9io#&mpv$W=n@f8(9uH{;<6ya%$QT_j?9dTqI9r(A0Prf z_GS72d+pR$kb>T>9jy0w@A3Z3Z{BZ4mCHp0^8NnE)(}6^WLpR%=U`?Z97h~SsE-4T z5hvVvLIL4!6ZyGM=pr8{J7X=a&<v;fuQ(7ruuCv=4bB1#Ckyg?Fvk|p@B+`tj4a6v ztpIq2m(B`7L@$UtucU<tT<n4_9E_T%j?Cd0=2C5gaj5xjW4g!GSm_5D-*wD@GGS`W zj1o+z`3mJ+@S5)?t{R9~r<?+Bv#A;<ITk4+d?#@^wKOQe^o_cbkq8Qa(8>tCA)SX) z>-oh=*knDWqVSSxF1y{zZ7fGZ8)+wDTTor8hb)pJw$*`F_kvjyT21?=CwSEg)~o*Q zLXGyT_2bZ3Y9$N*ljwAZF|$&|rZ$))yRchpL$aB1OyAa&z?F!Hi`WA_`qBj`G<+v; eVE>G5R>>G_x%5vG@3gP@FcN3!j~O>b0<0f1HHT6F diff --git a/static/test b/static/test deleted file mode 100644 index d9135c2..0000000 --- a/static/test +++ /dev/null @@ -1,33 +0,0 @@ -def getFieldnames(csvFile): - - fieldnames = [] - with open(csvFile, 'r') as readFile: - csvReader = csv.reader(readFile) - fieldnames = next(csvReader) - readFile.close() - return fieldnames - -dictKeys = getFieldnames('coworking_spaces.csv') - -""" -""" - -newRecord = {} -for x in range(len(keys)): - newRecord[keys[x]] = values[x] - -""" -""" - -name_Value = "NEWNEWNEW" -address_Value = "123CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL" -MP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" -AP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w" -description_Value = "123Hi. We\u2019re CodeBase. We've been exploring the world of startups and innovation for over five years now. We're not really sure how to best describe what we do, but we think the words \"tech cluster\" probably do it best. Please get in touch! We\u2019re friendly people who are geeky about building tech startups, managing disruption and innovation." -website_Value = "123https://www.thisiscodebase.com" -email_Value = "123info@thisiscodebase.com" -PN_Value = "123Hi(+44) 0131 560 2003" -OH_Value = "12308:00 - 17:00" -CI_Value = "123Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" - -recordValues = [name_Value, address_Value, MP_Value, AP_Value, description_Value, website_Value, email_Value, PN_Value, OH_Value, CI_Value] diff --git a/style.css b/style.css deleted file mode 100644 index 85bdc71..0000000 --- a/style.css +++ /dev/null @@ -1,32 +0,0 @@ -header{ - background-color: black; - display: block; - color: black; - margin-left: auto; - margin-right: inherit; - width: 100%; - height: 75%; -} - -button{ - background-color: white; - color: black; - text-align: center; - position: fixed; - margin: inherit; - display: inline-block; - line-height: 20px; - float: center; - width: 10%; - height: 15%; - font-size: 16px; - border-radius: 12px; - padding: 1px 10px; - transform: translate(350%, 50%); - font-family: monospace; - font-style: oblique; - font-weight: bolder; -} - -body{ - display: block; diff --git a/tempServer.py b/tempServer.py deleted file mode 100644 index f5fab1f..0000000 --- a/tempServer.py +++ /dev/null @@ -1,25 +0,0 @@ -import os -from flask import Flask, redirect, request, render_template, jsonify -from static import Coworking_Functions - -app = Flask(__name__) - -ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) - -@app.route("/AddRecord", methods=['POST']) -def addRecord(): - - print('Processing record.') - infoMessage = ('Add record failed.') - - if (request.method == 'POST'): - - recordData = Coworking_Functions.getCoworkingSpaces() - Coworking_Functions.addCoworkingSpaces(recordData) - infoMessage = (f'{recordData} Record added.') - - print(infoMessage) - return (infoMessage) - -if __name__ == "__main__": - app.run(debug=True) diff --git a/templates/.gitkeep b/templates/.gitkeep deleted file mode 100644 index e69de29..0000000 -- GitLab From 5d66308a96e8b9daef796335e975a6f98dfbe3ef Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Tue, 29 Nov 2022 10:18:37 +0000 Subject: [PATCH 3/3] removed 1 line from server. --- project_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_server.py b/project_server.py index 8c59c25..edb3daf 100644 --- a/project_server.py +++ b/project_server.py @@ -1,6 +1,6 @@ import os from flask import Flask, redirect, request, render_template, jsonify -from . import Coworking_Functions + app = Flask(__name__) -- GitLab