Skip to content

Commit

Permalink
Fixed problems reported by PyCharm and Codacy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Jun 26, 2021
1 parent 234d3c4 commit 09497f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
21 changes: 7 additions & 14 deletions pyVHDLModel/VHDLModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ class Direction(Enum):
DownTo = 1

def __str__(self):
return ("to", "downto")[self.value] # TODO: check performance
index: int = self.value
return ("to", "downto")[index] # TODO: check performance


@export
Expand All @@ -121,7 +122,8 @@ class Mode(Enum):
Linkage = 5

def __str__(self):
return ("", "in", "out", "inout", "buffer", "linkage")[self.value] # TODO: check performance
index: int = self.value
return ("", "in", "out", "inout", "buffer", "linkage")[index] # TODO: check performance


@export
Expand Down Expand Up @@ -445,10 +447,10 @@ def __init__(self, subTypeName: Name):
class ConstrainedScalarSubTypeSymbol(SubTypeSymbol):
_range: 'Range'

def __init__(self, subTypeName: Name, r: 'Range' = None):
def __init__(self, subTypeName: Name, rng: 'Range' = None):
super().__init__(subTypeName)
self._subType = None
self._range = r
self._range = rng

@property
def Range(self) -> 'Range':
Expand Down Expand Up @@ -734,6 +736,7 @@ def __init__(self, name: str):
@export
class BaseType(ModelEntity, NamedEntity):
"""``BaseType`` is the base class of all type entities in this model."""

def __init__(self, name: str):
"""
Initializes underlying ``BaseType``.
Expand Down Expand Up @@ -1618,16 +1621,6 @@ class BaseConstraint(ModelEntity):
pass


# FIXME: exists 2 times
@export
class RangeExpression(BaseConstraint):
_range: Range

@property
def Range(self):
return self._range


# FIXME: Is this used?
@export
class RangeAttribute(BaseConstraint):
Expand Down
4 changes: 3 additions & 1 deletion pyVHDLModel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
# ==============================================================================
#
"""
An abstract VHDL language model.
:copyright: Copyright 2007-2021 Patrick Lehmann - Bötzingen, Germany
:license: Apache License, Version 2.0
"""
__version__ = "0.8.1"
__version__ = "0.10.5"

0 comments on commit 09497f9

Please sign in to comment.