Ejemplo n.º 1
0
    def __init__(self):
        Clip.__init__(self)

        cpumodel = _('Unknown')

        if os.uname()[4][0:3] == "ppc":
            for element in file("/proc/cpuinfo"):
                if element.split(":")[0][0:3] == "cpu":
                    cpumodel = element.split(":")[1].strip()
        else:
            for element in file("/proc/cpuinfo"):
                if element.split(":")[0] == "model name\t":
                    cpumodel = element.split(":")[1].strip()

        for element in file("/proc/meminfo"):
            if element.split(" ")[0] == "MemTotal:":
                raminfo = element.split(" ")[-2]

        self.table = EasyTable(items=(
            (Gtk.Label(label=_('CPU:')), Gtk.Label(label=cpumodel)),
            (Gtk.Label(label=_('Memory:')),
             Gtk.Label(label=GLib.format_size_for_display(int(raminfo) *
                                                          1024))),
        ),
                               xpadding=12,
                               ypadding=2)
        self.add_content(self.table)

        self.show_all()
Ejemplo n.º 2
0
    def __init__(self):
        Clip.__init__(self)

        cpumodel = _('Unknown')

        if os.uname()[4][0:3] == "ppc":
            for element in file("/proc/cpuinfo"):
                if element.split(":")[0][0:3] == "cpu":
                    cpumodel = element.split(":")[1].strip()
        else:
            for element in file("/proc/cpuinfo"):
                if element.split(":")[0] == "model name\t":
                    cpumodel = element.split(":")[1].strip()

        for element in file("/proc/meminfo"):
            if element.split(" ")[0] == "MemTotal:":
                raminfo = element.split(" ")[-2]

        self.table = EasyTable(items=(
                        (Gtk.Label(label=_('CPU:')),
                         Gtk.Label(label=cpumodel)),
                        (Gtk.Label(label=_('Memory:')),
                         Gtk.Label(label=GLib.format_size_for_display(int(raminfo) * 1024))),
                        ),
                        xpadding=12, ypadding=2)
        self.add_content(self.table)

        self.show_all()
Ejemplo n.º 3
0
    def __init__(self):
        Clip.__init__(self)

        cache_number = len(glob.glob('/var/cache/apt/archives/*.deb'))

        if cache_number:
            self.set_title(_('Some cache can be cleaned to free your disk space'))

        label = Gtk.Label(label=_('%s cache packages can be cleaned.') % cache_number)
        label.set_alignment(0, 0.5)

        self.add_content(label)

        try:
            size = int(os.popen('du -bs ~/.thumbnails').read().split()[0])
        except:
            size = 0

        if size:

            label = Gtk.Label(label=_('%s thumbnails cache can be cleaned.') % \
                    GLib.format_size_for_display(size))
            label.set_alignment(0, 0.5)

            self.add_content(label)

        button = Gtk.Button(label=_('Start Janitor'))
        button.connect('clicked', self.on_button_clicked)
        self.add_action_button(button)

        self.show_all()
Ejemplo n.º 4
0
    def __init__(self):
        Clip.__init__(self)

        label = Gtk.Label(label=self._get_last_apt_get_update_text())
        label.set_alignment(0, 0.5)

        self.add_content(label)

        self.show_all()
Ejemplo n.º 5
0
    def __init__(self):
        Clip.__init__(self)

        self.table = EasyTable(items=(
                        (Gtk.Label(label=_('Hostname:')),
                         Gtk.Label(label=os.uname()[1])),
                        (Gtk.Label(label=_('Platform:')),
                         Gtk.Label(label=os.uname()[-1])),
                        (Gtk.Label(label=_('Distribution:')),
                         Gtk.Label(label=system.DISTRO)),
                        (Gtk.Label(label=_('Desktop Environment:')),
                         Gtk.Label(label=system.DESKTOP_FULLNAME))),
                        xpadding=12, ypadding=2)
        self.add_content(self.table)

        self.show_all()
Ejemplo n.º 6
0
    def __init__(self):
        Clip.__init__(self)

        self.table = EasyTable(items=(
                        (Gtk.Label(label=_('Current user:'******'Home directory:')),
                         Gtk.Label(label=GLib.get_home_dir())),
                        (Gtk.Label(label=_('Shell:')),
                         Gtk.Label(label=GLib.getenv('SHELL'))),
                        (Gtk.Label(label=_('Language:')),
                         Gtk.Label(label=GLib.getenv('LANG')))),
                        xpadding=12, ypadding=2)

        self.add_content(self.table)

        self.show_all()
Ejemplo n.º 7
0
    def __init__(self):
        Clip.__init__(self)

        self.table = EasyTable(items=((Gtk.Label(label=_('Current user:'******'Home directory:')),
                                       Gtk.Label(label=GLib.get_home_dir())),
                                      (Gtk.Label(label=_('Shell:')),
                                       Gtk.Label(label=GLib.getenv('SHELL'))),
                                      (Gtk.Label(label=_('Language:')),
                                       Gtk.Label(label=GLib.getenv('LANG')))),
                               xpadding=12,
                               ypadding=2)

        self.add_content(self.table)

        self.show_all()