[traits] colors from standard_colors with WX/Qt...

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[traits] colors from standard_colors with WX/Qt...

fred-2
Hi all,

I import standard_colors in my app, but standard_colors depends on
backend used.

Is it possible to write the following easier, ie without test on backend?

from enthought.etsconfig.api \
      import ETSConfig
if ('--wx_toolkit' in argv):
     ETSConfig.toolkit = 'wx'
     from enthought.traits.ui.wx.color_trait \
          import standard_colors
elif ('--qt_toolkit' in argv):
     ETSConfig.toolkit = 'qt4'
     from enthought.traits.ui.qt4.color_trait \
          import standard_colors
else: # default backend is wx
     from enthought.traits.ui.wx.color_trait \
          import standard_colors


TIA.


Cheers,

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev