Skip to content

Commit

Permalink
Fix flake8 warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyklyukin committed Feb 10, 2016
1 parent fe06a07 commit 918522d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pg_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ def _produce_diff_row(self, prev, cur):
else:
# default case - calculate the diff between the current attribute's values of
# old and new rows and divide it by the time interval passed between measurements.
result[attname] = ((cur[incol] - prev[incol]) / self.diff_time if cur.get(incol, None) is not None
and prev.get(incol, None) is not None and self.diff_time >= 0 else None)
result[attname] = ((cur[incol] - prev[incol]) / self.diff_time if cur.get(incol, None) is not None and
prev.get(incol, None) is not None and self.diff_time >= 0 else None)
return result

def _produce_output_row(self, row):
Expand Down Expand Up @@ -2033,8 +2033,8 @@ def _read_memory_data(self):
return result

def calculate_kb_left_until_limit(self, colname, row, optional):
result = (int(row['CommitLimit']) - int(row['Committed_AS']) if row.get('CommitLimit', None) is not None
and row.get('Committed_AS', None) is not None else None)
result = (int(row['CommitLimit']) - int(row['Committed_AS']) if row.get('CommitLimit', None) is not None and
row.get('Committed_AS', None) is not None else None)
if result is None and not optional:
self.warn_non_optional_column(colname)
return result
Expand Down Expand Up @@ -2587,8 +2587,8 @@ def display_header(self, layout, align, types):
for field in layout:
text = self._align_field(field, '', layout[field]['width'], align.get(field, COLALIGN.ca_none),
types.get(field, COLTYPES.ct_string))
self.screen.addnstr(self.next_y, layout[field]['start'], text, layout[field]['width'], self.COLOR_NORMAL
| curses.A_BOLD)
self.screen.addnstr(self.next_y, layout[field]['start'], text, layout[field]['width'], self.COLOR_NORMAL |
curses.A_BOLD)

def calculate_fields_position(self, collector, xstart):
width = self.data[collector]['w']
Expand Down Expand Up @@ -2885,8 +2885,8 @@ def get_postmasters_directories():
logger.error('failed to read {0}'.format(f))
continue
# read PostgreSQL processes. Avoid zombies
if len(stat_fields) < STAT_FIELD.st_start_time + 1 or stat_fields[STAT_FIELD.st_process_name] not in ('(postgres)', '(postmaster)') \
or stat_fields[STAT_FIELD.st_state] == 'Z':
if len(stat_fields) < STAT_FIELD.st_start_time + 1 or stat_fields[STAT_FIELD.st_process_name] not in \
('(postgres)', '(postmaster)') or stat_fields[STAT_FIELD.st_state] == 'Z':
if stat_fields[STAT_FIELD.st_state] == 'Z':
logger.warning('zombie process {0}'.format(f))
if len(stat_fields) < STAT_FIELD.st_start_time + 1:
Expand Down

0 comments on commit 918522d

Please sign in to comment.