/usr/lib/pytone/helpwin.py is in pytone 3.0.0-1+b4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | # -*- coding: ISO-8859-1 -*-
# Copyright (C) 2002, 2003, 2004 Jörg Lehmann <joerg@luga.de>
#
# This file is part of PyTone (http://www.luga.de/pytone/)
#
# PyTone is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation.
#
# PyTone is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PyTone; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import config
import help
import events, hub
import messagewin
import statusbar
import encoding
def getitems(section):
items = []
if section:
for function in config.keybindings[section].asdict().keys():
keys = list(config.keybindings[section][function])
keys.sort()
keynames = [help.getkeyname(key) for key in keys]
descr = help.descriptions[section][function][1]
items += [(keynames, descr)]
return items
class helpwin(messagewin.messagewin):
def __init__(self, screen, maxh, maxw, channel):
messagewin.messagewin.__init__(self, screen, maxh, maxw, channel,
config.colors.helpwindow,
_("PyTone Help"), [],
config.helpwindow.autoclosetime)
sbar = statusbar.generatedescription("general", "showhelp")
hub.notify(events.statusbar_update(2, sbar))
def showitems(self):
y = self.iy
for item in self.items[self.first:]:
self.addstr(y, 1, " "*self.iw, self.colors.background)
self.move(y, 1)
for keyname in item[0][:-1]:
self.addstr(encoding.encode(keyname), self.colors.key)
self.addstr("/", self.colors.description)
self.addstr(encoding.encode(item[0][-1]), self.colors.key)
self.addnstr(y, 35, encoding.encode(item[1]), self.iw-35)
y += 1
if y>=self.iy+self.ih:
break
def showhelp(self, context):
self.items = getitems("general")+getitems(context)
self.items.sort()
self.show()
|