Skip to content

Commit

Permalink
More obsolete code removal: now we compute the prefix line per group.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyklyukin committed Jul 17, 2013
1 parent ad7d541 commit c28f5fc
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions pg_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,21 +399,6 @@ def refresh(self):
def ident(self):
return str(self.__class__).lower().split('.')[1].split('statcollector')[0]

def visual_ident(self):
ident_string = self.ident()
ident_list = ident_string.split()

if len(ident_list) == 2:
block_title = ident_list[0]
version_title = ident_list[1]
else:
block_title = ident_list[0]
version_title = '()'

ln = version_title
ln_len = len(ln)
return '{0}----{1}----\n'.format(ln, block_title)

def ncurses_set_prefix(self, new_prefix):
self.ncurses_custom_fields['prefix'] = new_prefix

Expand Down Expand Up @@ -1239,12 +1224,6 @@ def _read_pg_stat_activity(self):
cur.close()
return ret

def visual_ident(self):
common_ident = super(self.__class__, self).visual_ident().rstrip('\n')
connections_unit = (' connections' if self.show_units else '')
return '{0} ({1}/{2}){3}\n'.format(common_ident, self.active_connections, self.total_connections,
connections_unit)

def ncurses_produce_prefix(self):
return "{1} {0} database connections: {2} total, {3} active\n".format(
self.dbver, self.dbname, self.total_connections, self.active_connections)
Expand Down Expand Up @@ -1587,7 +1566,7 @@ def __init__(self, dbname, dbversion, work_directory):
{'out': 'path', 'pos': 10},
]
self.ncurses_custom_fields = {'header': True}
self.ncurses_custom_fields['prefix'] = self.visual_ident()
self.ncurses_custom_fields['prefix'] = None

self.postinit()

Expand Down

0 comments on commit c28f5fc

Please sign in to comment.