diff options
Diffstat (limited to 'bitbake/lib/bb/ui/buildinfohelper.py')
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index c5368f63be..cea53e053a 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -21,19 +21,19 @@ import bb | |||
21 | import re | 21 | import re |
22 | import os | 22 | import os |
23 | 23 | ||
24 | os.environ["DJANGO_SETTINGS_MODULE"] = "toaster.toastermain.settings" | ||
25 | |||
26 | |||
27 | import django | 24 | import django |
28 | from django.utils import timezone | 25 | from django.utils import timezone |
29 | 26 | ||
27 | import toaster | ||
28 | # Add toaster module to the search path to help django.setup() find the right | ||
29 | # modules | ||
30 | sys.path.insert(0, os.path.dirname(toaster.__file__)) | ||
30 | 31 | ||
31 | def _configure_toaster(): | 32 | #Set the DJANGO_SETTINGS_MODULE if it's not already set |
32 | """ Add toaster to sys path for importing modules | 33 | os.environ["DJANGO_SETTINGS_MODULE"] =\ |
33 | """ | 34 | os.environ.get("DJANGO_SETTINGS_MODULE", |
34 | sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'toaster')) | 35 | "toaster.toastermain.settings") |
35 | _configure_toaster() | 36 | # Setup django framework (needs to be done before importing modules) |
36 | |||
37 | django.setup() | 37 | django.setup() |
38 | 38 | ||
39 | from orm.models import Build, Task, Recipe, Layer_Version, Layer, Target, LogMessage, HelpText | 39 | from orm.models import Build, Task, Recipe, Layer_Version, Layer, Target, LogMessage, HelpText |
@@ -54,11 +54,11 @@ from datetime import datetime, timedelta | |||
54 | 54 | ||
55 | from django.db import transaction, connection | 55 | from django.db import transaction, connection |
56 | 56 | ||
57 | |||
57 | # pylint: disable=invalid-name | 58 | # pylint: disable=invalid-name |
58 | # the logger name is standard throughout BitBake | 59 | # the logger name is standard throughout BitBake |
59 | logger = logging.getLogger("ToasterLogger") | 60 | logger = logging.getLogger("ToasterLogger") |
60 | 61 | ||
61 | |||
62 | class NotExisting(Exception): | 62 | class NotExisting(Exception): |
63 | pass | 63 | pass |
64 | 64 | ||