fix indent (#183)
This commit is contained in:
parent
a082473a66
commit
ce675497d1
@ -3,4 +3,3 @@
|
|||||||
import compileall
|
import compileall
|
||||||
|
|
||||||
compileall.compile_dir(".", force=1)
|
compileall.compile_dir(".", force=1)
|
||||||
|
|
||||||
|
@ -5,23 +5,23 @@
|
|||||||
# Copyright (C) 2008 Luca Bruno <lethalman88@gmail.com>
|
# Copyright (C) 2008 Luca Bruno <lethalman88@gmail.com>
|
||||||
#
|
#
|
||||||
# This a slightly modified version of the globalkeybinding.py file which is part of FreeSpeak.
|
# This a slightly modified version of the globalkeybinding.py file which is part of FreeSpeak.
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
# of this software and associated documentation files (the "Software"), to deal
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
# in the Software without restriction, including without limitation the rights
|
# in the Software without restriction, including without limitation the rights
|
||||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
# copies of the Software, and to permit persons to whom the Software is
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
# furnished to do so, subject to the following conditions:
|
# furnished to do so, subject to the following conditions:
|
||||||
#
|
#
|
||||||
# The above copyright notice and this permission notice shall be included in
|
# The above copyright notice and this permission notice shall be included in
|
||||||
# all copies or substantial portions of the Software.
|
# all copies or substantial portions of the Software.
|
||||||
#
|
#
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
# DEALINGS IN THE SOFTWARE.
|
# DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
@ -62,8 +62,8 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread):
|
|||||||
|
|
||||||
def map_modifiers(self):
|
def map_modifiers(self):
|
||||||
gdk_modifiers =(Gdk.ModifierType.CONTROL_MASK, Gdk.ModifierType.SHIFT_MASK, Gdk.ModifierType.MOD1_MASK,
|
gdk_modifiers =(Gdk.ModifierType.CONTROL_MASK, Gdk.ModifierType.SHIFT_MASK, Gdk.ModifierType.MOD1_MASK,
|
||||||
Gdk.ModifierType.MOD2_MASK, Gdk.ModifierType.MOD3_MASK, Gdk.ModifierType.MOD4_MASK, Gdk.ModifierType.MOD5_MASK,
|
Gdk.ModifierType.MOD2_MASK, Gdk.ModifierType.MOD3_MASK, Gdk.ModifierType.MOD4_MASK, Gdk.ModifierType.MOD5_MASK,
|
||||||
Gdk.ModifierType.SUPER_MASK, Gdk.ModifierType.HYPER_MASK)
|
Gdk.ModifierType.SUPER_MASK, Gdk.ModifierType.HYPER_MASK)
|
||||||
self.known_modifiers_mask = 0
|
self.known_modifiers_mask = 0
|
||||||
for modifier in gdk_modifiers:
|
for modifier in gdk_modifiers:
|
||||||
if "Mod" not in Gtk.accelerator_name(0, modifier) or "Mod4" in Gtk.accelerator_name(0, modifier):
|
if "Mod" not in Gtk.accelerator_name(0, modifier) or "Mod4" in Gtk.accelerator_name(0, modifier):
|
||||||
@ -100,14 +100,14 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread):
|
|||||||
def ungrab(self):
|
def ungrab(self):
|
||||||
if self.keycode:
|
if self.keycode:
|
||||||
self.window.ungrab_key(self.keycode, X.AnyModifier, self.window)
|
self.window.ungrab_key(self.keycode, X.AnyModifier, self.window)
|
||||||
|
|
||||||
def rebind(self, key):
|
def rebind(self, key):
|
||||||
self.ungrab()
|
self.ungrab()
|
||||||
if key != "":
|
if key != "":
|
||||||
self.grab(key)
|
self.grab(key)
|
||||||
else:
|
else:
|
||||||
self.keytext = ""
|
self.keytext = ""
|
||||||
|
|
||||||
def set_focus_window(self, window = None):
|
def set_focus_window(self, window = None):
|
||||||
self.ungrab()
|
self.ungrab()
|
||||||
if window is None:
|
if window is None:
|
||||||
|
@ -702,7 +702,7 @@ class MenuWin( object ):
|
|||||||
|
|
||||||
|
|
||||||
def showPreferences( self, action, userdata = None ):
|
def showPreferences( self, action, userdata = None ):
|
||||||
# Execute( "mateconf-editor /apps/mintMenu" )
|
# Execute( "mateconf-editor /apps/mintMenu" )
|
||||||
Execute( os.path.join( PATH, "mintMenuConfig.py" ) )
|
Execute( os.path.join( PATH, "mintMenuConfig.py" ) )
|
||||||
|
|
||||||
def showMenuEditor( self, action, userdata = None ):
|
def showMenuEditor( self, action, userdata = None ):
|
||||||
@ -751,7 +751,7 @@ class MenuWin( object ):
|
|||||||
screenWidth = Gdk.Screen.width()
|
screenWidth = Gdk.Screen.width()
|
||||||
if self.applet.get_orient() == MatePanelApplet.AppletOrient.UP or self.applet.get_orient() == MatePanelApplet.AppletOrient.DOWN:
|
if self.applet.get_orient() == MatePanelApplet.AppletOrient.UP or self.applet.get_orient() == MatePanelApplet.AppletOrient.DOWN:
|
||||||
if entryX + ourWidth < screenWidth or entryX + entryWidth / 2 < screenWidth / 2:
|
if entryX + ourWidth < screenWidth or entryX + entryWidth / 2 < screenWidth / 2:
|
||||||
# Align to the left of the entry
|
# Align to the left of the entry
|
||||||
newX = entryX
|
newX = entryX
|
||||||
else:
|
else:
|
||||||
# Align to the right of the entry
|
# Align to the right of the entry
|
||||||
@ -805,7 +805,7 @@ class MenuWin( object ):
|
|||||||
if de in ["gnome", "gnome-shell", "mate", "kde", "xfce"]:
|
if de in ["gnome", "gnome-shell", "mate", "kde", "xfce"]:
|
||||||
self.de = de
|
self.de = de
|
||||||
elif de in ['cinnamon', 'x-cinnamon']:
|
elif de in ['cinnamon', 'x-cinnamon']:
|
||||||
self.de = 'cinnamon'
|
self.de = 'cinnamon'
|
||||||
else:
|
else:
|
||||||
if os.path.exists("/usr/bin/caja"):
|
if os.path.exists("/usr/bin/caja"):
|
||||||
self.de = "mate"
|
self.de = "mate"
|
||||||
@ -826,4 +826,3 @@ def quit_all(widget):
|
|||||||
MatePanelApplet.Applet.factory_main("MintMenuAppletFactory", True,
|
MatePanelApplet.Applet.factory_main("MintMenuAppletFactory", True,
|
||||||
MatePanelApplet.Applet.__gtype__,
|
MatePanelApplet.Applet.__gtype__,
|
||||||
applet_factory, None)
|
applet_factory, None)
|
||||||
|
|
||||||
|
@ -515,7 +515,7 @@ class mintMenuConfig( object ):
|
|||||||
self.systemHeightButton.set_sensitive(False)
|
self.systemHeightButton.set_sensitive(False)
|
||||||
|
|
||||||
def updatePlacesGSettings(self, treemodel, path, iter = None, new_order = None):
|
def updatePlacesGSettings(self, treemodel, path, iter = None, new_order = None):
|
||||||
# Do only if not partway though an append operation; Append = insert+change+change and each creates a signal
|
# Do only if not partway though an append operation; Append = insert+change+change and each creates a signal
|
||||||
if ((iter == None) or (self.customplacestreemodel.get_value(iter, 1) != None)):
|
if ((iter == None) or (self.customplacestreemodel.get_value(iter, 1) != None)):
|
||||||
treeiter = self.customplacestreemodel.get_iter_first()
|
treeiter = self.customplacestreemodel.get_iter_first()
|
||||||
customplacenames = [ ]
|
customplacenames = [ ]
|
||||||
|
@ -222,7 +222,7 @@ class pluginclass( object ):
|
|||||||
|
|
||||||
# self.searchButton.connect( "button_release_event", self.SearchWithButton )
|
# self.searchButton.connect( "button_release_event", self.SearchWithButton )
|
||||||
try:
|
try:
|
||||||
# GSettings stuff
|
# GSettings stuff
|
||||||
self.settings = EasyGSettings( "com.linuxmint.mintmenu.plugins.applications" )
|
self.settings = EasyGSettings( "com.linuxmint.mintmenu.plugins.applications" )
|
||||||
self.GetGSettingsEntries()
|
self.GetGSettingsEntries()
|
||||||
self.settings.notifyAdd( "icon-size", self.changeIconSize )
|
self.settings.notifyAdd( "icon-size", self.changeIconSize )
|
||||||
@ -792,7 +792,7 @@ class pluginclass( object ):
|
|||||||
# We're restricting our search...
|
# We're restricting our search...
|
||||||
self.add_search_suggestions(text)
|
self.add_search_suggestions(text)
|
||||||
#if (len(self.current_results) > 0):
|
#if (len(self.current_results) > 0):
|
||||||
#self.add_apt_filter_results_sync(self.current_results, text)
|
#self.add_apt_filter_results_sync(self.current_results, text)
|
||||||
#else:
|
#else:
|
||||||
GLib.timeout_add (300, self.add_apt_filter_results, text)
|
GLib.timeout_add (300, self.add_apt_filter_results, text)
|
||||||
else:
|
else:
|
||||||
|
@ -17,7 +17,7 @@ from filemonitor import monitor as filemonitor
|
|||||||
class IconManager(GObject.GObject):
|
class IconManager(GObject.GObject):
|
||||||
|
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
"changed" : (GObject.SignalFlags.RUN_LAST, None, () )
|
"changed" : (GObject.SignalFlags.RUN_LAST, None, () )
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__( self ):
|
def __init__( self ):
|
||||||
|
@ -90,5 +90,3 @@ class EasyGSettings:
|
|||||||
setattr( obj, varName, settings.get_boolean(key) )
|
setattr( obj, varName, settings.get_boolean(key) )
|
||||||
else:
|
else:
|
||||||
setattr( obj, varName, settings.get_value(key) )
|
setattr( obj, varName, settings.get_value(key) )
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,4 +44,3 @@ def Execute( cmd , commandCwd=None):
|
|||||||
except Exception, detail:
|
except Exception, detail:
|
||||||
print detail
|
print detail
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ if hasInotify:
|
|||||||
|
|
||||||
def fileChanged(self, event ):
|
def fileChanged(self, event ):
|
||||||
if event.wd in self.callbacks:
|
if event.wd in self.callbacks:
|
||||||
# print event.path
|
# print event.path
|
||||||
callback = self.callbacks[event.wd]
|
callback = self.callbacks[event.wd]
|
||||||
if callback[1]:
|
if callback[1]:
|
||||||
GLib.idle_add( callback[0], callback[1] )
|
GLib.idle_add( callback[0], callback[1] )
|
||||||
|
@ -199,9 +199,9 @@ class pluginclass:
|
|||||||
if ev.button == 1:
|
if ev.button == 1:
|
||||||
if not hasattr( self, "press_x" ) or \
|
if not hasattr( self, "press_x" ) or \
|
||||||
not w.drag_check_threshold( int( self.press_x ),
|
not w.drag_check_threshold( int( self.press_x ),
|
||||||
int( self.press_y ),
|
int( self.press_y ),
|
||||||
int( ev.x ),
|
int( ev.x ),
|
||||||
int( ev.y ) ):
|
int( ev.y ) ):
|
||||||
if self.Win.pinmenu == False:
|
if self.Win.pinmenu == False:
|
||||||
self.Win.wTree.get_widget( "window1" ).hide()
|
self.Win.wTree.get_widget( "window1" ).hide()
|
||||||
if "applications" in self.Win.plugins:
|
if "applications" in self.Win.plugins:
|
||||||
|
@ -182,7 +182,7 @@ class pluginclass( object ):
|
|||||||
Button4.show()
|
Button4.show()
|
||||||
self.systemBtnHolder.pack_start( Button4, False, False, 0 )
|
self.systemBtnHolder.pack_start( Button4, False, False, 0 )
|
||||||
self.mintMenuWin.setTooltip( Button4, _("Use the command line") )
|
self.mintMenuWin.setTooltip( Button4, _("Use the command line") )
|
||||||
|
|
||||||
if ( self.showLockScreen == True ):
|
if ( self.showLockScreen == True ):
|
||||||
Button5 = easyButton( "system-lock-screen", self.iconsize, [_("Lock Screen")], -1, -1 )
|
Button5 = easyButton( "system-lock-screen", self.iconsize, [_("Lock Screen")], -1, -1 )
|
||||||
Button5.connect( "clicked", self.ButtonClicked, self.lock_cmd )
|
Button5.connect( "clicked", self.ButtonClicked, self.lock_cmd )
|
||||||
|
@ -55,7 +55,7 @@ class PointerMonitor(GObject.GObject, threading.Thread):
|
|||||||
p = self.get_window().get_device_position(pdevice)
|
p = self.get_window().get_device_position(pdevice)
|
||||||
g = self.get_size()
|
g = self.get_size()
|
||||||
|
|
||||||
if p.x >= 0 and p.y >= 0 and p.x <= g.width and p.y <= g.height:
|
if p.x >= 0 and p.y >= 0 and p.x <= g.width and p.y <= g.height:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
# Is outside, so activate
|
# Is outside, so activate
|
||||||
@ -70,4 +70,3 @@ class PointerMonitor(GObject.GObject, threading.Thread):
|
|||||||
self.running = False
|
self.running = False
|
||||||
self.root.ungrab_button(X.AnyButton, X.AnyModifier)
|
self.root.ungrab_button(X.AnyButton, X.AnyModifier)
|
||||||
self.display.close()
|
self.display.close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user