示例#1
0
 def __init__(self, args):
     qt.QtGui.QApplication.__init__(self, args)
     # -- redirect stdout to null if pythonw --
     set_stdout()
     # -- reconfigure LoggerOffice to use Qt log handler and a file handler --
     logger.default_init(level=logger.DEBUG, handlers=["qt"]) #TODO get level from settings
     logger.connect_loggers_to_handlers(logger.get_logger_names(), logger.get_handler_names())
     if __debug__:
         logger.set_global_logger_level(logger.DEBUG)
     else:
         logger.set_global_logger_level(logger.DEBUG)
     # -- show the splash screen --
     self.splash = show_splash_screen()
     # -- main window --
     self.win = MainWindow(None)
     self.win.setEnabled(False)
     self.win.show()
     self.win.raise_()
     self.sessionStarted.connect(self.win.on_session_started)
     # -- start session in a thread --
     if MULTITHREAD:
         self.sessionth = threadit(timeit, self, self.__cb_session_thread_end, Session)
     else:
         session = Session()
         self.splash.finish(self.win)
         self.win.setEnabled(True)
         self.sessionStarted.emit(session)
示例#2
0
 def __init__(self, parent=None):
     # -- reconfigure LoggerOffice to use Qt log handler and a file handler --
     logger.default_init(level=logger.DEBUG, handlers=["qt"]) #TODO get level from settings
     logger.connect_loggers_to_handlers(logger.get_logger_names(), logger.get_handler_names())
     model = logger.LoggerOffice().get_handler("qt")
     super(Logger, self).__init__(parent=parent, model=model)
     self.setAccessibleName("Logger")
示例#3
0
 def __init__(self, args):
     qt.QtGui.QApplication.__init__(self, args)
     # -- redirect stdout to null if pythonw --
     set_stdout()
     # -- reconfigure LoggerOffice to use Qt log handler and a file handler --
     logger.default_init(level=logger.DEBUG,
                         handlers=["qt"])  #TODO get level from settings
     logger.connect_loggers_to_handlers(logger.get_logger_names(),
                                        logger.get_handler_names())
     if __debug__:
         logger.set_global_logger_level(logger.DEBUG)
     else:
         logger.set_global_logger_level(logger.DEBUG)
     # -- show the splash screen --
     self.splash = show_splash_screen()
     # -- main window --
     self.win = MainWindow(None)
     self.win.setEnabled(False)
     self.win.show()
     self.win.raise_()
     self.sessionStarted.connect(self.win.on_session_started)
     # -- start session in a thread --
     if MULTITHREAD:
         self.sessionth = threadit(timeit, self,
                                   self.__cb_session_thread_end, Session)
     else:
         session = Session()
         self.splash.finish(self.win)
         self.win.setEnabled(True)
         self.sessionStarted.emit(session)
示例#4
0
 def __init__(self, parent=None):
     # -- reconfigure LoggerOffice to use Qt log handler and a file handler --
     logger.default_init(level=logger.DEBUG,
                         handlers=["qt"])  #TODO get level from settings
     logger.connect_loggers_to_handlers(logger.get_logger_names(),
                                        logger.get_handler_names())
     model = logger.LoggerOffice().get_handler("qt")
     super(Logger, self).__init__(parent=parent, model=model)
     self.setAccessibleName("Logger")
示例#5
0
        def __init__(self, argv):
            QtGui.QApplication.__init__(self, argv)
            # -- reconfigure LoggerOffice to use Qt log handler and a file handler --
            logger.default_init(level=logger.DEBUG, handlers=["stream", "qt"]) #TODO get level from settings
            logger.connect_loggers_to_handlers(logger.get_logger_names(), logger.get_handler_names())

            if __debug__:
                logger.set_global_logger_level(logger.ERROR)#DEBUG
            else:
                logger.set_global_logger_level(logger.WARNING)

            # -- status clearout timer --

            self.__statusTimeout = QtCore.QTimer(self)
            self.__statusTimeout.setSingleShot(True)
            self.__statusTimeout.timeout.connect(self.clear_status_message)

            # -- main window --
            self.win = mainwindow.MainWindow(None)
            self.post_status_message("Starting up! Please wait")
            self.win.show()
            self.clear_status_message()
from openalea.plantgl.all import NurbsCurve2D, BezierCurve2D, Polyline2D, NurbsPatch

try:
    logger.DEBUG
except NameError:
    from openalea.core import logger
    logger.default_init(level=logger.DEBUG, handlers=["qt"]) #TODO get level from settings
    logger.connect_loggers_to_handlers(logger.get_logger_names(), logger.get_handler_names())

class RedNurbs2D(NurbsCurve2D):
    def __init__(self, ctrlPoint, typename=""):
        super(RedNurbs2D, self).__init__(ctrlPoint)
        self.typename = typename
        
    def __reduce__(self):
        return (RedNurbs2D, (self.ctrlPointList, self.typename,))
        
class RedBezierNurbs2D(BezierCurve2D):
    def __init__(self, ctrlPoint, typename=""):
        super(RedBezierNurbs2D, self).__init__(ctrlPoint)
        self.typename = typename
        
    def __reduce__(self):
        return (RedBezierNurbs2D, (self.ctrlPointList, self.typename,))
        
class RedPolyline2D(Polyline2D):
    def __init__(self, ctrlPoint, typename=""):
        super(RedPolyline2D, self).__init__(ctrlPoint)
        self.typename = typename
        
    def __reduce__(self):
示例#7
0
from openalea.plantgl.all import NurbsCurve2D, BezierCurve2D, Polyline2D, NurbsPatch

try:
    logger.DEBUG
except NameError:
    from openalea.core import logger
    logger.default_init(level=logger.DEBUG,
                        handlers=["qt"])  #TODO get level from settings
    logger.connect_loggers_to_handlers(logger.get_logger_names(),
                                       logger.get_handler_names())


class RedNurbs2D(NurbsCurve2D):
    def __init__(self, ctrlPoint, typename=""):
        super(RedNurbs2D, self).__init__(ctrlPoint)
        self.typename = typename

    def __reduce__(self):
        return (RedNurbs2D, (
            self.ctrlPointList,
            self.typename,
        ))


class RedBezierNurbs2D(BezierCurve2D):
    def __init__(self, ctrlPoint, typename=""):
        super(RedBezierNurbs2D, self).__init__(ctrlPoint)
        self.typename = typename

    def __reduce__(self):
        return (RedBezierNurbs2D, (