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
5f330e08
Commit
5f330e08
authored
Jul 31, 2016
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
consolidate clean and fetch actions into a single class
parent
53a7393d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
40 deletions
+17
-40
__init__.py
hdlmake/action/__init__.py
+0
-1
clean.py
hdlmake/action/clean.py
+0
-37
fetch.py
hdlmake/action/fetch.py
+15
-0
module_pool.py
hdlmake/module_pool.py
+2
-2
No files found.
hdlmake/action/__init__.py
View file @
5f330e08
...
...
@@ -22,7 +22,6 @@
from
.check_condition
import
CheckCondition
from
.check_manifest
import
CheckManifest
from
.clean
import
CleanModules
from
.fetch
import
FetchModules
from
.list_files
import
ListFiles
from
.list_modules
import
ListModules
...
...
hdlmake/action/clean.py
deleted
100644 → 0
View file @
53a7393d
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 CERN
# Author: Pawel Szostek (pawel.szostek@cern.ch)
#
# This file is part of Hdlmake.
#
# Hdlmake is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Hdlmake is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Hdlmake. If not, see <http://www.gnu.org/licenses/>.
import
logging
import
hdlmake.fetch
as
fetch
from
.action
import
Action
class
CleanModules
(
Action
):
def
clean
(
self
):
logging
.
info
(
"Removing fetched modules.."
)
remove_list
=
[
m
for
m
in
self
if
m
.
source
in
[
fetch
.
GIT
,
fetch
.
SVN
]
and
m
.
isfetched
]
remove_list
.
reverse
()
# we will remove modules in backward order
if
len
(
remove_list
):
for
m
in
remove_list
:
logging
.
info
(
"... clean: "
+
m
.
url
+
" [from: "
+
m
.
path
+
"]"
)
m
.
remove_dir_from_disk
()
else
:
logging
.
info
(
"There are no modules to be removed"
)
logging
.
info
(
"Modules cleaned."
)
hdlmake/action/fetch.py
View file @
5f330e08
...
...
@@ -24,6 +24,7 @@ import sys
import
os
from
.action
import
Action
import
hdlmake.fetch
as
fetch
class
FetchModules
(
Action
):
...
...
@@ -35,3 +36,17 @@ class FetchModules(Action):
self
.
fetch_all
()
os
.
system
(
top_module
.
manifest_dict
[
"fetch_post_cmd"
])
logging
.
info
(
"All modules fetched."
)
def
clean
(
self
):
logging
.
info
(
"Removing fetched modules.."
)
remove_list
=
[
m
for
m
in
self
if
m
.
source
in
[
fetch
.
GIT
,
fetch
.
SVN
]
and
m
.
isfetched
]
remove_list
.
reverse
()
# we will remove modules in backward order
if
len
(
remove_list
):
for
m
in
remove_list
:
logging
.
info
(
"... clean: "
+
m
.
url
+
" [from: "
+
m
.
path
+
"]"
)
m
.
remove_dir_from_disk
()
else
:
logging
.
info
(
"There are no modules to be removed"
)
logging
.
info
(
"Modules cleaned."
)
hdlmake/module_pool.py
View file @
5f330e08
...
...
@@ -34,13 +34,13 @@ from . import new_dep_solver as dep_solver
from
.util
import
path
as
path_mod
from
.
import
fetch
from
.env
import
Env
from
.action
import
(
CheckManifest
,
CheckCondition
,
CleanModules
,
FetchModules
,
ListFiles
,
from
.action
import
(
CheckManifest
,
CheckCondition
,
FetchModules
,
ListFiles
,
ListModules
,
MergeCores
,
Tree
,
GenerateSimulationMakefile
,
GenerateSynthesisMakefile
,
GenerateRemoteSynthesisMakefile
,
GenerateSynthesisProject
,
QsysHwTclUpdate
)
class
ModulePool
(
list
,
CheckManifest
,
CheckCondition
,
CleanModules
,
FetchModules
,
ListFiles
,
class
ModulePool
(
list
,
CheckManifest
,
CheckCondition
,
FetchModules
,
ListFiles
,
ListModules
,
MergeCores
,
Tree
,
GenerateSimulationMakefile
,
GenerateSynthesisMakefile
,
GenerateRemoteSynthesisMakefile
,
GenerateSynthesisProject
,
QsysHwTclUpdate
):
...
...
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