cleanups
This commit is contained in:
parent
7b1143a6ff
commit
99535cddbb
|
@ -204,16 +204,13 @@ class GuiAutoImport (threading.Thread):
|
||||||
# That is not correct. It should open another dir for importing while piping the
|
# That is not correct. It should open another dir for importing while piping the
|
||||||
# results to the same pipe. This means that self.path should be a a list of dirs
|
# results to the same pipe. This means that self.path should be a a list of dirs
|
||||||
# to watch.
|
# to watch.
|
||||||
if data == "autostart":
|
if data == "autostart" or (widget == self.startButton and self.startButton.get_active()):
|
||||||
self.startButton.set_active(True)
|
self.startButton.set_active(True)
|
||||||
return
|
|
||||||
|
|
||||||
if widget == self.startButton and self.startButton.get_active():
|
|
||||||
# - Does the lock acquisition need to be more sophisticated for multiple dirs?
|
# - Does the lock acquisition need to be more sophisticated for multiple dirs?
|
||||||
# (see comment above about what to do if pipe already open)
|
# (see comment above about what to do if pipe already open)
|
||||||
# - Ideally we want to release the lock if the auto-import is killed by some
|
# - Ideally we want to release the lock if the auto-import is killed by some
|
||||||
# kind of exception - is this possible?
|
# kind of exception - is this possible?
|
||||||
if self.settings['global_lock'].acquire(False, source="AutoImport"): # returns false immediately if lock not acquired
|
if self.settings['global_lock'].acquire(wait=False, source="AutoImport"): # returns false immediately if lock not acquired
|
||||||
self.addText(_("\nGlobal lock taken ... Auto Import Started.\n"))
|
self.addText(_("\nGlobal lock taken ... Auto Import Started.\n"))
|
||||||
self.doAutoImportBool = True
|
self.doAutoImportBool = True
|
||||||
self.startButton.set_label(_(u' _Stop Auto Import '))
|
self.startButton.set_label(_(u' _Stop Auto Import '))
|
||||||
|
|
|
@ -75,7 +75,7 @@ try:
|
||||||
pygtk.require('2.0')
|
pygtk.require('2.0')
|
||||||
import gtk
|
import gtk
|
||||||
import pango
|
import pango
|
||||||
except:
|
except ImportError:
|
||||||
print _("Unable to load PyGTK modules required for GUI. Please install PyCairo, PyGObject, and PyGTK from www.pygtk.org.")
|
print _("Unable to load PyGTK modules required for GUI. Please install PyCairo, PyGObject, and PyGTK from www.pygtk.org.")
|
||||||
raw_input(_("Press ENTER to continue."))
|
raw_input(_("Press ENTER to continue."))
|
||||||
exit()
|
exit()
|
||||||
|
@ -86,18 +86,18 @@ import interlocks
|
||||||
try:
|
try:
|
||||||
import matplotlib
|
import matplotlib
|
||||||
matplotlib_version = matplotlib.__version__
|
matplotlib_version = matplotlib.__version__
|
||||||
except:
|
except ImportError:
|
||||||
matplotlib_version = 'not found'
|
matplotlib_version = 'not found'
|
||||||
try:
|
try:
|
||||||
import numpy
|
import numpy
|
||||||
numpy_version = numpy.__version__
|
numpy_version = numpy.__version__
|
||||||
except:
|
except ImportError:
|
||||||
numpy_version = 'not found'
|
numpy_version = 'not found'
|
||||||
try:
|
try:
|
||||||
import sqlite3
|
import sqlite3
|
||||||
sqlite3_version = sqlite3.version
|
sqlite3_version = sqlite3.version
|
||||||
sqlite_version = sqlite3.sqlite_version
|
sqlite_version = sqlite3.sqlite_version
|
||||||
except:
|
except ImportError:
|
||||||
sqlite3_version = 'not found'
|
sqlite3_version = 'not found'
|
||||||
sqlite_version = 'not found'
|
sqlite_version = 'not found'
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ class fpdb:
|
||||||
gtk.Button.set_relief(button, gtk.RELIEF_NONE)
|
gtk.Button.set_relief(button, gtk.RELIEF_NONE)
|
||||||
settings = gtk.Widget.get_settings(button);
|
settings = gtk.Widget.get_settings(button);
|
||||||
(w,h) = gtk.icon_size_lookup_for_settings(settings, gtk.ICON_SIZE_SMALL_TOOLBAR);
|
(w,h) = gtk.icon_size_lookup_for_settings(settings, gtk.ICON_SIZE_SMALL_TOOLBAR);
|
||||||
gtk.Widget.set_size_request (button, w + 4, h + 4);
|
gtk.Widget.set_size_request(button, w + 4, h + 4);
|
||||||
image.show()
|
image.show()
|
||||||
iconBox.pack_start(image, True, False, 0)
|
iconBox.pack_start(image, True, False, 0)
|
||||||
button.add(iconBox)
|
button.add(iconBox)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user