Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: cms/bin/test_server.py

Issue 6364489058353152: Issue 2126 - Adapted CMS for living in its own repository rather than sitescripts (Closed)
Patch Set: Added .pyo to ignore files Created March 12, 2015, 4:22 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cms/bin/generate_static_pages.py ('k') | cms/converters.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/bin/test_server.py
===================================================================
--- a/cms/bin/test_server.py
+++ b/cms/bin/test_server.py
@@ -11,22 +11,21 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
import sys, os, flask
-from ...utils import setupStderr
from ..utils import process_page
from ..sources import FileSource
from ..converters import converters
-app = flask.Flask("sitescripts.cms.bin.test_server")
+app = flask.Flask("cms.bin.test_server")
source = None
mime_types = {
"": "text/html; charset=utf-8",
".htm": "text/html; charset=utf-8",
".html": "text/html; charset=utf-8",
".js": "application/javascript; charset=utf-8",
".css": "text/css; charset=utf-8",
@@ -62,19 +61,18 @@ def show(path=""):
if data == None:
flask.abort(404)
root, ext = os.path.splitext(path)
mime = mime_types.get(ext.lower(), "application/octet-stream")
return data, 200, {"Content-Type": mime}
if __name__ == "__main__":
- setupStderr()
if len(sys.argv) < 2:
print >>sys.stderr, "Usage: %s source_dir" % sys.argv[0]
sys.exit(1)
source = FileSource(sys.argv[1])
# Make sure to "fix" argv to ensure that restart can succeed
- sys.argv[0:1] = ["-m", "sitescripts.cms.bin.test_server"]
+ sys.argv[0:1] = ["-m", "cms.bin.test_server"]
app.run(debug=True)
« no previous file with comments | « cms/bin/generate_static_pages.py ('k') | cms/converters.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld