Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3afd061
Week 01 Exercises.
mattmakesmaps Jan 13, 2013
e474197
Merge remote-tracking branch 'upstream/master'
mattmakesmaps Jan 16, 2013
6e1e6cd
edit to homework.
mattmakesmaps Jan 16, 2013
6d104b4
Week 02 Exercises 1/2/3
mattmakesmaps Jan 16, 2013
d39ebec
Return 400 Error Code for Wrong Request.
mattmakesmaps Jan 16, 2013
065bba9
Week 02 Exercises 4/5 in progress.
mattmakesmaps Jan 19, 2013
82ba961
Merge remote-tracking branch 'origin/master'
mattmakesmaps Jan 19, 2013
7a94232
Update exercise 5 to serve image file formats.
mattmakesmaps Jan 19, 2013
41cf0b9
Added date header.
mattmakesmaps Jan 19, 2013
baea308
Added directory listing.
mattmakesmaps Jan 19, 2013
6fd6edd
Added directory listing.
mattmakesmaps Jan 19, 2013
5499be9
Added 500 Error Handling; time page generation.
mattmakesmaps Jan 19, 2013
df64298
Added notes.mkd and moved final files into athome dir.
mattmakesmaps Jan 19, 2013
a58926b
Added blueboxgrid url to notes.
mattmakesmaps Jan 19, 2013
b779ca0
Merge remote-tracking branch 'upstream/master'
mattmakesmaps Jan 23, 2013
deb9b9c
Push notes.
mattmakesmaps Jan 30, 2013
a8183ac
Merge remote-tracking branch 'upstream/master'
mattmakesmaps Jan 30, 2013
a5cc4e0
Merge remote-tracking branch 'upstream/master'
mattmakesmaps Feb 3, 2013
99cfb06
Finished draft of bookdb WSGI script.
mattmakesmaps Feb 3, 2013
2f9cb4a
Finished draft of bookdb WSGI script.
mattmakesmaps Feb 3, 2013
4f5e13d
Added week04 assignment README.
mattmakesmaps Feb 3, 2013
ac59467
Flask Hello World
mattmakesmaps Feb 6, 2013
6d8338e
Merge remote-tracking branch 'upstream/master'
mattmakesmaps Feb 6, 2013
ad6680f
Merge remote-tracking branch 'upstream/master'
mattmakesmaps Feb 10, 2013
3a28ca0
First part of flaskr.
mattmakesmaps Feb 10, 2013
63e812f
Commit of my own flaskr working dir.
mattmakesmaps Feb 10, 2013
684f24d
Flaskr Write Unit Tests.
mattmakesmaps Feb 10, 2013
0baecf3
Flaskr passing read unit tests.
mattmakesmaps Feb 10, 2013
6332501
Flaskr passing template tests.
mattmakesmaps Feb 10, 2013
2da3ef3
Flaskr passing login/logout unittest.
mattmakesmaps Feb 10, 2013
b40d210
Updated layout.html template with metavan code.
mattmakesmaps Feb 10, 2013
618f26c
Added form code to add an entry if a user has been authenticated.
mattmakesmaps Feb 10, 2013
438943f
Styled, ready to attempt deployment to bluebox.
mattmakesmaps Feb 10, 2013
1ae6b4c
Moved week 5 homework and readme to athome dir.
mattmakesmaps Feb 10, 2013
6f30b5c
Merge remote-tracking branch 'upstream/master'
mattmakesmaps Feb 13, 2013
61ac829
Djangor Application
mattmakesmaps Feb 17, 2013
ba477ce
Update of Djangor to include django-registration application.
mattmakesmaps Feb 18, 2013
186c877
Added some comments.
mattmakesmaps Feb 18, 2013
7fc7c6c
Added some URL Reversing for different views.
mattmakesmaps Feb 18, 2013
ee6eafe
Added README
mattmakesmaps Feb 18, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ svn-commit.tmp
bin
build
include
lib
lib
*.idea
12 changes: 12 additions & 0 deletions Working_Junk/flask/flask_hello_world.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
__author__ = 'matt'

# From the Quickstart
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
return 'Hello World!'

if __name__ == '__main__':
app.run()
39 changes: 39 additions & 0 deletions Working_Junk/week01/binary_tide_echo_server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""
http://www.binarytides.com/python-socket-programming-tutorial/2/
"""

import socket
import sys

HOST = '' # Symbolic name meaning all available interfaces
PORT = 8888 # Arbitrary non-privileged port

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print 'Socket created'

try:
s.bind((HOST, PORT))
except socket.error , msg:
print 'Bind failed. Error Code : ' + str(msg[0]) + ' Message ' + msg[1]
sys.exit()

print 'Socket bind complete'

s.listen(10)
print 'Socket now listening'

#now keep talking with the client
while 1:
#wait to accept a connection - blocking call
conn, addr = s.accept()
print 'Connected with ' + addr[0] + ':' + str(addr[1])

data = conn.recv(1024)
reply = 'OK...' + data
if not data:
break

conn.sendall(reply)

conn.close()
s.close()
56 changes: 56 additions & 0 deletions Working_Junk/week01/binary_tide_echo_server_threaded.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"""
Source: http://www.binarytides.com/python-socket-programming-tutorial/2/
"""
import socket
import sys
from thread import *

HOST = '127.0.0.1' # Symbolic name meaning all available interfaces
PORT = 8889 # Arbitrary non-privileged port

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print 'Socket created'

#Bind socket to local host and port
try:
s.bind((HOST, PORT))
except socket.error , msg:
print 'Bind failed. Error Code : ' + str(msg[0]) + ' Message ' + msg[1]
sys.exit()

print 'Socket bind complete'

#Start listening on socket
s.listen(10)
print 'Socket now listening'

#Function for handling connections. This will be used to create threads
def clientthread(conn):
#Sending message to connected client
conn.send('Welcome to the server. Type something and hit enter\n') #send only takes string

#infinite loop so that function do not terminate and thread do not end.
while True:

#Receiving from client
data = conn.recv(1024)
reply = 'OK...' + data
if not data:
break

conn.sendall(reply)

#came out of loop
conn.close()

#now keep talking with the client
while 1:
#wait to accept a connection - blocking call
conn, addr = s.accept()
print 'Connected with ' + addr[0] + ':' + str(addr[1])

#start new thread takes 1st argument as a function name to be run, second is the tuple of arguments to the function.
start_new_thread(clientthread ,(conn,))

s.close()

19 changes: 19 additions & 0 deletions Working_Junk/week02/smtp_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
__author__ = 'matt'

import smtplib
server = smtplib.SMTP('smtp.webfaction.com', 587)
server.set_debuglevel(True)
server.ehlo()
server.starttls()
server.ehlo()
server.login('crisewing_demobox', 's00p3rs3cr3t')
from_addr = "Hung Dom (Fake) <htdom@comcast.net>"
to_addrs = "matt@ridolfi.com"
subject = "Test Message"
message = "Gimme mah shrimp-fly-rice!"

template = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n"
headers = template % (from_addr, to_addrs, subject)
email_body = headers + message
server.sendmail(from_addr, [to_addrs,], email_body)
server.close()
Loading