Commits

Ronny Pfannschmidt committed 4898a7e

automated action rewrite of pida-plugins/pastebin/pastebin.py
actionsconfig: 414 445
actions:
new_paste on_new_paste
show_pastes on_show_pastes
methods:
def create_actions(self):
def on_new_paste(self, action):
def on_show_pastes(self, action):

  • Participants
  • Parent commits 6e93a68
  • Branches action-cleanup

Comments (0)

Files changed (1)

File pida-plugins/pastebin/pastebin.py

 
 class PastebinActionsConfig(ActionsConfig):
 
-    def create_actions(self):
-        self.create_action(
-            'new_paste',
-            gtk.Action,
+
+    actions = [
+        gtk.Action('new_paste',
             _('Upload Text Snippet'),
             _('Upload a text snippet to a pastebin'),
-            gtk.STOCK_PASTE,
-            self.on_new_paste,
-        )
-
-        self.create_action(
-            'show_pastes',
-            PidaRememberToggle,
+            gtk.STOCK_PASTE),
+        PidaRememberToggle('show_pastes',
             _('Paste History'),
             _('Show the paste history viewer'),
-            gtk.STOCK_PASTE,
-            self.on_show_pastes,
-            '<Shift><Control>0',
-        )
+            gtk.STOCK_PASTE),
+    ]
+
+    accels = {
+        'show_pastes': '<Shift><Control>0',
+    }
 
     def on_new_paste(self, action):
         self.svc.new_paste()