Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
511816ea
Commit
511816ea
authored
Jan 18, 2012
by
Kostas Papadimitriou
Browse files
Fix management commands imports for namespace packages
parent
aaa26136
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-webproject/synnefo/webproject/manage.py
View file @
511816ea
...
...
@@ -36,6 +36,7 @@ def find_modules(name, path=None):
Unlike find_module in the imp package this returns a list of all
matched modules.
"""
results
=
[]
if
path
is
None
:
path
=
sys
.
path
for
p
in
path
:
...
...
@@ -50,9 +51,19 @@ def find_modules(name, path=None):
if
result
is
not
None
:
results
.
append
(
result
)
except
ImportError
:
if
sys
.
modules
.
get
(
name
,
None
):
modpath
=
sys
.
modules
[
name
].
__path__
if
isinstance
(
modpath
,
basestring
)
and
not
(
''
,
modpath
)
in
results
:
results
.
append
((
''
,
sys
.
modules
[
name
].
__path__
))
else
:
for
mp
in
modpath
:
if
not
(
''
,
mp
)
in
results
:
results
.
append
((
''
,
mp
))
pass
if
not
results
:
raise
ImportError
(
"No module named %.200s"
%
name
)
return
results
def
find_management_module
(
app_name
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment