2012-04-13 15:04:45 +00:00
|
|
|
## mappingsPage.py - show selinux mappings
|
|
|
|
## Copyright (C) 2006 Red Hat, Inc.
|
|
|
|
|
|
|
|
## 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
## Author: Dan Walsh
|
|
|
|
import string
|
|
|
|
import gtk
|
|
|
|
import gtk.glade
|
|
|
|
import os
|
|
|
|
import gobject
|
|
|
|
import sys
|
|
|
|
import seobject
|
|
|
|
|
|
|
|
##
|
|
|
|
## I18N
|
|
|
|
##
|
2015-07-24 08:07:13 +00:00
|
|
|
PROGNAME = "policycoreutils"
|
2012-04-13 15:04:45 +00:00
|
|
|
try:
|
2016-08-04 18:34:02 +00:00
|
|
|
import gettext
|
|
|
|
kwargs = {}
|
|
|
|
if sys.version_info < (3,):
|
|
|
|
kwargs['unicode'] = True
|
2012-04-13 15:04:45 +00:00
|
|
|
gettext.install(PROGNAME,
|
|
|
|
localedir="/usr/share/locale",
|
2016-08-04 18:34:02 +00:00
|
|
|
codeset='utf-8',
|
|
|
|
**kwargs)
|
|
|
|
except:
|
|
|
|
try:
|
|
|
|
import builtins
|
|
|
|
builtins.__dict__['_'] = str
|
|
|
|
except ImportError:
|
|
|
|
import __builtin__
|
|
|
|
__builtin__.__dict__['_'] = unicode
|
2012-04-13 15:04:45 +00:00
|
|
|
|
2015-07-24 08:07:13 +00:00
|
|
|
|
2012-04-13 15:04:45 +00:00
|
|
|
class loginsPage:
|
2015-07-24 08:07:13 +00:00
|
|
|
|
2012-04-13 15:04:45 +00:00
|
|
|
def __init__(self, xml):
|
|
|
|
self.xml = xml
|
|
|
|
self.view = xml.get_widget("mappingsView")
|
|
|
|
self.store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING)
|
|
|
|
self.store.set_sort_column_id(0, gtk.SORT_ASCENDING)
|
|
|
|
self.view.set_model(self.store)
|
|
|
|
self.login = loginRecords()
|
|
|
|
dict = self.login.get_all(0)
|
2016-08-04 18:34:03 +00:00
|
|
|
for k in sorted(dict.keys()):
|
|
|
|
print("%-25s %-25s %-25s" % (k, dict[k][0], translate(dict[k][1])))
|