Skip to content

Commit

Permalink
current version
Browse files Browse the repository at this point in the history
  • Loading branch information
W4SD committed Jul 16, 2019
1 parent e1add5f commit c5b29ef
Show file tree
Hide file tree
Showing 36 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"python.pythonPath": "engineRoom\\Scripts\\python.exe"
"python.pythonPath": "C:\\Users\\laZerGman\\AppData\\Local\\Programs\\Python\\Python37-32\\python.exe"
}
Binary file modified __pycache__/formLogic.cpython-37.pyc
Binary file not shown.
14 changes: 8 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,28 @@
template_folder="templates")

totalMessages = 0
allMessages = []

def addMessageCount(value):
global totalMessages
totalMessages += value

messagesInBoard = ListMessages()


@app.route("/", methods=['GET', 'POST'])
def home():
"""Serve message form."""
sendMessageForm = CreateMessage()
msgBoardData = ["","/ No new messages!"]
if request.method == 'POST':
#if sendMessageForm.validate():
print('Message sent!')
messagesInBoard.printMessage()
sentMessage = ListMessages(request.form)
allMessages.append(sentMessage)
addMessageCount(1)
print('List has', len(allMessages), 'objects')
msgBoardData = sentMessage.printMessage(allMessages)
return render_template("main.html",
form=sendMessageForm,
count=totalMessages)
count=totalMessages,
msgBoard = msgBoardData)

if __name__ == '__main__':
app.secret_key = 'notSoSecret'
Expand Down
Binary file modified engineRoom/Lib/__pycache__/_bootlocale.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/_collections_abc.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/abc.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/codecs.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/copyreg.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/enum.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/functools.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/genericpath.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/heapq.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/io.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/keyword.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/locale.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/ntpath.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/operator.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/os.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/re.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/reprlib.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/site.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/sre_compile.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/sre_constants.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/sre_parse.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/stat.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/types.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/__pycache__/warnings.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/collections/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/distutils/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/encodings/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/encodings/__pycache__/aliases.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/encodings/__pycache__/cp1252.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/encodings/__pycache__/latin_1.cpython-37.pyc
Binary file not shown.
Binary file modified engineRoom/Lib/encodings/__pycache__/utf_8.cpython-37.pyc
Binary file not shown.
15 changes: 15 additions & 0 deletions formLogic.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,23 @@ class CreateMessage(Form):
submit = SubmitField('Send')

class ListMessages():

def __init__(self, attributes, format=None):
self.name = attributes.get('sender')
self.title = attributes.get('title')
self.content = attributes.get('content')

def printMessage(self, format=None):

messageData = [self.name, self.title, self.content]
'''
##iteration loop for later..?
for v in thisForm:
print("%s : %s" % (v,thisForm[v]))
'''

if format is None:
print('listAllMessagesInBoard')
return messageData
else:
return 'Some'
8 changes: 4 additions & 4 deletions templates/board.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- board.html -->

<div class="messageBoard">
<div class="msgBoard">
<div class="titleRow">
Antti/Testi:<br>
{{ msgBoard[0] }} / {{msgBoard[1] }} <br>
</div>
<div class="contentRow">
Here is message content<br>
{{ msgBoard[2] }} <br>
</div>
<div class="urlRow">
Here is url
Here is url<br>
</div>
</div>

0 comments on commit c5b29ef

Please sign in to comment.