From b91927e37c307fab4e591ae9aa7edd55c1a7cd4c Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Wed, 23 Oct 2013 17:16:39 +0000 Subject: [PATCH] Added gramps. to webapp imports (should make webapp a package) svn: r23375 --- gramps/webapp/Makefile | 2 +- gramps/webapp/grampsdb/templatetags/my_tags.py | 12 ++++++------ gramps/webapp/grampsdb/view/citation.py | 8 ++++---- gramps/webapp/grampsdb/view/event.py | 10 +++++----- gramps/webapp/grampsdb/view/family.py | 8 ++++---- gramps/webapp/grampsdb/view/media.py | 8 ++++---- gramps/webapp/grampsdb/view/note.py | 10 +++++----- gramps/webapp/grampsdb/view/person.py | 8 ++++---- gramps/webapp/grampsdb/view/place.py | 8 ++++---- gramps/webapp/grampsdb/view/repository.py | 8 ++++---- gramps/webapp/grampsdb/view/source.py | 8 ++++---- gramps/webapp/grampsdb/view/tag.py | 8 ++++---- gramps/webapp/settings.py | 3 ++- 13 files changed, 51 insertions(+), 50 deletions(-) diff --git a/gramps/webapp/Makefile b/gramps/webapp/Makefile index 16be63b5f..6877144f9 100644 --- a/gramps/webapp/Makefile +++ b/gramps/webapp/Makefile @@ -1,6 +1,6 @@ # Initialize GRAMPS Django site -PYTHON=GRAMPS_RESOURCES=../.. PYTHONPATH=../.. python +PYTHON=GRAMPS_RESOURCES=../.. PYTHONPATH=../.. python2.7 update: grampsdb/fixtures/initial_data.json $(PYTHON) manage.py syncdb --noinput diff --git a/gramps/webapp/grampsdb/templatetags/my_tags.py b/gramps/webapp/grampsdb/templatetags/my_tags.py index e99d9d70f..40230f5ed 100644 --- a/gramps/webapp/grampsdb/templatetags/my_tags.py +++ b/gramps/webapp/grampsdb/templatetags/my_tags.py @@ -26,9 +26,9 @@ import re from django import template from django.template import Library from django.utils.safestring import mark_safe -from webapp.utils import * -from webapp.grampsdb.views import VIEWS -import webapp.utils +from gramps.webapp.utils import * +from gramps.webapp.grampsdb.views import VIEWS +import gramps.webapp.utils #escape = lambda text: text @@ -79,12 +79,12 @@ def make_tag(func): return do_func for filter_name in util_filters: - func = getattr(webapp.utils, filter_name) + func = getattr(gramps.webapp.utils, filter_name) func.is_safe = True register.filter(filter_name, func) for tag_name in util_tags: - func = getattr(webapp.utils, tag_name) + func = getattr(gramps.webapp.utils, tag_name) register.tag(tag_name, make_tag(func)) probably_alive.is_safe = True @@ -182,7 +182,7 @@ format.is_safe = True register.simple_tag(format) def make_args(search, page): - return webapp.utils.build_args(search=search, page=page) + return gramps.webapp.utils.build_args(search=search, page=page) make_args.is_safe = True register.simple_tag(make_args) diff --git a/gramps/webapp/grampsdb/view/citation.py b/gramps/webapp/grampsdb/view/citation.py index 37ffc923b..51643894c 100644 --- a/gramps/webapp/grampsdb/view/citation.py +++ b/gramps/webapp/grampsdb/view/citation.py @@ -22,10 +22,10 @@ """ Views for Person, Name, and Surname """ ## Gramps Modules -from webapp.utils import _, boolean, update_last_changed, build_search -from webapp.grampsdb.models import Citation -from webapp.grampsdb.forms import * -from webapp.libdjango import DjangoInterface +from gramps.webapp.utils import _, boolean, update_last_changed, build_search +from gramps.webapp.grampsdb.models import Citation +from gramps.webapp.grampsdb.forms import * +from gramps.webapp.libdjango import DjangoInterface ## Django Modules from django.shortcuts import get_object_or_404, render_to_response, redirect diff --git a/gramps/webapp/grampsdb/view/event.py b/gramps/webapp/grampsdb/view/event.py index 012994be9..714a8ccd6 100644 --- a/gramps/webapp/grampsdb/view/event.py +++ b/gramps/webapp/grampsdb/view/event.py @@ -24,11 +24,11 @@ from __future__ import print_function ## Gramps Modules -from webapp.utils import _, boolean, update_last_changed, build_search -from webapp.grampsdb.models import Event, EventType, EventRef, EventRoleType, Person -from webapp.grampsdb.forms import * -from webapp.libdjango import DjangoInterface, lookup_role_index -from webapp.dbdjango import DbDjango +from gramps.webapp.utils import _, boolean, update_last_changed, build_search +from gramps.webapp.grampsdb.models import Event, EventType, EventRef, EventRoleType, Person +from gramps.webapp.grampsdb.forms import * +from gramps.webapp.libdjango import DjangoInterface, lookup_role_index +from gramps.webapp.dbdjango import DbDjango from gramps.gen.datehandler import displayer, parser ## Django Modules diff --git a/gramps/webapp/grampsdb/view/family.py b/gramps/webapp/grampsdb/view/family.py index 17787a315..bc63a695e 100644 --- a/gramps/webapp/grampsdb/view/family.py +++ b/gramps/webapp/grampsdb/view/family.py @@ -22,10 +22,10 @@ """ Views for Person, Name, and Surname """ ## Gramps Modules -from webapp.utils import _, boolean, update_last_changed, build_search -from webapp.grampsdb.models import Family -from webapp.grampsdb.forms import * -from webapp.libdjango import DjangoInterface +from gramps.webapp.utils import _, boolean, update_last_changed, build_search +from gramps.webapp.grampsdb.models import Family +from gramps.webapp.grampsdb.forms import * +from gramps.webapp.libdjango import DjangoInterface from gramps.gen.utils.id import create_id ## Django Modules diff --git a/gramps/webapp/grampsdb/view/media.py b/gramps/webapp/grampsdb/view/media.py index d98fb7cd3..3fb938798 100644 --- a/gramps/webapp/grampsdb/view/media.py +++ b/gramps/webapp/grampsdb/view/media.py @@ -22,10 +22,10 @@ """ Views for Person, Name, and Surname """ ## Gramps Modules -from webapp.utils import _, boolean, update_last_changed, build_search -from webapp.grampsdb.models import Media -from webapp.grampsdb.forms import * -from webapp.libdjango import DjangoInterface +from gramps.webapp.utils import _, boolean, update_last_changed, build_search +from gramps.webapp.grampsdb.models import Media +from gramps.webapp.grampsdb.forms import * +from gramps.webapp.libdjango import DjangoInterface from gramps.gen.config import config ## Django Modules diff --git a/gramps/webapp/grampsdb/view/note.py b/gramps/webapp/grampsdb/view/note.py index 5ccfe8cde..aefea7891 100644 --- a/gramps/webapp/grampsdb/view/note.py +++ b/gramps/webapp/grampsdb/view/note.py @@ -22,11 +22,11 @@ """ Views for Person, Name, and Surname """ ## Gramps Modules -from webapp.utils import _, boolean, update_last_changed, StyledNoteFormatter, parse_styled_text, build_search -from webapp.grampsdb.models import Note -from webapp.grampsdb.forms import * -from webapp.libdjango import DjangoInterface -from webapp.dbdjango import DbDjango +from gramps.webapp.utils import _, boolean, update_last_changed, StyledNoteFormatter, parse_styled_text, build_search +from gramps.webapp.grampsdb.models import Note +from gramps.webapp.grampsdb.forms import * +from gramps.webapp.libdjango import DjangoInterface +from gramps.webapp.dbdjango import DbDjango ## Django Modules from django.shortcuts import get_object_or_404, render_to_response, redirect diff --git a/gramps/webapp/grampsdb/view/person.py b/gramps/webapp/grampsdb/view/person.py index 148ef15af..849ff1edb 100644 --- a/gramps/webapp/grampsdb/view/person.py +++ b/gramps/webapp/grampsdb/view/person.py @@ -22,10 +22,10 @@ """ Views for Person, Name, and Surname """ ## Gramps Modules -from webapp.utils import _, boolean, update_last_changed, build_search, make_log -from webapp.grampsdb.models import Person, Name, Surname -from webapp.grampsdb.forms import * -from webapp.libdjango import DjangoInterface +from gramps.webapp.utils import _, boolean, update_last_changed, build_search, make_log +from gramps.webapp.grampsdb.models import Person, Name, Surname +from gramps.webapp.grampsdb.forms import * +from gramps.webapp.libdjango import DjangoInterface ## Django Modules from django.http import Http404 diff --git a/gramps/webapp/grampsdb/view/place.py b/gramps/webapp/grampsdb/view/place.py index fe50f5f36..052c6dc94 100644 --- a/gramps/webapp/grampsdb/view/place.py +++ b/gramps/webapp/grampsdb/view/place.py @@ -22,10 +22,10 @@ """ Views for Person, Name, and Surname """ ## Gramps Modules -from webapp.utils import _, boolean, update_last_changed -from webapp.grampsdb.models import Place -from webapp.grampsdb.forms import * -from webapp.libdjango import DjangoInterface +from gramps.webapp.utils import _, boolean, update_last_changed +from gramps.webapp.grampsdb.models import Place +from gramps.webapp.grampsdb.forms import * +from gramps.webapp.libdjango import DjangoInterface ## Django Modules from django.shortcuts import get_object_or_404, render_to_response, redirect diff --git a/gramps/webapp/grampsdb/view/repository.py b/gramps/webapp/grampsdb/view/repository.py index 70336e0c1..95410a1eb 100644 --- a/gramps/webapp/grampsdb/view/repository.py +++ b/gramps/webapp/grampsdb/view/repository.py @@ -22,10 +22,10 @@ """ Views for Person, Name, and Surname """ ## Gramps Modules -from webapp.utils import _, boolean, update_last_changed, build_search -from webapp.grampsdb.models import Repository -from webapp.grampsdb.forms import * -from webapp.libdjango import DjangoInterface +from gramps.webapp.utils import _, boolean, update_last_changed, build_search +from gramps.webapp.grampsdb.models import Repository +from gramps.webapp.grampsdb.forms import * +from gramps.webapp.libdjango import DjangoInterface ## Django Modules from django.shortcuts import get_object_or_404, render_to_response, redirect diff --git a/gramps/webapp/grampsdb/view/source.py b/gramps/webapp/grampsdb/view/source.py index c766cd56d..b0e178f05 100644 --- a/gramps/webapp/grampsdb/view/source.py +++ b/gramps/webapp/grampsdb/view/source.py @@ -22,10 +22,10 @@ """ Views for Person, Name, and Surname """ ## Gramps Modules -from webapp.utils import _, boolean, update_last_changed, build_search -from webapp.grampsdb.models import Source -from webapp.grampsdb.forms import * -from webapp.libdjango import DjangoInterface +from gramps.webapp.utils import _, boolean, update_last_changed, build_search +from gramps.webapp.grampsdb.models import Source +from gramps.webapp.grampsdb.forms import * +from gramps.webapp.libdjango import DjangoInterface ## Django Modules from django.shortcuts import get_object_or_404, render_to_response, redirect diff --git a/gramps/webapp/grampsdb/view/tag.py b/gramps/webapp/grampsdb/view/tag.py index 8f6605450..ffd743b2a 100644 --- a/gramps/webapp/grampsdb/view/tag.py +++ b/gramps/webapp/grampsdb/view/tag.py @@ -22,10 +22,10 @@ """ Views for Person, Name, and Surname """ ## Gramps Modules -from webapp.utils import _, boolean, update_last_changed -from webapp.grampsdb.models import Tag -from webapp.grampsdb.forms import * -from webapp.libdjango import DjangoInterface +from gramps.webapp.utils import _, boolean, update_last_changed +from gramps.webapp.grampsdb.models import Tag +from gramps.webapp.grampsdb.forms import * +from gramps.webapp.libdjango import DjangoInterface ## Django Modules from django.shortcuts import get_object_or_404, render_to_response, redirect diff --git a/gramps/webapp/settings.py b/gramps/webapp/settings.py index bc7db371c..cea5190ab 100644 --- a/gramps/webapp/settings.py +++ b/gramps/webapp/settings.py @@ -24,7 +24,8 @@ # Need to be able to import Gramps files from here. import os -os.environ['GRAMPS_RESOURCES'] = os.path.dirname(os.path.abspath("..")) +if os.environ.get('GRAMPS_RESOURCES', None) is None: + os.environ['GRAMPS_RESOURCES'] = os.path.dirname(os.path.abspath("../..")) from gramps.gen.const import DATA_DIR, WEB_DIR