From 76982937a68a2adaf96ec2d258e369d7c871a609 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Wed, 10 Sep 2014 11:34:58 +1200 Subject: [PATCH] Reorg to put web app in its own directory --- libmproxy/flow.py | 5 +++-- libmproxy/web/__init__.py | 0 libmproxy/{ => web}/app.py | 2 +- libmproxy/{ => web}/static/bootstrap.min.css | 0 libmproxy/{ => web}/static/bootstrap.min.js | 0 .../static/fontawesome/css/font-awesome.css | 0 .../static/fontawesome/css/font-awesome.min.css | 0 .../static/fontawesome/fonts/FontAwesome.otf | Bin .../fontawesome/fonts/fontawesome-webfont.eot | Bin .../fontawesome/fonts/fontawesome-webfont.svg | 0 .../fontawesome/fonts/fontawesome-webfont.ttf | Bin .../fontawesome/fonts/fontawesome-webfont.woff | Bin libmproxy/{ => web}/static/jquery-1.10.1.min.js | 0 .../{ => web}/static/jquery.localscroll-min.js | 0 libmproxy/{ => web}/static/jquery.scrollTo-min.js | 0 libmproxy/{ => web}/static/mitmproxy.css | 0 libmproxy/{ => web}/templates/certs.html | 0 libmproxy/{ => web}/templates/frame.html | 0 libmproxy/{ => web}/templates/index.html | 0 libmproxy/{ => web}/templates/layout.html | 0 20 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 libmproxy/web/__init__.py rename libmproxy/{ => web}/app.py (96%) rename libmproxy/{ => web}/static/bootstrap.min.css (100%) rename libmproxy/{ => web}/static/bootstrap.min.js (100%) rename libmproxy/{ => web}/static/fontawesome/css/font-awesome.css (100%) rename libmproxy/{ => web}/static/fontawesome/css/font-awesome.min.css (100%) rename libmproxy/{ => web}/static/fontawesome/fonts/FontAwesome.otf (100%) rename libmproxy/{ => web}/static/fontawesome/fonts/fontawesome-webfont.eot (100%) rename libmproxy/{ => web}/static/fontawesome/fonts/fontawesome-webfont.svg (100%) rename libmproxy/{ => web}/static/fontawesome/fonts/fontawesome-webfont.ttf (100%) rename libmproxy/{ => web}/static/fontawesome/fonts/fontawesome-webfont.woff (100%) rename libmproxy/{ => web}/static/jquery-1.10.1.min.js (100%) rename libmproxy/{ => web}/static/jquery.localscroll-min.js (100%) rename libmproxy/{ => web}/static/jquery.scrollTo-min.js (100%) rename libmproxy/{ => web}/static/mitmproxy.css (100%) rename libmproxy/{ => web}/templates/certs.html (100%) rename libmproxy/{ => web}/templates/frame.html (100%) rename libmproxy/{ => web}/templates/index.html (100%) rename libmproxy/{ => web}/templates/layout.html (100%) diff --git a/libmproxy/flow.py b/libmproxy/flow.py index d263ccdde3..c4cbb36aff 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -9,7 +9,8 @@ import requests from netlib import odict, wsgi import netlib.http -from . import controller, protocol, tnetstring, filt, script, version, app +from . import controller, protocol, tnetstring, filt, script, version +from .web import app from .protocol import http, handle from .proxy.config import parse_host_pattern @@ -727,7 +728,7 @@ def handle_responseheaders(self, f): self.stream_large_bodies.run(f, False) f.reply() - return f + return f def handle_response(self, f): self.state.add_response(f) diff --git a/libmproxy/web/__init__.py b/libmproxy/web/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libmproxy/app.py b/libmproxy/web/app.py similarity index 96% rename from libmproxy/app.py rename to libmproxy/web/app.py index ed7ec72a50..9b5db38a28 100644 --- a/libmproxy/app.py +++ b/libmproxy/web/app.py @@ -1,7 +1,7 @@ from __future__ import absolute_import import flask import os -from .proxy import config +from ..proxy import config mapp = flask.Flask(__name__) mapp.debug = True diff --git a/libmproxy/static/bootstrap.min.css b/libmproxy/web/static/bootstrap.min.css similarity index 100% rename from libmproxy/static/bootstrap.min.css rename to libmproxy/web/static/bootstrap.min.css diff --git a/libmproxy/static/bootstrap.min.js b/libmproxy/web/static/bootstrap.min.js similarity index 100% rename from libmproxy/static/bootstrap.min.js rename to libmproxy/web/static/bootstrap.min.js diff --git a/libmproxy/static/fontawesome/css/font-awesome.css b/libmproxy/web/static/fontawesome/css/font-awesome.css similarity index 100% rename from libmproxy/static/fontawesome/css/font-awesome.css rename to libmproxy/web/static/fontawesome/css/font-awesome.css diff --git a/libmproxy/static/fontawesome/css/font-awesome.min.css b/libmproxy/web/static/fontawesome/css/font-awesome.min.css similarity index 100% rename from libmproxy/static/fontawesome/css/font-awesome.min.css rename to libmproxy/web/static/fontawesome/css/font-awesome.min.css diff --git a/libmproxy/static/fontawesome/fonts/FontAwesome.otf b/libmproxy/web/static/fontawesome/fonts/FontAwesome.otf similarity index 100% rename from libmproxy/static/fontawesome/fonts/FontAwesome.otf rename to libmproxy/web/static/fontawesome/fonts/FontAwesome.otf diff --git a/libmproxy/static/fontawesome/fonts/fontawesome-webfont.eot b/libmproxy/web/static/fontawesome/fonts/fontawesome-webfont.eot similarity index 100% rename from libmproxy/static/fontawesome/fonts/fontawesome-webfont.eot rename to libmproxy/web/static/fontawesome/fonts/fontawesome-webfont.eot diff --git a/libmproxy/static/fontawesome/fonts/fontawesome-webfont.svg b/libmproxy/web/static/fontawesome/fonts/fontawesome-webfont.svg similarity index 100% rename from libmproxy/static/fontawesome/fonts/fontawesome-webfont.svg rename to libmproxy/web/static/fontawesome/fonts/fontawesome-webfont.svg diff --git a/libmproxy/static/fontawesome/fonts/fontawesome-webfont.ttf b/libmproxy/web/static/fontawesome/fonts/fontawesome-webfont.ttf similarity index 100% rename from libmproxy/static/fontawesome/fonts/fontawesome-webfont.ttf rename to libmproxy/web/static/fontawesome/fonts/fontawesome-webfont.ttf diff --git a/libmproxy/static/fontawesome/fonts/fontawesome-webfont.woff b/libmproxy/web/static/fontawesome/fonts/fontawesome-webfont.woff similarity index 100% rename from libmproxy/static/fontawesome/fonts/fontawesome-webfont.woff rename to libmproxy/web/static/fontawesome/fonts/fontawesome-webfont.woff diff --git a/libmproxy/static/jquery-1.10.1.min.js b/libmproxy/web/static/jquery-1.10.1.min.js similarity index 100% rename from libmproxy/static/jquery-1.10.1.min.js rename to libmproxy/web/static/jquery-1.10.1.min.js diff --git a/libmproxy/static/jquery.localscroll-min.js b/libmproxy/web/static/jquery.localscroll-min.js similarity index 100% rename from libmproxy/static/jquery.localscroll-min.js rename to libmproxy/web/static/jquery.localscroll-min.js diff --git a/libmproxy/static/jquery.scrollTo-min.js b/libmproxy/web/static/jquery.scrollTo-min.js similarity index 100% rename from libmproxy/static/jquery.scrollTo-min.js rename to libmproxy/web/static/jquery.scrollTo-min.js diff --git a/libmproxy/static/mitmproxy.css b/libmproxy/web/static/mitmproxy.css similarity index 100% rename from libmproxy/static/mitmproxy.css rename to libmproxy/web/static/mitmproxy.css diff --git a/libmproxy/templates/certs.html b/libmproxy/web/templates/certs.html similarity index 100% rename from libmproxy/templates/certs.html rename to libmproxy/web/templates/certs.html diff --git a/libmproxy/templates/frame.html b/libmproxy/web/templates/frame.html similarity index 100% rename from libmproxy/templates/frame.html rename to libmproxy/web/templates/frame.html diff --git a/libmproxy/templates/index.html b/libmproxy/web/templates/index.html similarity index 100% rename from libmproxy/templates/index.html rename to libmproxy/web/templates/index.html diff --git a/libmproxy/templates/layout.html b/libmproxy/web/templates/layout.html similarity index 100% rename from libmproxy/templates/layout.html rename to libmproxy/web/templates/layout.html