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
20265f42
Commit
20265f42
authored
Aug 07, 2016
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The Manifest class is not longer required
parent
26c1bc45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
30 deletions
+8
-30
manifest_parser.py
hdlmake/manifest_parser.py
+8
-30
No files found.
hdlmake/manifest_parser.py
View file @
20265f42
...
...
@@ -29,32 +29,6 @@ from .util import path as path_mod
from
.util.configparser
import
ConfigParser
class
Manifest
(
object
):
"""This class defines the Manifest object"""
def
__init__
(
self
,
path
=
None
,
url
=
None
):
if
not
isinstance
(
path
,
str
):
raise
ValueError
(
"Path must be an instance of str"
)
if
path
is
None
and
url
is
None
:
raise
ValueError
(
"When creating a manifest a path or an URL must be given"
)
if
path
is
not
None
and
url
is
None
:
self
.
url
=
path
if
path_mod
.
is_abs_path
(
path
):
self
.
path
=
path
else
:
raise
ValueError
(
"When creating a Manifest, path must be absolute path"
)
def
__str__
(
self
):
return
self
.
url
def
exists
(
self
):
"""Check if the Manifest path points to an existing directory"""
return
os
.
path
.
exists
(
self
.
path
)
class
ManifestParser
(
ConfigParser
):
"""This is the class providing HDLMake Manifest parser capabilities"""
...
...
@@ -307,16 +281,20 @@ class ManifestParser(ConfigParser):
logging
.
debug
(
"Found manifest for module
%
s:
%
s"
,
path
,
filename
)
path_aux
=
os
.
path
.
join
(
path
,
filename
)
manifest
=
Manifest
(
path
=
os
.
path
.
abspath
(
path_aux
))
return
manifest
if
not
isinstance
(
path_aux
,
str
):
raise
ValueError
(
"Path must be an instance of str"
)
if
not
path_mod
.
is_abs_path
(
path_aux
):
raise
ValueError
(
"Manifest path must be absolute path"
)
return
path_aux
return
None
manifest
=
_search_for_manifest
(
path
)
if
manifest
is
None
:
logging
.
error
(
"No manifest found in path:
%
s"
,
path
)
quit
()
else
:
logging
.
debug
(
"Parse manifest in:
%
s"
,
manifest
.
path
)
return
self
.
add_config_file
(
manifest
.
path
)
logging
.
debug
(
"Parse manifest in:
%
s"
,
manifest
)
return
self
.
add_config_file
(
manifest
)
def
print_help
(
self
):
"""Print the help for the Manifest parser object"""
...
...
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