old_contents: #
  # Copyright (c) Elliot Peele <elliot@bentlogic.net>
  #
  # This program is distributed under the terms of the MIT License as found
  # in a file called LICENSE. If it is not present, the license
  # is always available at http://www.opensource.org/licenses/mit-license.php.
  #
  # This program is distributed in the hope that it will be useful, but
  # without any warrenty; without even the implied warranty of merchantability
  # or fitness for a particular purpose. See the MIT License for full details.
  #
  
  import os
  import sys
  import transaction
  
  from sqlalchemy import engine_from_config
  
  from pyramid.paster import (
      get_appsettings,
      setup_logging,
      )
  
  from ..models import (
      DBSession,
      MyModel,
      Base,
      )
  
  
  def usage(argv):
      cmd = os.path.basename(argv[0])
      print('usage: %s <config_uri>\n'
            '(example: "%s development.ini")' % (cmd, cmd))
      sys.exit(1)
  
  
  def main(argv=sys.argv):
      if len(argv) != 2:
          usage(argv)
      config_uri = argv[1]
      setup_logging(config_uri)
      settings = get_appsettings(config_uri)
      engine = engine_from_config(settings, 'sqlalchemy.')
      DBSession.configure(bind=engine)
      Base.metadata.create_all(engine)
      with transaction.manager:
          model = MyModel(name='one', value=1)
          DBSession.add(model)
  
new_contents: #
  # Copyright (c) Elliot Peele <elliot@bentlogic.net>
  #
  # This program is distributed under the terms of the MIT License as found
  # in a file called LICENSE. If it is not present, the license
  # is always available at http://www.opensource.org/licenses/mit-license.php.
  #
  # This program is distributed in the hope that it will be useful, but
  # without any warrenty; without even the implied warranty of merchantability
  # or fitness for a particular purpose. See the MIT License for full details.
  #
  
  import os
  import sys
  
  from sqlalchemy import engine_from_config
  
  from pyramid.paster import (
      get_appsettings,
      setup_logging,
      )
  
  from ..models import (
      DBSession,
      Base,
      )
  
  
  def usage(argv):
      cmd = os.path.basename(argv[0])
      print('usage: %s <config_uri>\n'
            '(example: "%s development.ini")' % (cmd, cmd))
      sys.exit(1)
  
  
  def main(argv=sys.argv):
      if len(argv) != 2:
          usage(argv)
      config_uri = argv[1]
      setup_logging(config_uri)
      settings = get_appsettings(config_uri)
      engine = engine_from_config(settings, 'sqlalchemy.')
      DBSession.configure(bind=engine)
      Base.metadata.create_all(engine)
  
subject: remove unused imports