Skip to content

Commit

Permalink
Black found more files - strange.
Browse files Browse the repository at this point in the history
Executed black to make code unreadable.

(cherry picked from commit 1b34c2368428b1ec295073ee47d201ac1def35f6)
  • Loading branch information
Paebbels authored and umarcor committed Jun 17, 2021
1 parent e5891f3 commit 0c726ac
Show file tree
Hide file tree
Showing 31 changed files with 530 additions and 296 deletions.
9 changes: 5 additions & 4 deletions pyGHDL/dom/Common.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"""
from pydecor import export

from pyGHDL import GHDLBaseException
from pyGHDL.libghdl import LibGHDLException, errorout_memory
from pyGHDL import GHDLBaseException
from pyGHDL.libghdl import LibGHDLException, errorout_memory

__all__ = []

Expand All @@ -61,5 +61,6 @@ def CheckForErrors(self) -> None:
for i in range(errorCount):
print(errorout_memory.Get_Error_Message(i + 1))

raise DOMException("Error in libghdl.") \
from LibGHDLException("libghdl: Internal error 2.")
raise DOMException("Error in libghdl.") from LibGHDLException(
"libghdl: Internal error 2."
)
44 changes: 27 additions & 17 deletions pyGHDL/dom/DesignUnit.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,24 @@
"""
from pydecor import export

from pyVHDLModel.VHDLModel import Entity as VHDLModel_Entity
from pyVHDLModel.VHDLModel import Architecture as VHDLModel_Architecture
from pyVHDLModel.VHDLModel import Package as VHDLModel_Package
from pyVHDLModel.VHDLModel import PackageBody as VHDLModel_PackageBody
from pyVHDLModel.VHDLModel import Context as VHDLModel_Context
from pyVHDLModel.VHDLModel import Entity as VHDLModel_Entity
from pyVHDLModel.VHDLModel import Architecture as VHDLModel_Architecture
from pyVHDLModel.VHDLModel import Package as VHDLModel_Package
from pyVHDLModel.VHDLModel import PackageBody as VHDLModel_PackageBody
from pyVHDLModel.VHDLModel import Context as VHDLModel_Context
from pyVHDLModel.VHDLModel import Configuration as VHDLModel_Configuration

from pyGHDL.libghdl import utils
from pyGHDL.libghdl.vhdl import nodes

from pyGHDL.dom._Utils import NodeToName, GetIirKindOfNode
from pyGHDL.dom._Translate import GetExpressionFromNode, GetSubtypeIndicationFromNode, GetGenericsFromChainedNodes, GetPortsFromChainedNodes, \
GetDeclaredItemsFromChainedNodes
from pyGHDL.dom._Translate import (
GetExpressionFromNode,
GetSubtypeIndicationFromNode,
GetGenericsFromChainedNodes,
GetPortsFromChainedNodes,
GetDeclaredItemsFromChainedNodes,
)
from pyGHDL.dom.Common import GHDLMixin, DOMException
from pyGHDL.dom.Object import Constant, Signal

Expand All @@ -62,19 +67,22 @@

@export
class Entity(VHDLModel_Entity, GHDLMixin):

@classmethod
def parse(cls, libraryUnit):
name = NodeToName(libraryUnit)
entity = cls(name)

for generic in GetGenericsFromChainedNodes(nodes.Get_Generic_Chain(libraryUnit)):
for generic in GetGenericsFromChainedNodes(
nodes.Get_Generic_Chain(libraryUnit)
):
entity.GenericItems.append(generic)

for port in GetPortsFromChainedNodes(nodes.Get_Port_Chain(libraryUnit)):
entity.PortItems.append(port)

for item in GetDeclaredItemsFromChainedNodes(nodes.Get_Declaration_Chain(libraryUnit), "entity", name):
for item in GetDeclaredItemsFromChainedNodes(
nodes.Get_Declaration_Chain(libraryUnit), "entity", name
):
entity.DeclaredItems.append(item)

return entity
Expand All @@ -94,7 +102,9 @@ def parse(cls, libraryUnit):

architecture = cls(name, entityName)

for item in GetDeclaredItemsFromChainedNodes(nodes.Get_Declaration_Chain(libraryUnit), "architecture", name):
for item in GetDeclaredItemsFromChainedNodes(
nodes.Get_Declaration_Chain(libraryUnit), "architecture", name
):
architecture.DeclaredItems.append(item)

return architecture
Expand All @@ -105,37 +115,38 @@ def resolve(self):

@export
class Package(VHDLModel_Package, GHDLMixin):

@classmethod
def parse(cls, libraryUnit):
name = NodeToName(libraryUnit)

package = cls(name)

for item in GetDeclaredItemsFromChainedNodes(nodes.Get_Declaration_Chain(libraryUnit), "package", name):
for item in GetDeclaredItemsFromChainedNodes(
nodes.Get_Declaration_Chain(libraryUnit), "package", name
):
package.DeclaredItems.append(item)

return package


@export
class PackageBody(VHDLModel_PackageBody, GHDLMixin):

@classmethod
def parse(cls, libraryUnit):
name = NodeToName(libraryUnit)

packageBody = cls(name)

for item in GetDeclaredItemsFromChainedNodes(nodes.Get_Declaration_Chain(libraryUnit), "package body", name):
for item in GetDeclaredItemsFromChainedNodes(
nodes.Get_Declaration_Chain(libraryUnit), "package body", name
):
packageBody.DeclaredItems.append(item)

return packageBody


@export
class Context(VHDLModel_Context, GHDLMixin):

@classmethod
def parse(cls, libraryUnit):
name = NodeToName(libraryUnit)
Expand All @@ -144,7 +155,6 @@ def parse(cls, libraryUnit):

@export
class Configuration(VHDLModel_Configuration, GHDLMixin):

@classmethod
def parse(cls, libraryUnit):
name = NodeToName(libraryUnit)
Expand Down

0 comments on commit 0c726ac

Please sign in to comment.