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
2
Merge Requests
2
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
f52a297b
Commit
f52a297b
authored
Oct 28, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sourcefileset: add more typechecking.
parent
314e9a61
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
sourcefileset.py
hdlmake/sourcefiles/sourcefileset.py
+9
-8
No files found.
hdlmake/sourcefiles/sourcefileset.py
View file @
f52a297b
...
...
@@ -18,6 +18,7 @@
# along with Hdlmake. If not, see <http://www.gnu.org/licenses/>.
#
from
.dep_file
import
File
import
logging
class
SourceFileSet
(
set
):
...
...
@@ -35,16 +36,16 @@ class SourceFileSet(set):
def
add
(
self
,
files
):
"""Add a set of files to the source fileset instance"""
if
isinstance
(
files
,
str
):
raise
RuntimeError
(
"Expected object, not a string"
)
elif
files
is
None
:
if
files
is
None
:
logging
.
debug
(
"Got None as a file.
\n
Ommiting"
)
else
:
try
:
return
if
isinstance
(
files
,
(
SourceFileSet
,
set
))
:
for
file_aux
in
files
:
super
(
SourceFileSet
,
self
)
.
add
(
file_aux
)
except
TypeError
:
# single file, not a list
elif
isinstance
(
files
,
File
):
super
(
SourceFileSet
,
self
)
.
add
(
files
)
else
:
raise
TypeError
def
filter
(
self
,
filetype
):
"""Method that filters and returns all of the HDL source files
...
...
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