Skip to content

Commit b9487a9

Browse files
author
Mark Grey
committed
organized modules
1 parent 632c5b2 commit b9487a9

File tree

11 files changed

+32
-2
lines changed

11 files changed

+32
-2
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.pyc
2+

Diff for: json_encoder.pyc

-1.05 KB
Binary file not shown.

Diff for: protocols/__init__.py

Whitespace-only changes.

Diff for: protocols/client/__init__.py

Whitespace-only changes.

Diff for: client.py renamed to protocols/client/client.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
log.startLogging(sys.stdout)
1313

14+
TEST_DATA = '/home/mark/projects/swfty/test.csv'
15+
1416
class ClientProtocol(protocol.Protocol):
1517

1618
def connectionMade(self):
@@ -19,8 +21,8 @@ def connectionMade(self):
1921
'lat':43.78,
2022
'lon':-72.5831
2123
},cls=Encoder)
22-
self.fileObject = open('test.csv')
23-
self.totalSize = os.stat('test.csv').st_size
24+
self.fileObject = open(TEST_DATA)
25+
self.totalSize = os.stat(TEST_DATA).st_size
2426
self.uploaded = 0
2527

2628
def start(self):

Diff for: protocols/transfer/__init__.py

Whitespace-only changes.

Diff for: transfer.py renamed to protocols/transfer/transfer.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""This module defines the twisted protocol that will incrementally accept files from the client device"""
2+
13
from twisted.web import proxy
24
from twisted.internet import reactor,protocol
35
from twisted.python import log

Diff for: start_service.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from swfty.swfty import app
2+
from werkzeug.serving import run_simple
3+
4+
application = app
5+
if __name__ == '__main__':
6+
application.debug = True
7+
run_simple('localhost',5050,application,use_reloader=True,use_debugger=True)

Diff for: swfty/__init__.py

Whitespace-only changes.

Diff for: swfty/swfty.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from flask import Flask,render_template,request
2+
from werkzeug.wrappers import Request,Response
3+
4+
app = Flask(__name__)
5+
6+
@app.route('/')
7+
def root():
8+
return render_template('root.html')

Diff for: swfty/templates/root.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
</head>
5+
<body>
6+
<h1>Swfty</h1>
7+
<h2>Simple geo file sharing</h2>
8+
</body>
9+
</html>

0 commit comments

Comments
 (0)