[alacarte] Move revert item code close together



commit 29640389b3131822493371678f54b99e72f090ac
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Jun 1 00:52:54 2012 -0400

    Move revert item code close together
    
    Quick organizational commit

 Alacarte/MenuEditor.py |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/Alacarte/MenuEditor.py b/Alacarte/MenuEditor.py
index a1cc1b8..aeb12b7 100644
--- a/Alacarte/MenuEditor.py
+++ b/Alacarte/MenuEditor.py
@@ -81,6 +81,29 @@ class MenuEditor(object):
             item_type = item_iter.next()
         self.revertMenu(menu)
 
+    def revertItem(self, item):
+        if not self.canRevert(item):
+            return
+        try:
+            os.remove(item.get_desktop_file_path())
+        except OSError:
+            pass
+        self.save()
+
+    def revertMenu(self, menu):
+        if not self.canRevert(menu):
+            return
+        #wtf happened here? oh well, just bail
+        if not menu.get_desktop_file_path():
+            return
+        file_id = os.path.split(menu.get_desktop_file_path())[1]
+        path = os.path.join(util.getUserDirectoryPath(), file_id)
+        try:
+            os.remove(path)
+        except OSError:
+            pass
+        self.save()
+
     def getMenus(self, parent=None):
         if parent == None:
             yield self.applications.tree.get_root_directory()
@@ -312,29 +335,6 @@ class MenuEditor(object):
         self.addXmlLayout(menu_xml, layout, dom)
         self.save()
 
-    def revertItem(self, item):
-        if not self.canRevert(item):
-            return
-        try:
-            os.remove(item.get_desktop_file_path())
-        except OSError:
-            pass
-        self.save()
-
-    def revertMenu(self, menu):
-        if not self.canRevert(menu):
-            return
-        #wtf happened here? oh well, just bail
-        if not menu.get_desktop_file_path():
-            return
-        file_id = os.path.split(menu.get_desktop_file_path())[1]
-        path = os.path.join(util.getUserDirectoryPath(), file_id)
-        try:
-            os.remove(path)
-        except OSError:
-            pass
-        self.save()
-
     def getMenu(self, item):
         return self.applications
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]