Skip to content

Commit

Permalink
Fix black lint errors.
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Trippel <ttrippel@google.com>
  • Loading branch information
timothytrippel authored and GregAC committed Aug 24, 2023
1 parent 140d3bf commit 35a75ed
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
6 changes: 3 additions & 3 deletions fusesoc/capi2/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __new__(self, thing):


class StringWithUseFlags(str):
""" A parsed string with support for use flags. """
"""A parsed string with support for use flags."""

def __init__(self, string):
self.exprs = None
Expand All @@ -65,7 +65,7 @@ def parse(self, flags):


class String(str):
""" A plain (unparsed) string. """
"""A plain (unparsed) string."""

def parse(self, flags):
raise RuntimeError(
Expand Down Expand Up @@ -379,7 +379,7 @@ def get_generators(self):
return generators

def get_virtuals(self):
""" Get a list of "virtual" VLNVs provided by this core. """
"""Get a list of "virtual" VLNVs provided by this core."""
return self.virtual

def get_parameters(self, flags={}, ext_parameters={}):
Expand Down
10 changes: 5 additions & 5 deletions fusesoc/coremanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def _load_cores(self, library):
self.db.add(core, library)

def add_library(self, library):
""" Register a library """
"""Register a library"""
abspath = os.path.abspath(os.path.expanduser(library.location))
_library = self._lm.get_library(abspath, "location")
if _library:
Expand All @@ -300,7 +300,7 @@ def add_library(self, library):
self._lm.add_library(library)

def get_libraries(self):
""" Get all registered libraries """
"""Get all registered libraries"""
return self._lm.get_libraries()

def get_depends(self, core, flags):
Expand All @@ -325,17 +325,17 @@ def get_depends(self, core, flags):
return deps

def get_cores(self):
""" Get a dict with all cores, indexed by the core name """
"""Get a dict with all cores, indexed by the core name"""
return {str(x.name): x for x in self.db.find()}

def get_core(self, name):
""" Get a core with a given name """
"""Get a core with a given name"""
c = self.db.find(name)
c.name.relation = "=="
return c

def get_generators(self):
""" Get a dict with all registered generators, indexed by name """
"""Get a dict with all registered generators, indexed by name"""
generators = {}
for core in self.db.find():
if hasattr(core, "get_generators"):
Expand Down
14 changes: 7 additions & 7 deletions fusesoc/edalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def cores(self):

@property
def resolved_cores(self):
""" Get a list of all "used" cores after the dependency resolution """
"""Get a list of all "used" cores after the dependency resolution"""
try:
return self.core_manager.get_depends(self.toplevel, self.flags)
except DependencyError as e:
Expand All @@ -70,11 +70,11 @@ def resolved_cores(self):

@property
def discovered_cores(self):
""" Get a list of all cores found by fusesoc """
"""Get a list of all cores found by fusesoc"""
return self.core_manager.db.find()

def run(self):
""" Run all steps to create a EDAM file """
"""Run all steps to create a EDAM file"""

# Run the setup task on all cores (fetch and patch them as needed)
self.setup_cores()
Expand All @@ -95,20 +95,20 @@ def run(self):
return self.edam

def _core_flags(self, core):
""" Get flags for a specific core """
"""Get flags for a specific core"""

core_flags = self.flags.copy()
core_flags["is_toplevel"] = core.name == self.toplevel
return core_flags

def setup_cores(self):
""" Setup cores: fetch resources, patch them, etc. """
"""Setup cores: fetch resources, patch them, etc."""
for core in self.cores:
logger.info("Preparing " + str(core.name))
core.setup()

def extract_generators(self):
""" Get all registered generators from the cores """
"""Get all registered generators from the cores"""
generators = {}
for core in self.cores:
logger.debug("Searching for generators in " + str(core.name))
Expand All @@ -121,7 +121,7 @@ def extract_generators(self):
self.generators = generators

def run_generators(self):
""" Run all generators """
"""Run all generators"""
self._resolved_or_generated_cores = []
for core in self.cores:
logger.debug("Running generators in " + str(core.name))
Expand Down
2 changes: 0 additions & 2 deletions tests/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


def test_coregen_provider():

cache_root = tempfile.mkdtemp("coregen_")
core = Core(os.path.join(cores_root, "misc", "coregencore.core"), cache_root)

Expand Down Expand Up @@ -72,7 +71,6 @@ def test_github_provider():


def test_logicore_provider():

cache_root = tempfile.mkdtemp("logicore_")
core = Core(os.path.join(cores_root, "misc", "logicorecore.core"), cache_root)

Expand Down

0 comments on commit 35a75ed

Please sign in to comment.