[Xfce4-commits] <thunarx-python:master> Changed all python examples to use 4-space tabs instead of 2-space tabs
Adam Plumb
noreply at xfce.org
Thu May 27 18:10:55 CEST 2010
Updating branch refs/heads/master
to 07a2faf3ac65e24288876b66256669430c3a31f4 (commit)
from 9bec784b9617e413ec7fc0ecf17fbd8cc7ae1d92 (commit)
commit 07a2faf3ac65e24288876b66256669430c3a31f4
Author: Adam Plumb <adamplumb at gmail.com>
Date: Mon Jan 11 12:31:28 2010 -0500
Changed all python examples to use 4-space tabs instead of 2-space tabs
examples/thunarx-menu-plugin.py | 16 +++---
examples/thunarx-preferences-plugin.py | 34 ++++++------
examples/thunarx-property-page-plugin.py | 50 ++++++++--------
examples/thunarx-renamer-plugin.py | 62 ++++++++++----------
examples/thunarx-submenu-plugin.py | 92 +++++++++++++++---------------
5 files changed, 127 insertions(+), 127 deletions(-)
diff --git a/examples/thunarx-menu-plugin.py b/examples/thunarx-menu-plugin.py
index ae5d974..de19d5a 100644
--- a/examples/thunarx-menu-plugin.py
+++ b/examples/thunarx-menu-plugin.py
@@ -2,11 +2,11 @@ import thunarx
import gtk
class ThunarxMenuProviderPlugin(thunarx.MenuProvider):
- def __init__(self):
- pass
-
- def get_file_actions(self, window, files):
- return [gtk.Action("TMP:TestFileAction", "PyFileAction", "Python File Action", gtk.STOCK_FILE)]
-
- def get_folder_actions(self, window, folder):
- return [gtk.Action("TMP:TestFolderAction", "PyFolderAction", "Python Folder Action", gtk.STOCK_DIRECTORY)]
+ def __init__(self):
+ pass
+
+ def get_file_actions(self, window, files):
+ return [gtk.Action("TMP:TestFileAction", "PyFileAction", "Python File Action", gtk.STOCK_FILE)]
+
+ def get_folder_actions(self, window, folder):
+ return [gtk.Action("TMP:TestFolderAction", "PyFolderAction", "Python Folder Action", gtk.STOCK_DIRECTORY)]
diff --git a/examples/thunarx-preferences-plugin.py b/examples/thunarx-preferences-plugin.py
index 9c02aa4..2f2587d 100644
--- a/examples/thunarx-preferences-plugin.py
+++ b/examples/thunarx-preferences-plugin.py
@@ -2,21 +2,21 @@ import thunarx
import gtk
class ThunarxPreferencesPlugin(thunarx.PreferencesProvider):
- def __init__(self):
- pass
-
- def get_preferences_actions(self, window):
- action = gtk.Action("TPP:PrefItem", "My Example Preferences", None, None)
- action.connect("activate", self.__open_preferences, window)
- return action,
-
- def __open_preferences(self, action, window):
- dialog = gtk.Dialog("My dialog",
- window,
- gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
- (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
- gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
+ def __init__(self):
+ pass
+
+ def get_preferences_actions(self, window):
+ action = gtk.Action("TPP:PrefItem", "My Example Preferences", None, None)
+ action.connect("activate", self.__open_preferences, window)
+ return action,
+
+ def __open_preferences(self, action, window):
+ dialog = gtk.Dialog("My dialog",
+ window,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
+ gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
- dialog.show()
- dialog.run()
- dialog.destroy()
+ dialog.show()
+ dialog.run()
+ dialog.destroy()
diff --git a/examples/thunarx-property-page-plugin.py b/examples/thunarx-property-page-plugin.py
index 2672fe6..2d45147 100644
--- a/examples/thunarx-property-page-plugin.py
+++ b/examples/thunarx-property-page-plugin.py
@@ -5,38 +5,38 @@ import thunarx
import gtk
class ThunarxPropertyPagePlugin(thunarx.PropertyPageProvider):
- def __init__(self):
- pass
+ def __init__(self):
+ pass
- def get_property_pages(self, files):
- if len(files) != 1:
- return
-
- file = files[0]
- if file.get_uri_scheme() != 'file':
- return
+ def get_property_pages(self, files):
+ if len(files) != 1:
+ return
+
+ file = files[0]
+ if file.get_uri_scheme() != 'file':
+ return
- if file.is_directory():
- return
+ if file.is_directory():
+ return
- filename = urllib.unquote(file.get_uri()[7:])
+ filename = urllib.unquote(file.get_uri()[7:])
- self.hbox = gtk.HBox(0, False)
- self.hbox.show()
+ self.hbox = gtk.HBox(0, False)
+ self.hbox.show()
- label = gtk.Label('MD5Sum:')
- label.show()
- self.hbox.pack_start(label)
+ label = gtk.Label('MD5Sum:')
+ label.show()
+ self.hbox.pack_start(label)
- self.value_label = gtk.Label()
- self.hbox.pack_start(self.value_label)
+ self.value_label = gtk.Label()
+ self.hbox.pack_start(self.value_label)
- md5sum = hashlib.md5(filename).hexdigest()
- self.value_label.set_text(md5sum)
- self.value_label.show()
+ md5sum = hashlib.md5(filename).hexdigest()
+ self.value_label.set_text(md5sum)
+ self.value_label.show()
- page = thunarx.PropertyPage("MD5")
+ page = thunarx.PropertyPage("MD5")
- page.add(self.hbox)
+ page.add(self.hbox)
- return [page]
+ return [page]
diff --git a/examples/thunarx-renamer-plugin.py b/examples/thunarx-renamer-plugin.py
index 9dde971..f39892e 100644
--- a/examples/thunarx-renamer-plugin.py
+++ b/examples/thunarx-renamer-plugin.py
@@ -2,40 +2,40 @@ import thunarx
import gtk
class ThunarxPythonRenamer(thunarx.Renamer):
- __gtype_name__ = "ThunarxPythonRenamer"
-
- def __init__(self):
- thunarx.Renamer.__init__(self)
+ __gtype_name__ = "ThunarxPythonRenamer"
- self.set_name("Adam's Renamer")
- self.set_help_url("http://www.google.com")
+ def __init__(self):
+ thunarx.Renamer.__init__(self)
+
+ self.set_name("Adam's Renamer")
+ self.set_help_url("http://www.google.com")
+
+ hbox = gtk.HBox(0, False)
+
+ label = gtk.Label("Setting 1:")
+ hbox.pack_start(label, False, False, 0)
+
+ entry = gtk.Entry()
+ entry.connect("changed", self.changed)
+ hbox.pack_start(entry, False, False, 0)
+
+ label.show()
+ entry.show()
+ self.add(hbox)
+ hbox.show()
- hbox = gtk.HBox(0, False)
-
- label = gtk.Label("Setting 1:")
- hbox.pack_start(label, False, False, 0)
-
- entry = gtk.Entry()
- entry.connect("changed", self.changed)
- hbox.pack_start(entry, False, False, 0)
-
- label.show()
- entry.show()
- self.add(hbox)
- hbox.show()
-
- def process(self, file, text, index):
- return "__" + text
+ def process(self, file, text, index):
+ return "__" + text
- def changed(self, widget):
- print "changed"
+ def changed(self, widget):
+ print "changed"
- do_process = process
- do_changed = changed
+ do_process = process
+ do_changed = changed
class ThunarxRenamerPlugin(thunarx.RenamerProvider):
- def __init__(self):
- pass
-
- def get_renamers(self):
- return [ThunarxPythonRenamer()]
+ def __init__(self):
+ pass
+
+ def get_renamers(self):
+ return [ThunarxPythonRenamer()]
diff --git a/examples/thunarx-submenu-plugin.py b/examples/thunarx-submenu-plugin.py
index 0a073b9..aaace55 100644
--- a/examples/thunarx-submenu-plugin.py
+++ b/examples/thunarx-submenu-plugin.py
@@ -3,61 +3,61 @@ import gtk
"""
Thunarx Submenu Plugin
- This plugin shows an example of a MenuProvider plugin that implements
- sub-menus. The example used here requires the developer to sub-class
- gtk.Action and override the create_menu_item virtual method.
-
+ This plugin shows an example of a MenuProvider plugin that implements
+ sub-menus. The example used here requires the developer to sub-class
+ gtk.Action and override the create_menu_item virtual method.
+
"""
class MyAction(gtk.Action):
- __gtype_name__ = "MyAction"
-
- def __init__(self, name, label, tooltip=None, stock_id=None, menu_handler=None):
- gtk.Action.__init__(self, name, label, tooltip, stock_id)
- self.menu_handler = menu_handler
-
- def create_menu_item(self):
- menuitem = gtk.MenuItem(self.get_label())
-
- if self.menu_handler is not None:
- menu = gtk.Menu()
- menuitem.set_submenu(menu)
- self.menu_handler(menu)
+ __gtype_name__ = "MyAction"
- return menuitem
-
- do_create_menu_item = create_menu_item
+ def __init__(self, name, label, tooltip=None, stock_id=None, menu_handler=None):
+ gtk.Action.__init__(self, name, label, tooltip, stock_id)
+ self.menu_handler = menu_handler
+
+ def create_menu_item(self):
+ menuitem = gtk.MenuItem(self.get_label())
+
+ if self.menu_handler is not None:
+ menu = gtk.Menu()
+ menuitem.set_submenu(menu)
+ self.menu_handler(menu)
+
+ return menuitem
+
+ do_create_menu_item = create_menu_item
def PyFileActionMenu(menu):
- action = gtk.Action("TMP:Submenuitem1", "Submenuitem 1", None, None)
- subitem = action.create_menu_item()
- menu.append(subitem)
- subitem.show()
+ action = gtk.Action("TMP:Submenuitem1", "Submenuitem 1", None, None)
+ subitem = action.create_menu_item()
+ menu.append(subitem)
+ subitem.show()
- action = MyAction("TMP:Submenuitem2", "Submenuitem 2", None, None, menu_handler=PyFileActionSubmenu)
- subitem = action.create_menu_item()
- menu.append(subitem)
- subitem.show()
+ action = MyAction("TMP:Submenuitem2", "Submenuitem 2", None, None, menu_handler=PyFileActionSubmenu)
+ subitem = action.create_menu_item()
+ menu.append(subitem)
+ subitem.show()
def PyFileActionSubmenu(menu):
- action = gtk.Action("TMP:SubSubmenuitem1", "Subsubmenuitem 1", None, None)
- subitem = action.create_menu_item()
- menu.append(subitem)
- subitem.show()
+ action = gtk.Action("TMP:SubSubmenuitem1", "Subsubmenuitem 1", None, None)
+ subitem = action.create_menu_item()
+ menu.append(subitem)
+ subitem.show()
- action = gtk.Action("TMP:SubSubmenuitem2", "Subsubmenuitem 2", None, None)
- subitem = action.create_menu_item()
- menu.append(subitem)
- subitem.show()
+ action = gtk.Action("TMP:SubSubmenuitem2", "Subsubmenuitem 2", None, None)
+ subitem = action.create_menu_item()
+ menu.append(subitem)
+ subitem.show()
class ThunarxSubMenuProviderPlugin(thunarx.MenuProvider):
- def __init__(self):
- pass
-
- def get_file_actions(self, window, files):
- return [MyAction("TMP:TestFileAction", "PyFileAction", "Python File Action",
- gtk.STOCK_FILE, menu_handler=PyFileActionMenu)]
-
- def get_folder_actions(self, window, folder):
- return [MyAction("TMP:TestFolderAction", "PyFolderAction",
- "Python Folder Action", gtk.STOCK_DIRECTORY)]
+ def __init__(self):
+ pass
+
+ def get_file_actions(self, window, files):
+ return [MyAction("TMP:TestFileAction", "PyFileAction", "Python File Action",
+ gtk.STOCK_FILE, menu_handler=PyFileActionMenu)]
+
+ def get_folder_actions(self, window, folder):
+ return [MyAction("TMP:TestFolderAction", "PyFolderAction",
+ "Python Folder Action", gtk.STOCK_DIRECTORY)]
More information about the Xfce4-commits
mailing list