mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 22:05:09 +01:00
More refactoring and some fixes
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import binascii
|
||||
import datetime
|
||||
import gzip
|
||||
import hashlib
|
||||
@@ -37,15 +36,10 @@ except ImportError:
|
||||
APP_ROOT = os.path.dirname(os.path.realpath(__file__))
|
||||
MEDIA_ROOT = os.path.join(APP_ROOT, 'static')
|
||||
MEDIA_URL = '/static/'
|
||||
DATABASE = {
|
||||
'name': os.path.join(APP_ROOT, 'bookmarks.db'),
|
||||
'engine': 'peewee.SqliteDatabase',
|
||||
}
|
||||
|
||||
# create our flask app and a database wrapper
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(__name__)
|
||||
database = SqliteDatabase(os.path.join(APP_ROOT, 'bookmarks.db'))
|
||||
|
||||
# Strip unnecessary whitespace due to jinja2 codeblocks
|
||||
app.jinja_env.trim_blocks = True
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import binascii
|
||||
import os
|
||||
import datetime
|
||||
|
||||
from peewee import * # noqa
|
||||
|
||||
@@ -16,6 +17,12 @@ except ImportError:
|
||||
from urlparse import urljoin, urlparse, urlunparse
|
||||
|
||||
|
||||
DATABASE_PATH = os.path.dirname(os.path.realpath(__file__))
|
||||
if 'DIGIMARKS_DB_PATH' in os.environ:
|
||||
DATABASE_PATH = os.environ['DIGIMARKS_DB_PATH']
|
||||
database = SqliteDatabase(os.path.join(DATABASE_PATH, 'bookmarks.db'))
|
||||
|
||||
|
||||
def ifilterfalse(predicate, iterable):
|
||||
# ifilterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8
|
||||
if predicate is None:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""digimarks theme definitions"
|
||||
"""digimarks theme definitions"""
|
||||
|
||||
DEFAULT_THEME = 'freshgreen'
|
||||
themes = {
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
"""digimarks views"
|
||||
"""digimarks views"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user