old_contents: import os
  import sys
  import urlparse
  import yaml
  from functools import wraps
  
  from flask import (Flask as BaseFlask, Config as BaseConfig, 
                     render_template, flash)
  from werkzeug import BaseResponse
  
  class Config(BaseConfig):
      
      def from_heroku(self):
          # Register database schemes in URLs.
          for ev in ['DATABSE_URL', 'SHARED_DATABASE_URL']
              if ev in os.environ:
                  self['SQLALCHEMY_DATABASE_URI'] = ev
                  break
          
          #self['WEBASSETS_CACHE'] = 
      
      def from_yaml(self, root_path):
          env = os.environ.get('FLASK_ENV', 'DEVELOPMENT').upper()
          self['ENVIRONMENT'] = env.lower()
          
          for fn in ('app', 'credentials'):
              config_file = os.path.join(root_path, 'config', '%s.yml' % fn)
              
              with open(config_file) as f:
                  c = yaml.load(f)
              
              c = c.get(env, c)
              
              for key in c.iterkeys():
                  if key.isupper():
                      self[key] = c[key]
                      
                  
  class Flask(BaseFlask):
      """Extended version of `Flask` that implements custom config class
      and adds `register_middleware` method"""
      
      def make_config(self, instance_relative=False):
          root_path = self.root_path
          if instance_relative:
              root_path = self.instance_path
          return Config(root_path, self.default_config)
      
      def register_middleware(self, middleware_class):
          """Register a WSGI middleware on the application
          :param middleware_class: A WSGI middleware implementation
          """
          self.wsgi_app = middleware_class(self.wsgi_app)
          
new_contents: import os
  import sys
  import urlparse
  import yaml
  from functools import wraps
  
  from flask import (Flask as BaseFlask, Config as BaseConfig, 
                     render_template, flash)
  from werkzeug import BaseResponse
  
  class Config(BaseConfig):
      
      def from_heroku(self):
          # Register database schemes in URLs.
          for ev in ['DATABSE_URL', 'SHARED_DATABASE_URL']:
              if ev in os.environ:
                  self['SQLALCHEMY_DATABASE_URI'] = ev
                  break
          
          #self['WEBASSETS_CACHE'] = 
      
      def from_yaml(self, root_path):
          env = os.environ.get('FLASK_ENV', 'DEVELOPMENT').upper()
          self['ENVIRONMENT'] = env.lower()
          
          for fn in ('app', 'credentials'):
              config_file = os.path.join(root_path, 'config', '%s.yml' % fn)
              
              with open(config_file) as f:
                  c = yaml.load(f)
              
              c = c.get(env, c)
              
              for key in c.iterkeys():
                  if key.isupper():
                      self[key] = c[key]
                      
                  
  class Flask(BaseFlask):
      """Extended version of `Flask` that implements custom config class
      and adds `register_middleware` method"""
      
      def make_config(self, instance_relative=False):
          root_path = self.root_path
          if instance_relative:
              root_path = self.instance_path
          return Config(root_path, self.default_config)
      
      def register_middleware(self, middleware_class):
          """Register a WSGI middleware on the application
          :param middleware_class: A WSGI middleware implementation
          """
          self.wsgi_app = middleware_class(self.wsgi_app)
          
subject: Add missing colon