def test(): """ This function will create only local settings which will disappear after it terminates """ s = _settings.settings() print s.get("JSON", "Unparse tab width") assert s.has_key("JSON", "Unparse tab width") assert s.get("JSON", "Unparse tab width") == 4 s.set("JSON", "Unparse tab width", "HTML") assert s.get("JSON", "Unparse tab width") == "HTML"
# Start the QApplication. Not sure why it has to be done this way. import PyQt4.QtCore as _qtc import PyQt4.Qt as _qt # make sure we have a valid qt application for dialogs etc... _qtapp = _qtc.QCoreApplication.instance() if not _qtapp: _qtapp = _qt.QApplication(_os.sys.argv) #_qtapp = _qt.qApp #if _qtapp == None: # print "Creating QApplication" # _qtapp = _qt.QApplication(_os.sys.argv) import _settings settings = _settings.settings() # some defaults _mpl.rcParams['figure.facecolor']='w' import _plot as plot ; plot._settings = settings import _data as data ; data._settings = settings import _dialogs as dialogs ; dialogs._settings = settings import _pylab_tweaks as tweaks ; tweaks._settings = settings import _functions as fun ; fun._settings = settings plot.tweaks._pylab_colormap._settings = settings instaprint = tweaks.instaprint
import PyQt4.QtGui as _qt import PyQt4.QtCore as _qtcore from functools import partial as _partial import _pylab_tweaks # make sure we have an application if __name__ == '__main__': _qtapp = _qtcore.QCoreApplication.instance() if not _qtapp: print "_pylab_colormap.py: Creating QApplication" _qtapp = _qt.QApplication(_os.sys.argv) import _settings _settings = _settings.settings() class colormap(): # Each element of the list contains the position on the colorbar, # and the bottom/top colors _colorpoint_list = [[0.0, [1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [0.5, [0.0, 0.0, 1.0], [0.0, 0.0, 1.0]], [1.0, [1.0, 0.0, 0.0], [1.0, 0.0, 0.0]] ] # name of the colormap _name = "Last Used" # pylab image object _image=None