Skip to content
This repository has been archived by the owner on Apr 15, 2018. It is now read-only.

Commit

Permalink
change the structure
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed May 4, 2013
1 parent bde6461 commit b757c0f
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -31,6 +31,7 @@ babel-update: babel-extract

# Common Task
clean: clean-build clean-pyc
@rm -fr cover/

clean-build:
@rm -fr build/
Expand All @@ -43,6 +44,7 @@ clean-pyc:
@find . -name '*.pyo' -exec rm -f {} +
@find . -name '*~' -exec rm -f {} +


june_files := $(shell find june -name '*.py' ! -path "*__init__.py")
test_files := $(shell find tests -name '*.py' ! -path "*__init__.py")
lint:
Expand Down
File renamed without changes.
File renamed without changes.
14 changes: 6 additions & 8 deletions june/app.py
@@ -1,9 +1,8 @@
#!/usr/bin/env python

import os
PROJDIR = os.path.abspath(os.path.dirname(__file__))
ROOTDIR = os.path.split(PROJDIR)[0]
CONFDIR = os.path.join(PROJDIR, '_config')
PROJDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
CONFDIR = os.path.join(PROJDIR, 'etc')

import datetime
from flask import Flask
Expand All @@ -19,17 +18,16 @@
def create_app(config=None):
app = Flask(
__name__,
static_folder='_static',
static_url_path='/_static',
static_folder=os.path.join(PROJDIR, 'static'),
template_folder='templates'
)
app.config.from_pyfile(os.path.join(CONFDIR, 'base.py'))
app.config.from_pyfile(os.path.join(CONFDIR, 'base_config.py'))

if 'JUNE_SETTINGS' in os.environ:
app.config.from_envvar('JUNE_SETTINGS')

if config and isinstance(config, dict):
app.config.update(config)
elif config:
if config:
app.config.from_pyfile(config)

app.config.update({'SITE_TIME': datetime.datetime.utcnow()})
Expand Down
4 changes: 2 additions & 2 deletions manager.py
Expand Up @@ -3,11 +3,11 @@
import gevent.monkey
gevent.monkey.patch_all()

import os
from flask.ext.script import Manager
from june.app import create_app

#CONFIG = os.path.abspath('./etc/config.py')
CONFIG = '_config/development.py'
CONFIG = os.path.abspath('./etc/dev_config.py')

app = create_app(CONFIG)
manager = Manager(app)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b757c0f

Please sign in to comment.