sabayon r936 - in trunk/lib: . sources
- From: jrobeson svn gnome org
- To: svn-commits-list gnome org
- Subject: sabayon r936 - in trunk/lib: . sources
- Date: Fri, 15 Feb 2008 19:39:24 +0000 (GMT)
Author: jrobeson
Date: Fri Feb 15 19:39:24 2008
New Revision: 936
URL: http://svn.gnome.org/viewvc/sabayon?rev=936&view=rev
Log:
TABS to spaces
Modified:
trunk/lib/sources/paneldelegate.py
trunk/lib/storage.py
Modified: trunk/lib/sources/paneldelegate.py
==============================================================================
--- trunk/lib/sources/paneldelegate.py (original)
+++ trunk/lib/sources/paneldelegate.py Fri Feb 15 19:39:24 2008
@@ -64,63 +64,63 @@
def __init__ (self, source, delegate, id):
PanelChange.__init__ (self, source, delegate, id)
def get_short_description (self):
- # FIXME: This only works if panel object type is bonobo-applet. Are all applets bonobo-applets ?
- panel_applet = self.delegate.PanelApplet(self.id)
- toplevel_id = panel_applet.toplevel_id
- name = panel_applet.name
-
- panel_toplevel = self.delegate.PanelToplevel(toplevel_id)
- panel_orientation = panel_toplevel.orientation
-
- if panel_orientation == "top":
- return _("Applet %s added to top panel") % name
- elif panel_orientation == "bottom":
- return _("Applet %s added to bottom panel") % name
- elif panel_orientation == "left":
- return _("Applet %s added to left panel") % name
- else:
- return _("Applet %s added to right panel") % name
+ # FIXME: This only works if panel object type is bonobo-applet. Are all applets bonobo-applets ?
+ panel_applet = self.delegate.PanelApplet(self.id)
+ toplevel_id = panel_applet.toplevel_id
+ name = panel_applet.name
+
+ panel_toplevel = self.delegate.PanelToplevel(toplevel_id)
+ panel_orientation = panel_toplevel.orientation
+
+ if panel_orientation == "top":
+ return _("Applet %s added to top panel") % name
+ elif panel_orientation == "bottom":
+ return _("Applet %s added to bottom panel") % name
+ elif panel_orientation == "left":
+ return _("Applet %s added to left panel") % name
+ else:
+ return _("Applet %s added to right panel") % name
class PanelAppletRemovedChange (PanelChange):
def __init__ (self, source, delegate, id):
PanelChange.__init__ (self, source, delegate, id)
def get_short_description (self):
- # FIXME: This only works if panel object type is bonobo-applet. Are all applets bonobo-applets ?
- panel_applet = self.delegate.PanelApplet(self.id)
- toplevel_id = panel_applet.toplevel_id
- name = panel_applet.name
-
- panel_toplevel = self.delegate.PanelToplevel(toplevel_id)
- panel_orientation = panel_toplevel.orientation
-
- if panel_orientation == "top":
- return _("Applet %s removed from top panel") % name
- elif panel_orientation == "bottom":
- return _("Applet %s removed from bottom panel") % name
- elif panel_orientation == "left":
- return _("Applet %s removed from left panel") % name
- else:
- return _("Applet %s removed from right panel") % name
+ # FIXME: This only works if panel object type is bonobo-applet. Are all applets bonobo-applets ?
+ panel_applet = self.delegate.PanelApplet(self.id)
+ toplevel_id = panel_applet.toplevel_id
+ name = panel_applet.name
+
+ panel_toplevel = self.delegate.PanelToplevel(toplevel_id)
+ panel_orientation = panel_toplevel.orientation
+
+ if panel_orientation == "top":
+ return _("Applet %s removed from top panel") % name
+ elif panel_orientation == "bottom":
+ return _("Applet %s removed from bottom panel") % name
+ elif panel_orientation == "left":
+ return _("Applet %s removed from left panel") % name
+ else:
+ return _("Applet %s removed from right panel") % name
class PanelObjectAddedChange (PanelChange):
def __init__ (self, source, delegate, id):
PanelChange.__init__ (self, source, delegate, id)
def get_short_description (self):
- panel_object = self.delegate.PanelObject(self.id)
- toplevel_id = panel_object.toplevel_id
- name = panel_object.name
-
- panel_toplevel = self.delegate.PanelToplevel(toplevel_id)
- panel_orientation = panel_toplevel.orientation
-
- if panel_orientation == "top":
- return _("%s added to top panel") % name
- elif panel_orientation == "bottom":
- return _("%s added to bottom panel") % name
- elif panel_orientation == "left":
- return _("%s added to left panel") % name
- else:
- return _("%s added to right panel") % name
+ panel_object = self.delegate.PanelObject(self.id)
+ toplevel_id = panel_object.toplevel_id
+ name = panel_object.name
+
+ panel_toplevel = self.delegate.PanelToplevel(toplevel_id)
+ panel_orientation = panel_toplevel.orientation
+
+ if panel_orientation == "top":
+ return _("%s added to top panel") % name
+ elif panel_orientation == "bottom":
+ return _("%s added to bottom panel") % name
+ elif panel_orientation == "left":
+ return _("%s added to left panel") % name
+ else:
+ return _("%s added to right panel") % name
def commit_change (self, mandatory):
# Might have to commit a launcher file
@@ -133,21 +133,21 @@
def __init__ (self, source, delegate, id):
PanelChange.__init__ (self, source, delegate, id)
def get_short_description (self):
- panel_object = self.delegate.PanelObject(self.id)
- toplevel_id = panel_object.toplevel_id
- name = panel_object.name
-
- panel_toplevel = self.delegate.PanelToplevel(toplevel_id)
- panel_orientation = panel_toplevel.orientation
-
- if panel_orientation == "top":
- return _("%s removed from top panel") % name
- elif panel_orientation == "bottom":
- return _("%s removed from bottom panel") % name
- elif panel_orientation == "left":
- return _("%s removed from left panel") % name
- else:
- return _("%s removed from right panel") % name
+ panel_object = self.delegate.PanelObject(self.id)
+ toplevel_id = panel_object.toplevel_id
+ name = panel_object.name
+
+ panel_toplevel = self.delegate.PanelToplevel(toplevel_id)
+ panel_orientation = panel_toplevel.orientation
+
+ if panel_orientation == "top":
+ return _("%s removed from top panel") % name
+ elif panel_orientation == "bottom":
+ return _("%s removed from bottom panel") % name
+ elif panel_orientation == "left":
+ return _("%s removed from left panel") % name
+ else:
+ return _("%s removed from right panel") % name
def commit_change (self, mandatory):
launcher = self.delegate.client.get_string (PANEL_KEY_BASE + "/objects/" + self.id + "/launcher_location")
@@ -161,7 +161,7 @@
self.id = id
self.added = added
self.removed = removed
- self.client = gconf.client_get_default ()
+ self.client = gconf.client_get_default ()
class PanelToplevel (PanelThing):
def __init__ (self, id, added = False, removed = False):
@@ -169,61 +169,61 @@
self.orientation = self.client.get_string (PANEL_KEY_BASE + "/toplevels/" + id + "/orientation")
- # FIXME: which of the following attributes do we really need?
+ # FIXME: which of the following attributes do we really need?
# self.name = self.client.get_string (PANEL_KEY_BASE + "/toplevels/" + toplevel_id + "/name")
# self.expand = self.client.get_bool (PANEL_KEY_BASE + "/toplevels/" + toplevel_id + "/expand")
class PanelApplet (PanelThing):
def __init__ (self, id, added = False, removed = False):
- PanelDelegate.PanelThing.__init__ (self, id, added, removed)
-
- self.toplevel_id = self.client.get_string (PANEL_KEY_BASE + "/applets/" + id + "/toplevel_id")
- self.bonobo_iid = self.client.get_string (PANEL_KEY_BASE + "/applets/" + id + "/bonobo_iid")
-
- applet = bonobo.activation.query("iid == '" + self.bonobo_iid + "'" )
- for i in applet:
- for prop in i.props:
- if prop.name == "name":
- self.name = prop.v.value_string #FIXME: This probably won't return localised names
+ PanelDelegate.PanelThing.__init__ (self, id, added, removed)
+
+ self.toplevel_id = self.client.get_string (PANEL_KEY_BASE + "/applets/" + id + "/toplevel_id")
+ self.bonobo_iid = self.client.get_string (PANEL_KEY_BASE + "/applets/" + id + "/bonobo_iid")
+
+ applet = bonobo.activation.query("iid == '" + self.bonobo_iid + "'" )
+ for i in applet:
+ for prop in i.props:
+ if prop.name == "name":
+ self.name = prop.v.value_string #FIXME: This probably won't return localised names
class PanelObject (PanelThing):
- def __init__ (self, id, added = False, removed = False):
- PanelDelegate.PanelThing.__init__ (self, id, added, removed)
-
- self.toplevel_id = self.client.get_string (PANEL_KEY_BASE + "/objects/" + id + "/toplevel_id")
- self.object_type = self.client.get_string (PANEL_KEY_BASE + "/objects/" + id + "/object_type")
-
- if self.object_type == "drawer-object":
- # Translators: This is a drawer in gnome-panel (where you can put applets)
- self.name = _("Drawer")
- elif self.object_type == "menu-object":
- self.name = _("Main Menu")
- elif self.object_type == "launcher-object":
- launcher_location = self.client.get_string (PANEL_KEY_BASE + "/objects/" + id + "/launcher_location")
- if launcher_location[0] == '/':
- desktop_file = launcher_location
- elif launcher_location[0:7] == "file://": # See what happens when you drag and drop from the menu
- desktop_file = launcher_location[7:]
- else:
- desktop_file = PANEL_LAUNCHER_DIR + "/" + launcher_location
- launcher = xdg.DesktopEntry.DesktopEntry(desktop_file)
- self.name = _("%s launcher") % launcher.getName()
- elif self.object_type == "action-applet":
- action_type = self.client.get_string (PANEL_KEY_BASE + "/objects/" + id + "/action_type")
- if action_type == "lock":
- self.name = _("Lock Screen button")
- elif action_type == "logout":
- self.name = _("Logout button")
- elif action_type == "run":
- self.name = _("Run Application button")
- elif action_type == "search":
- self.name = _("Search button")
- else:
- self.name = _("Screenshot button")
- else:
- self.name = _("Menu Bar")
+ def __init__ (self, id, added = False, removed = False):
+ PanelDelegate.PanelThing.__init__ (self, id, added, removed)
+
+ self.toplevel_id = self.client.get_string (PANEL_KEY_BASE + "/objects/" + id + "/toplevel_id")
+ self.object_type = self.client.get_string (PANEL_KEY_BASE + "/objects/" + id + "/object_type")
+
+ if self.object_type == "drawer-object":
+ # Translators: This is a drawer in gnome-panel (where you can put applets)
+ self.name = _("Drawer")
+ elif self.object_type == "menu-object":
+ self.name = _("Main Menu")
+ elif self.object_type == "launcher-object":
+ launcher_location = self.client.get_string (PANEL_KEY_BASE + "/objects/" + id + "/launcher_location")
+ if launcher_location[0] == '/':
+ desktop_file = launcher_location
+ elif launcher_location[0:7] == "file://": # See what happens when you drag and drop from the menu
+ desktop_file = launcher_location[7:]
+ else:
+ desktop_file = PANEL_LAUNCHER_DIR + "/" + launcher_location
+ launcher = xdg.DesktopEntry.DesktopEntry(desktop_file)
+ self.name = _("%s launcher") % launcher.getName()
+ elif self.object_type == "action-applet":
+ action_type = self.client.get_string (PANEL_KEY_BASE + "/objects/" + id + "/action_type")
+ if action_type == "lock":
+ self.name = _("Lock Screen button")
+ elif action_type == "logout":
+ self.name = _("Logout button")
+ elif action_type == "run":
+ self.name = _("Run Application button")
+ elif action_type == "search":
+ self.name = _("Search button")
+ else:
+ self.name = _("Screenshot button")
+ else:
+ self.name = _("Menu Bar")
def __init__ (self, source):
userprofile.SourceDelegate.__init__ (self, _("Panel"), source, PANEL_KEY_BASE)
Modified: trunk/lib/storage.py
==============================================================================
--- trunk/lib/storage.py (original)
+++ trunk/lib/storage.py Fri Feb 15 19:39:24 2008
@@ -39,7 +39,7 @@
return
if os.path.isdir (path):
- for file in os.listdir (path):
+ for file in os.listdir (path):
subpath = os.path.join (path, file)
recursive_del (subpath)
os.rmdir (path)
@@ -73,10 +73,10 @@
def unlink_children(node):
children = node.children
while children:
- tmp = children
- children = children.next
- tmp.unlinkNode()
- tmp.freeNode()
+ tmp = children
+ children = children.next
+ tmp.unlinkNode()
+ tmp.freeNode()
class ProfileStorageException (Exception):
pass
@@ -107,23 +107,23 @@
/etc/desktop-profiles/$(name).zip.
"""
self.name = name
- self.readonly = 0
+ self.readonly = 0
if not os.path.isabs (self.name):
- try:
- protocol = urlparse.urlparse(self.name)[0]
- if protocol == "":
- self.path = os.path.join (PROFILESDIR, self.name + ".zip")
- else:
- # if someone uses file:/// they deserve to have troubles
- self.readonly == 1
- cachou = cache.get_default_cache()
- self.path = cachou.get_resource(self.name)
- if self.path == None:
- self.path = self.name
+ try:
+ protocol = urlparse.urlparse(self.name)[0]
+ if protocol == "":
+ self.path = os.path.join (PROFILESDIR, self.name + ".zip")
+ else:
+ # if someone uses file:/// they deserve to have troubles
+ self.readonly == 1
+ cachou = cache.get_default_cache()
+ self.path = cachou.get_resource(self.name)
+ if self.path == None:
+ self.path = self.name
- except:
- self.path = os.path.join (PROFILESDIR, self.name + ".zip")
+ except:
+ self.path = os.path.join (PROFILESDIR, self.name + ".zip")
else:
self.path = name
@@ -564,7 +564,7 @@
"""Save the contents of the profile to
/etc/desktop-profiles/$(name).zip.
"""
- if self.readonly:
+ if self.readonly:
raise ProfileStorageException (_("Profile is read-only %s") %
(self.name))
self.__read_metadata ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]