Example #1
0
File: app.py Project: wrook/wrook
def handle_exception(requestHandler, exception, debug_mode):
    import cgi
    import sys
    import traceback
    import jsonpickle
    from feathers import utils

    if not debug_mode:
        trace = "".join(traceback.format_exception(*sys.exc_info()))
        try:
            trace = trace + "\n\n\nRequest state:\n" + jsonpickle.encode(requestHandler)
        except:
            trance = trace + "\n\n\nState request unavailable"
        # 		requestHandler.onRequest()
        requestHandler.CurrentTheme = None
        requestHandler.error(500)
        requestHandler.Model.update({"currentTheme": None, "trace": utils.text_to_linebreaks(trace)})
        requestHandler.render2("views/http500.html")
    else:
        super(requestHandler, exception, debug_mode)
Example #2
0
	def text_with_linebreaks(self):
		from feathers import utils
		return utils.text_to_linebreaks(self.Text)
Example #3
0
File: books.py Project: wrook/wrook
    def text_last_words(self, wordsCutoff=1000):
        from feathers import utils

        return utils.text_to_linebreaks(utils.lastWords(self.Text, wordsCutoff))