~vcs-imports/kupfer/master-new

« back to all changes in this revision

Viewing changes to kupfer/plugin/screen.py

  • Committer: Ulrik Sverdrup
  • Date: 2009-06-14 20:16:43 UTC
  • mfrom: (407.1.11)
  • Revision ID: git-v1:928c740f64d6ff3c1b9819ba49c2e47809b436b5
Merge branch 'localization'

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
                                break
30
30
                else:
31
31
                        return "%s (%s)" % (self.name, self.object)
32
 
                return "%s session %s (%s) created %s" % (status, name, pid, time)
 
32
                return (_("%(status)s session %(name)s (%(pid)s) created %(time)s") %
 
33
                                {"status": status, "name": name, "pid": pid, "time": time})
33
34
 
34
35
        def get_icon_name(self):
35
36
                return "gnome-window-manager"
37
38
class ScreenSessionsSource (Source):
38
39
        """Source for GNU Screen sessions"""
39
40
        def __init__(self):
40
 
                super(ScreenSessionsSource, self).__init__("Screen sessions")
 
41
                super(ScreenSessionsSource, self).__init__(_("Screen sessions"))
41
42
        def is_dynamic(self):
42
43
                return True
43
44
        def get_items(self):
45
46
                        yield ScreenSession(pid, name)
46
47
 
47
48
        def get_description(self):
48
 
                return "Active GNU Screen sessions"
 
49
                return _("Active GNU Screen sessions")
49
50
        def get_icon_name(self):
50
51
                return "terminal"
51
52
 
53
54
        """
54
55
        """
55
56
        def __init__(self):
56
 
                name = "Attach"
 
57
                name = _("Attach")
57
58
                super(AttachScreen, self).__init__(name)
58
59
        def activate(self, leaf):
59
60
                import gio
60
61
                pid = leaf.object
61
62
                action = "screen -x -R %s" % pid
62
 
                item = gio.AppInfo(action, "GNU Screen session", gio.APP_INFO_CREATE_NEEDS_TERMINAL)
 
63
                item = gio.AppInfo(action, _("GNU Screen session"),
 
64
                                gio.APP_INFO_CREATE_NEEDS_TERMINAL)
63
65
                utils.launch_app(item)