[go: up one dir, main page]

Skip to content

Commit

Permalink
Pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanstraten committed Oct 7, 2019
1 parent 0ef939d commit 537dcc4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
12 changes: 6 additions & 6 deletions tests/vhdl/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def gen_basic_interface(group, flatten):
def test_ungrouped_unflattened(self):
"""test ungrouped, unflattened interface generation"""
result = self.gen_basic_interface(False, False)
iface, foo_d, foo_v, foo_r, foo_e, bar_d, bar_v, bar_r, bar_e = result
iface, foo_d, foo_v, foo_r, foo_e, bar_d, bar_v, bar_r, bar_e = result #pylint: disable=W0632
self.assertEqual('\n\n'.join(iface.generate('port')), '\n'.join([
'@ Interface for field foo: a scalar field.',
'f_foo_i : in tns_f_foo_i_type@:= TNS_F_FOO_I_RESET;',
Expand Down Expand Up @@ -128,7 +128,7 @@ def test_ungrouped_unflattened(self):
def test_grouped_unflattened(self):
"""test grouped, unflattened interface generation"""
result = self.gen_basic_interface('test', False)
iface, foo_d, foo_v, foo_r, foo_e, bar_d, bar_v, bar_r, bar_e = result
iface, foo_d, foo_v, foo_r, foo_e, bar_d, bar_v, bar_r, bar_e = result #pylint: disable=W0632
self.assertEqual('\n\n'.join(iface.generate('port')), '\n'.join([
'@ Interface group for:',
'@ - field bar: a vector field.',
Expand Down Expand Up @@ -224,7 +224,7 @@ def test_grouped_unflattened(self):
def test_ungrouped_flattened_records(self):
"""test ungrouped, record-flattened interface generation"""
result = self.gen_basic_interface(False, 'record')
iface, foo_d, foo_v, foo_r, foo_e, bar_d, bar_v, bar_r, bar_e = result
iface, foo_d, foo_v, foo_r, foo_e, bar_d, bar_v, bar_r, bar_e = result #pylint: disable=W0632
self.assertEqual('\n\n'.join(iface.generate('port')), '\n'.join([
'@ Interface for field foo: a scalar field.',
'f_foo_data : in std_logic_vector(7 downto 0)@:= (others => \'0\');',
Expand Down Expand Up @@ -260,7 +260,7 @@ def test_ungrouped_flattened_records(self):
def test_grouped_flattened_records(self):
"""test grouped, record-flattened interface generation"""
result = self.gen_basic_interface('test', 'record')
iface, foo_d, foo_v, foo_r, foo_e, bar_d, bar_v, bar_r, bar_e = result
iface, foo_d, foo_v, foo_r, foo_e, bar_d, bar_v, bar_r, bar_e = result #pylint: disable=W0632
self.assertEqual('\n\n'.join(iface.generate('port')), '\n'.join([
'@ Interface group for:',
'@ - field bar: a vector field.',
Expand Down Expand Up @@ -319,7 +319,7 @@ def test_grouped_flattened_records(self):
def test_ungrouped_flattened(self):
"""test ungrouped, array-flattened interface generation"""
result = self.gen_basic_interface(False, True)
iface, foo_d, foo_v, foo_r, foo_e, bar_d, bar_v, bar_r, bar_e = result
iface, foo_d, foo_v, foo_r, foo_e, bar_d, bar_v, bar_r, bar_e = result #pylint: disable=W0632
self.assertEqual('\n\n'.join(iface.generate('port')), '\n'.join([
'@ Interface for field foo: a scalar field.',
'f_foo_data : in std_logic_vector(7 downto 0)@:= (others => \'0\');',
Expand Down Expand Up @@ -353,7 +353,7 @@ def test_ungrouped_flattened(self):
def test_grouped_flattened(self):
"""test grouped, array-flattened interface generation"""
result = self.gen_basic_interface('test', True)
iface, foo_d, foo_v, foo_r, foo_e, bar_d, bar_v, bar_r, bar_e = result
iface, foo_d, foo_v, foo_r, foo_e, bar_d, bar_v, bar_r, bar_e = result #pylint: disable=W0632
self.assertEqual('\n\n'.join(iface.generate('port')), '\n'.join([
'@ Interface group for:',
'@ - field bar: a vector field.',
Expand Down
2 changes: 1 addition & 1 deletion vhdmmio/configurable/choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def with_mods(self, *choices_to_keep):
becomes the new default value. Choices can be specified either as just
a descriptor or as a two-tuple of a descriptor and a new documentation
string."""
current_choices = {desc: doc for desc, doc in self._choices}
current_choices = dict(self._choices)
new_choices = []
for choice_tuple in choices_to_keep:
desc, doc = choice_tuple if isinstance(choice_tuple, tuple) else (choice_tuple, None)
Expand Down
2 changes: 0 additions & 2 deletions vhdmmio/html/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ def insert_cell(content=None, col_span=1, row_span=1):

if len(abbreviated) > mapping.col_span*4-1:
abbreviated = abbreviated[:mapping.col_span*4-2] + '…'
else:
abbreviated = abbreviated

cell = (
'<div class="tooltip-right">\n'
Expand Down
18 changes: 8 additions & 10 deletions vhdmmio/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,16 +622,14 @@ def _process_wrapping(self, text, comment, wrap, annotate): #pylint disable=R091
paragraph_buffer.extend(line.split())
continue

else:

# Not a continuation of the buffered paragraph. Output the
# current buffer so we can start a new one.
output_lines.extend(self._wrap(
paragraph_buffer_leading,
paragraph_buffer_hanging,
paragraph_buffer,
wrap))
paragraph_buffer = None
# Not a continuation of the buffered paragraph. Output the
# current buffer so we can start a new one.
output_lines.extend(self._wrap(
paragraph_buffer_leading,
paragraph_buffer_hanging,
paragraph_buffer,
wrap))
paragraph_buffer = None

if line:

Expand Down

0 comments on commit 537dcc4

Please sign in to comment.