Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
040b1112
Commit
040b1112
authored
Jul 31, 2013
by
Paweł Szostek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add method for choosing module by path
parent
7b6ae833
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
module_pool.py
src/module_pool.py
+7
-1
No files found.
src/module_pool.py
View file @
040b1112
...
...
@@ -35,6 +35,12 @@ class ModulePool(list):
self
.
top_module
=
None
self
.
global_fetch
=
os
.
getenv
(
"HDLMAKE_COREDIR"
)
def
get_module_by_path
(
self
,
path
):
for
module
in
self
:
if
module
.
path
==
path
:
return
module
return
None
def
get_fetchable_modules
(
self
):
return
[
m
for
m
in
self
if
m
.
source
!=
"local"
]
...
...
@@ -65,7 +71,7 @@ class ModulePool(list):
def
new_module
(
self
,
parent
,
url
,
source
,
fetchto
,
process_manifest
=
True
):
from
module
import
Module
if
url
in
[
m
.
url
for
m
in
self
]:
if
url
in
[
m
.
url
for
m
in
self
]:
# check if module is not already in the pool
return
[
m
for
m
in
self
if
m
.
url
==
url
][
0
]
else
:
if
self
.
global_fetch
:
# if there is global fetch parameter (HDLMAKE_COREDIR env variable)
...
...
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