[alacarte] Use new-style classes, clean up
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [alacarte] Use new-style classes, clean up
- Date: Wed, 23 May 2012 19:01:23 +0000 (UTC)
commit 39add39429370daa63971bb1805298a496497124
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue May 1 17:03:46 2012 -0400
Use new-style classes, clean up
Alacarte/MainWindow.py | 6 ++----
Alacarte/MenuEditor.py | 10 +++++-----
alacarte.in | 2 +-
3 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/Alacarte/MainWindow.py b/Alacarte/MainWindow.py
index 1ae39c9..7302833 100644
--- a/Alacarte/MainWindow.py
+++ b/Alacarte/MainWindow.py
@@ -22,7 +22,6 @@ import cgi, os
import gettext
import subprocess
import urllib
-import tempfile
from Alacarte import config
gettext.bindtextdomain(config.GETTEXT_PACKAGE, config.localedir)
@@ -31,9 +30,8 @@ gettext.textdomain(config.GETTEXT_PACKAGE)
_ = gettext.gettext
from Alacarte.MenuEditor import MenuEditor
from Alacarte import util
-import sys
-class MainWindow:
+class MainWindow(object):
timer = None
#hack to make editing menu properties work
allow_update = True
@@ -44,7 +42,7 @@ class MainWindow:
drag_data = None
edit_pool = []
- def __init__(self, datadir, version, argv):
+ def __init__(self, datadir, version):
self.file_path = datadir
self.version = version
self.editor = MenuEditor()
diff --git a/Alacarte/MenuEditor.py b/Alacarte/MenuEditor.py
index 793398b..fd13ac5 100644
--- a/Alacarte/MenuEditor.py
+++ b/Alacarte/MenuEditor.py
@@ -20,13 +20,13 @@ import os, sys, re, xml.dom.minidom, locale
from gi.repository import GMenu, GLib
from Alacarte import util
-class Menu:
+class Menu(object):
tree = None
visible_tree = None
path = None
dom = None
-class MenuEditor:
+class MenuEditor(object):
#lists for undo/redo functionality
__undo = []
__redo = []
@@ -57,7 +57,7 @@ class MenuEditor:
self.applications.visible_tree.load_sync()
def __loadMenus(self):
- self.reloadMenus();
+ self.reloadMenus()
self.save(True)
self.applications.visible_tree.connect("changed", self.__menuChanged)
@@ -796,8 +796,8 @@ class MenuEditor:
node.appendChild(self.__addXmlTextElement(node, 'New', new, dom))
return element.appendChild(node)
-class Layout:
- def __init__(self, node=None):
+class Layout(object):
+ def __init__(self):
self.order = []
def parseMenuname(self, value):
diff --git a/alacarte.in b/alacarte.in
index 3ec4cfe..922f8c5 100644
--- a/alacarte.in
+++ b/alacarte.in
@@ -29,7 +29,7 @@ def main():
except:
datadir = '.'
version = '0.9'
- app = MainWindow(datadir, version, sys.argv)
+ app = MainWindow(datadir, version)
app.run()
if __name__ == '__main__':
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]