import traceback
import logging
logging.basicConfig(level=logging.INFO)

from NewDoc import NewDoc
from AssignHost import AssignHost
from UpdateWeather import UpdateWeather

from flask import Flask
app = Flask(__name__)
#app.config['DEBUG'] = True

# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.


@app.route('/')
def assign():
    AssignAction = AssignHost()
    return AssignAction.do()

@app.route('/b/<ad_hoc_hosts>')
def assign_m(ad_hoc_hosts):
    AssignAction = AssignHost(Host=ad_hoc_hosts.split('+'))
    return AssignAction.do()

@app.route('/newdoc')
def newdoc():
    NewDocAction = NewDoc()
    return NewDocAction.do()

@app.route('/updateweather')
def updateweather():
    UpdateAction = UpdateWeather()
    return UpdateAction.do()

@app.errorhandler(404)
def page_not_found(e):
    """Return a custom 404 error."""
    return 'Sorry, nothing at this URL.', 404

@app.errorhandler(Exception)
def handle_exception(e):
    tb = traceback.format_exc()
    logging.error(tb)
    return tb, e.code if 'code' in dir(e) else 500

@@ -503,17 +503,16 @@
 hoc_host
-s
 %3E')%0D%0Adef
@@ -532,17 +532,16 @@
 hoc_host
-s
 ):%0D%0A    
@@ -582,17 +582,16 @@
 hoc_host
-s
 .split('
@@ -1105,18 +1105,38 @@
  return 
+%22%3Cpre%3E%25s%3C/pre%3E%22 %25 (
 tb
+)
 , e.code

Format traceback