Skip to content

Commit

Permalink
Revert "* Added use_db option, moved db imports into Juno.__init__"
Browse files Browse the repository at this point in the history
This reverts commit 6b7e6c5.
  • Loading branch information
breily committed Mar 10, 2009
1 parent 6b7e6c5 commit d46b206
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions juno.py
Expand Up @@ -3,6 +3,11 @@
import re
import os
import sys
# DB library imports
from sqlalchemy import (create_engine, Table, MetaData, Column, Integer, String,
Unicode, Text, UnicodeText, Date, Numeric, Time, Float,
DateTime, Interval, Binary, Boolean, PickleType)
from sqlalchemy.orm import sessionmaker, mapper
# Server imports
import urlparse
import cgi
Expand Down Expand Up @@ -44,7 +49,6 @@ def __init__(self, configuration=None):
'404_template': '404.html',
'500_template': '500.html',
# Database options
'use_db': True,
'db_type': 'sqlite',
'db_location': ':memory:',
'db_models': {},
Expand All @@ -65,8 +69,7 @@ def __init__(self, configuration=None):
if self.config['use_templates']:
self.setup_templates()
# Set up the database
if self.config['use_db']:
self.setup_database()
self.setup_database()

def setup_static(self):
self.route(self.config['static_url'], self.config['static_handler'], '*')
Expand All @@ -93,11 +96,6 @@ def setup_templates(self):
)

def setup_database(self):
# DB library imports
from sqlalchemy import (create_engine, Table, MetaData, Column, Integer, String,
Unicode, Text, UnicodeText, Date, Numeric, Time, Float,
DateTime, Interval, Binary, Boolean, PickleType)
from sqlalchemy.orm import sessionmaker, mapper
# Ensures correct slash number for sqlite
if self.config['db_type'] == 'sqlite':
self.config['db_location'] = '/' + self.config['db_location']
Expand Down

0 comments on commit d46b206

Please sign in to comment.