import logging
from flask import Flask, request
from flask.ext.images import Images
from flask_mail import Mail
from flask_login import LoginManager, UserMixin
from pubs_ui.custom_filters import display_publication_info
from itsdangerous import URLSafeTimedSerializer


FORMAT = '%(asctime)s %(message)s'
fmt = logging.Formatter(FORMAT)
handler = logging.FileHandler('pubs_ui.log')
handler.setLevel(logging.INFO)
handler.setFormatter(fmt)


app = Flask(__name__)
app.config.from_object('settings')  # load configuration before passing the app object to other things


@app.before_request
def log_request():
    if app.config.get('LOGGING_ON'):
        request_str = str(request)
        request_headers = str(request.headers)
        log_str = 'Request: ({0}); Headers: ({1})'.format(request_str, request_headers)
        app.logger.info(log_str)


if app.config.get('LOGGING_ON'):
    app.logger.addHandler(handler)
images = Images(app)
mail = Mail(app)
app.view_functions['images'] = images.handle_request
#app.jinja_env.trim_blocks = True
#app.jinja_env.lstrip_blocks = True
app.jinja_env.filters['display_pub_info'] = display_publication_info
app.jinja_env.globals.update(wsgi_str=app.config['WSGI_STR'])
app.jinja_env.globals.update(GOOGLE_ANALYTICS_CODE=app.config['GOOGLE_ANALYTICS_CODE'])
app.jinja_env.globals.update(GOOGLE_WEBMASTER_TOOLS_CODE=app.config['GOOGLE_WEBMASTER_TOOLS_CODE'])
app.jinja_env.globals.update(LAST_MODIFIED=app.config.get('DEPLOYED'))
app.jinja_env.globals.update(ANNOUNCEMENT_BLOCK=app.config['ANNOUNCEMENT_BLOCK'])

import PubsFlask
@@ -1039,80 +1039,8 @@
 st%0D%0A
-#app.jinja_env.trim_blocks = True%0D%0A#app.jinja_env.lstrip_blocks = True%0D%0A
 app.

remove commented code that was for formatting the html