Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
293c2950
Verified
Commit
293c2950
authored
4 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Allow for app packages with different package structure
parent
900bbc27
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!395
Use setuptools entrypoints to find apps
Pipeline
#4522
passed
4 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/util/core_helpers.py
+11
-4
11 additions, 4 deletions
aleksis/core/util/core_helpers.py
with
11 additions
and
4 deletions
aleksis/core/util/core_helpers.py
+
11
−
4
View file @
293c2950
...
...
@@ -76,10 +76,17 @@ def merge_app_settings(
"""
for
app
in
get_app_packages
():
pkg
=
"
.
"
.
join
(
app
.
split
(
"
.
"
)[:
-
2
])
try
:
mod_settings
=
import_module
(
pkg
+
"
.settings
"
)
except
ImportError
:
# Import errors are non-fatal. They mean that the app has no settings.py.
mod_settings
=
None
while
"
.
"
in
pkg
:
try
:
mod_settings
=
import_module
(
pkg
+
"
.settings
"
)
except
ImportError
:
# Import errors are non-fatal.
pkg
=
"
.
"
.
join
(
pkg
.
split
(
"
.
"
)[:
-
1
])
continue
break
if
not
mod_settings
:
# The app does not have settings
continue
app_setting
=
getattr
(
mod_settings
,
setting
,
None
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment