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
dc369375
Commit
dc369375
authored
Jul 31, 2013
by
Paweł Szostek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
action.py: remove code redundancy in variable checking
parent
8e433b0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
action.py
src/action/action.py
+18
-0
No files found.
src/action/action.py
View file @
dc369375
...
...
@@ -39,3 +39,21 @@ class Action(object):
"Fetching must be done prior to makefile generation"
)
print
(
str
([
str
(
m
)
for
m
in
self
.
modules_pool
if
not
m
.
isfetched
]))
sys
.
exit
(
"Exiting."
)
def
_check_manifest_variable_is_set
(
self
,
name
):
if
getattr
(
self
.
top_module
,
name
)
is
None
:
logging
.
error
(
"Variable
%
s must be set in the manifest to perform current action"
,
name
)
sys
.
exit
(
"Exiting"
)
def
_check_manifest_variable_is_equal_to
(
self
,
name
,
value
):
ok
=
False
try
:
manifest_value
=
getattr
(
self
.
top_module
,
name
)
if
manifest_value
==
value
:
ok
=
True
except
:
pass
if
ok
is
False
:
logging
.
error
(
"Variable
%
s must be set in the manifest and equal to
%
s"
)
sys
.
exit
(
"Exiting"
)
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