Use absolute imports and rename package to ihatemoney
4
Makefile
|
@ -29,7 +29,7 @@ remove-install-stamp:
|
||||||
update: remove-install-stamp install
|
update: remove-install-stamp install
|
||||||
|
|
||||||
serve: install
|
serve: install
|
||||||
$(PYTHON) -m budget.manage runserver
|
$(PYTHON) -m ihatemoney.manage runserver
|
||||||
|
|
||||||
test: $(DEV_STAMP)
|
test: $(DEV_STAMP)
|
||||||
$(VENV)/bin/tox
|
$(VENV)/bin/tox
|
||||||
|
@ -38,7 +38,7 @@ release: $(DEV_STAMP)
|
||||||
$(VENV)/bin/fullrelease
|
$(VENV)/bin/fullrelease
|
||||||
|
|
||||||
build-translations:
|
build-translations:
|
||||||
$(VENV)/bin/pybabel compile -d budget/translations
|
$(VENV)/bin/pybabel compile -d ihatemoney/translations
|
||||||
|
|
||||||
build-requirements:
|
build-requirements:
|
||||||
$(VIRTUALENV) $(TEMPDIR)
|
$(VIRTUALENV) $(TEMPDIR)
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
from flask import Blueprint, request
|
from flask import Blueprint, request
|
||||||
from flask_rest import RESTResource, need_auth
|
from flask_rest import RESTResource, need_auth
|
||||||
|
|
||||||
from .models import db, Project, Person, Bill
|
from ihatemoney.models import db, Project, Person, Bill
|
||||||
from .forms import (ProjectForm, EditProjectForm, MemberForm,
|
from ihatemoney.forms import (ProjectForm, EditProjectForm, MemberForm,
|
||||||
get_billform_for)
|
get_billform_for)
|
||||||
|
|
||||||
|
|
||||||
api = Blueprint("api", __name__, url_prefix="/api")
|
api = Blueprint("api", __name__, url_prefix="/api")
|
|
@ -10,8 +10,8 @@ from wtforms.widgets import html_params
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from jinja2 import Markup
|
from jinja2 import Markup
|
||||||
|
|
||||||
from .models import Project, Person
|
from ihatemoney.models import Project, Person
|
||||||
from .utils import slugify
|
from ihatemoney.utils import slugify
|
||||||
|
|
||||||
def get_billform_for(project, set_default=True, **kwargs):
|
def get_billform_for(project, set_default=True, **kwargs):
|
||||||
"""Return an instance of BillForm configured for a particular project.
|
"""Return an instance of BillForm configured for a particular project.
|
|
@ -5,8 +5,8 @@ from flask_script import Manager, Command
|
||||||
from flask_migrate import Migrate, MigrateCommand
|
from flask_migrate import Migrate, MigrateCommand
|
||||||
from werkzeug.security import generate_password_hash
|
from werkzeug.security import generate_password_hash
|
||||||
|
|
||||||
from .run import app
|
from ihatemoney.run import app
|
||||||
from .models import db
|
from ihatemoney.models import db
|
||||||
|
|
||||||
|
|
||||||
class GeneratePasswordHash(Command):
|
class GeneratePasswordHash(Command):
|
||||||
|
@ -20,7 +20,7 @@ migrate = Migrate(app, db)
|
||||||
|
|
||||||
manager = Manager(app)
|
manager = Manager(app)
|
||||||
manager.add_command('db', MigrateCommand)
|
manager.add_command('db', MigrateCommand)
|
||||||
manager.add_command('generate_password_hash', GeneratePasswordHash)
|
manager.add_command('generate_password_hash', GeneratePasswordHash)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
|
@ -7,12 +7,12 @@ from flask_babel import Babel
|
||||||
from flask_migrate import Migrate, upgrade, stamp
|
from flask_migrate import Migrate, upgrade, stamp
|
||||||
from raven.contrib.flask import Sentry
|
from raven.contrib.flask import Sentry
|
||||||
|
|
||||||
from .web import main, db, mail
|
from ihatemoney.web import main, db, mail
|
||||||
from .api import api
|
from ihatemoney.api import api
|
||||||
from .utils import PrefixedWSGI
|
from ihatemoney.utils import PrefixedWSGI
|
||||||
from .utils import minimal_round
|
from ihatemoney.utils import minimal_round
|
||||||
|
|
||||||
from . import default_settings
|
from ihatemoney import default_settings
|
||||||
|
|
||||||
app = Flask(__name__, instance_path='/etc/ihatemoney', instance_relative_config=True)
|
app = Flask(__name__, instance_path='/etc/ihatemoney', instance_relative_config=True)
|
||||||
|
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 274 B |
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 259 B After Width: | Height: | Size: 259 B |
|
@ -17,9 +17,9 @@ from flask import session
|
||||||
if 'IHATEMONEY_SETTINGS_FILE_PATH' in os.environ:
|
if 'IHATEMONEY_SETTINGS_FILE_PATH' in os.environ:
|
||||||
del os.environ['IHATEMONEY_SETTINGS_FILE_PATH']
|
del os.environ['IHATEMONEY_SETTINGS_FILE_PATH']
|
||||||
|
|
||||||
from .. import run
|
from ihatemoney import run
|
||||||
from .. import models
|
from ihatemoney import models
|
||||||
from .. import utils
|
from ihatemoney import utils
|
||||||
|
|
||||||
__HERE__ = os.path.dirname(os.path.abspath(__file__))
|
__HERE__ = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
|
@ -22,13 +22,13 @@ import werkzeug
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
|
||||||
from .models import db, Project, Person, Bill
|
from ihatemoney.models import db, Project, Person, Bill
|
||||||
from .forms import (
|
from ihatemoney.forms import (
|
||||||
AdminAuthenticationForm, AuthenticationForm, EditProjectForm,
|
AdminAuthenticationForm, AuthenticationForm, EditProjectForm,
|
||||||
InviteForm, MemberForm, PasswordReminder, ProjectForm, get_billform_for,
|
InviteForm, MemberForm, PasswordReminder, ProjectForm, get_billform_for,
|
||||||
ExportForm
|
ExportForm
|
||||||
)
|
)
|
||||||
from .utils import Redirect303, list_of_dicts2json, list_of_dicts2csv
|
from ihatemoney.utils import Redirect303, list_of_dicts2json, list_of_dicts2csv
|
||||||
|
|
||||||
main = Blueprint("main", __name__)
|
main = Blueprint("main", __name__)
|
||||||
mail = Mail()
|
mail = Mail()
|
2
tox.ini
|
@ -6,7 +6,7 @@ skip_missing_interpreters = True
|
||||||
|
|
||||||
commands =
|
commands =
|
||||||
python --version
|
python --version
|
||||||
py.test budget/tests/tests.py
|
py.test ihatemoney/tests/tests.py
|
||||||
deps =
|
deps =
|
||||||
-rdev-requirements.txt
|
-rdev-requirements.txt
|
||||||
-rrequirements.txt
|
-rrequirements.txt
|
||||||
|
|