old_contents: #!/usr/bin/env python3
  from raven.handlers.logbook import SentryHandler
  
  from home.settings import SENTRY_URL
  
  try:
      import eventlet
  
      eventlet.monkey_patch()
      print('Using eventlet')
      create_thread_func = lambda f: f
      start_thread_func = lambda f: eventlet.spawn(f)
  except ImportError:
      try:
          import gevent
          import gevent.monkey
  
          gevent.monkey.patch_all()
          print('Using gevent')
          create_thread_func = lambda f: gevent.Greenlet(f)
          start_thread_func = lambda t: t.start()
      except ImportError:
          import threading
  
          print('Using threading')
          create_thread_func = lambda f: threading.Thread(target=f)
          start_thread_func = lambda t: t.start()
  
  import logging
  import os
  import sys
  from logging.handlers import RotatingFileHandler
  
  from home import settings
  from home.core.parser import parse
  from home.web.models import db_init
  from home.web.utils import gen_guest_login
  from home.web.web import socketio, app
  
  sys.path.append(os.path.dirname(os.path.realpath(__file__)))
  
  db_init()
  
  try:
      parse(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config.yml'))
  except FileNotFoundError:
      print("Error: Create `config.yml` before starting! Start with `example-config.yml`.")
      raise SystemExit
  handler = RotatingFileHandler('home.log', maxBytes=10000, backupCount=1)
  handler.setLevel(logging.INFO)
  handler.setFormatter(logging.Formatter("%(asctime)s: %(message)s"))
  if SENTRY_URL:
      sentryhandler = SentryHandler(SENTRY_URL)
      sentryhandler.setLevel(logging.ERROR)
      app.logger.addHandler(sentryhandler)
  app.logger.addHandler(handler)
  app.logger.setLevel(logging.INFO)
  gen_guest_login()
  socketio.run(app, debug=settings.DEBUG)
  
new_contents: #!/usr/bin/env python3
  try:
      import eventlet
  
      eventlet.monkey_patch()
      print('Using eventlet')
      create_thread_func = lambda f: f
      start_thread_func = lambda f: eventlet.spawn(f)
  except ImportError:
      try:
          import gevent
          import gevent.monkey
  
          gevent.monkey.patch_all()
          print('Using gevent')
          create_thread_func = lambda f: gevent.Greenlet(f)
          start_thread_func = lambda t: t.start()
      except ImportError:
          import threading
  
          print('Using threading')
          create_thread_func = lambda f: threading.Thread(target=f)
          start_thread_func = lambda t: t.start()
  
  import logging
  import os
  import sys
  from logging.handlers import RotatingFileHandler
  
  from home import settings
  from home.core.parser import parse
  from home.web.models import db_init
  from home.web.utils import gen_guest_login
  from home.web.web import socketio, app
  
  sys.path.append(os.path.dirname(os.path.realpath(__file__)))
  
  db_init()
  
  try:
      parse(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config.yml'))
  except FileNotFoundError:
      print("Error: Create `config.yml` before starting! Start with `example-config.yml`.")
      raise SystemExit
  handler = RotatingFileHandler('home.log', maxBytes=10000, backupCount=1)
  handler.setLevel(logging.INFO)
  handler.setFormatter(logging.Formatter("%(asctime)s: %(message)s"))
  app.logger.addHandler(handler)
  app.logger.setLevel(logging.INFO)
  gen_guest_login()
  socketio.run(app, debug=settings.DEBUG)
  
subject: Revert Sentry changes