/usr/lib/python2.7/dist-packages/ocfs2interface/toolbar.py is in ocfs2console 1.6.4-3.1.
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | # OCFS2Console - GUI frontend for OCFS2 management and debugging
# Copyright (C) 2005 Oracle. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.
import gtk
from guiutil import make_callback
toolbar_data = (
('Mount', gtk.STOCK_EXECUTE, 'mount', 'refresh'),
('Unmount', gtk.STOCK_STOP, 'unmount', 'refresh'),
('Refresh', gtk.STOCK_REFRESH, 'refresh', None)
)
class Toolbar:
def __init__(self, window):
self.window = window
def get_widgets(self):
toolbar = gtk.Toolbar()
items = {}
for data in toolbar_data:
label, stock_id, callback, sub_callback = data
cb = make_callback(self.window, callback, sub_callback)
icon = gtk.Image()
icon.set_from_stock(stock_id, gtk.ICON_SIZE_BUTTON)
items[callback] = toolbar.append_item(label, label, None, icon, cb)
toolbar.append_space()
filter_box, entry = self.get_filter_box()
toolbar.append_widget(filter_box, 'Partition name filter', None)
return toolbar, items, entry
def get_filter_box(self):
hbox = gtk.HBox(False, 4)
label = gtk.Label('Filter:')
hbox.pack_start(label, expand=False, fill=False)
entry = gtk.Entry()
hbox.pack_end(entry)
return hbox, entry
def main():
def dummy(*args):
gtk.main_quit()
window = gtk.Window()
window.connect('delete_event', dummy)
for i in toolbar_data:
setattr(window, i[2], dummy)
toolbar = Toolbar(window)
vbox = gtk.VBox()
window.add(vbox)
vbox.add(toolbar.get_widgets()[0])
window.show_all()
gtk.main()
if __name__ == '__main__':
main()
|