Exemplo n.º 1
0
Arquivo: ui.py Projeto: halbbob/dff
 def cmd(self, command, wait=False):
   try :
    self.c.onecmd(command)
   except AttributeError:
    loader().do_load(self.modPath)
    self.c = console(DEBUG = self.debug, VERBOSITY = self.verbosity)
    self.c.onecmd(command, wait)
Exemplo n.º 2
0
    def setUp(self):
        """ Initialize framework
        Load modules
        Load console without loop
        Redirect stdout and stderr to readable fileobjects
        """
        if not self.debugTest:
            sys.stdout = StringIO()
            sys.stderr = StringIO()

            self._hook_streams(sys.__stdout__.fileno(), sys.__stderr__.fileno())

        self.ui = ui('console')
        loader().do_load(sys.path[0] + '/modules/')
        self.ui.c = console()
        
        self.tm = TaskManager()
        self.vfs = vfs.vfs()

        if not self.debugTest:
            self._restore_streams()
            # Close and re '.. = StringIO()' to drop output from modules loader

# FIXME [...] sys.stderr.close() [...] AttributeError: __RedirectIO instance has no attribute 'close'
            try:
                sys.stdout.close()
            except AttributeError:
                del sys.stdout
            try:
                sys.stderr.close()
            except AttributeError:
                del sys.stderr
          
            sys.stdout = StringIO()
            sys.stderr = StringIO()
Exemplo n.º 3
0
 def cmd(self, command):
   try :
    self.c.onecmd(command) 
   except AttributeError:
    loader().do_load(self.modPath)
    self.c = console()
    self.c.onecmd(command) 
Exemplo n.º 4
0
    def setUp(self):
        """ Initialize framework
        Load modules
        Load console without loop
        Redirect stdout and stderr to readable fileobjects
        """
        if not self.debugTest:
            sys.stdout = StringIO()
            sys.stderr = StringIO()

            self._hook_streams(sys.__stdout__.fileno(), sys.__stderr__.fileno())

        self.ui = ui('console')
        loader().do_load(sys.path[0] + '/modules/')
        self.ui.c = console()
        
        self.tm = TaskManager()
        self.vfs = vfs.vfs()

        if not self.debugTest:
            self._restore_streams()
            # Close and re '.. = StringIO()' to drop output from modules loader

# FIXME [...] sys.stderr.close() [...] AttributeError: __RedirectIO instance has no attribute 'close'
            try:
                sys.stdout.close()
            except AttributeError:
                del sys.stdout
            try:
                sys.stderr.close()
            except AttributeError:
                del sys.stderr
          
            sys.stdout = StringIO()
            sys.stderr = StringIO()
Exemplo n.º 5
0
 def launch(self):
  if self.type == "gui":
    self.g = gui()
    self.g.launch(self.modPath)
  if self.type == "console":
    try :
     self.c.cmdloop()
    except AttributeError:
      loader().do_load(self.modPath)
      self.c = console()
      self.c.cmdloop()
Exemplo n.º 6
0
Arquivo: ui.py Projeto: halbbob/dff
 def launch(self):
  if self.type == "gui":
    self.g = gui(self.debug)
    try:
      self.c
      self.g.launch()
    except AttributeError:
      self.g.launch(self.modPath)
  if self.type == "console":
    try :
     self.c.cmdloop()
    except AttributeError:
      loader().do_load(self.modPath)
      self.c = console(DEBUG = self.debug, VERBOSITY = self.verbosity)
      self.c.cmdloop()
Exemplo n.º 7
0
Arquivo: menu.py Projeto: halbbob/dff
    def __init__(self, parent, mainWindow, tags, selectItem = None):
        QMenu.__init__(self, tags,  parent)
	self.tags = tags
        self.__mainWindow = mainWindow
        self.callbackSelected = selectItem
        self.loader = loader.loader()
        self.Load()
Exemplo n.º 8
0
  def __init__(self, parent):
    super(QWidget, self).__init__()
    EventHandler.__init__(self)
    self.setupUi(self)

    self.mainwindow = parent

    self.getWindowGeometry()

    self.name = self.windowTitle()
    self.type = "filebrowser"
    self.setObjectName(self.name)

    self.vfs = vfs.vfs()
    self.VFS = VFS.Get()
    self.VFS.connection(self)
    self.loader = loader.loader()
    self.lmodules = self.loader.modules
    self.taskmanager = TaskManager()

    self.parent = parent
    self.icon = None

    self.createSubMenu()
    self.createLayout()
    self.addModel("/")

    self.addNodeLinkTreeView()
    self.addNodeView()

    self.addOptionsView()
Exemplo n.º 9
0
    def __init__(self, console, DEBUG = False, VERBOSITY = 0):
        self.DEBUG = DEBUG
        self.VERBOSITY = VERBOSITY
	self.console = console
        self.lp = LineParser(self.DEBUG, self.VERBOSITY - 1)
        self.confmanager = ConfigManager.Get()
        self.loader = loader()
        self.vfs = vfs()
Exemplo n.º 10
0
    def launch(self, modPath):
        self.splash.show()
        self.loader = loader()
        self.loader.do_load(modPath, self.splash.showMessage)
        mainWindow = DFF_MainWindow(self.app)
        mainWindow.show()

        self.splash.finish(mainWindow)
        sys.exit(self.app.exec_())
Exemplo n.º 11
0
Arquivo: menu.py Projeto: halbbob/dff
 def __init__(self, parent, mainWindow, node = None, selectItem = None):
      QMenu.__init__(self, mainWindow)
      self.loader = loader.loader()
      self.callbackSelected = self.selectNode
      self.parent = parent
      self.mainWindow = mainWindow
      self.node = node
      self.Load()
      actions = []
Exemplo n.º 12
0
 def __init__(self, IOout=None):
     self.oldstdout = sys.__stdout__
     self.oldstderr = sys.__stderr__
     self.lparent = []
     self.ioOut = IOout
     self.tm = TaskManager()
     self.loader = loader.loader()
     sys.stdout = RedirectWrite(self, 'out')
     sys.stderr = RedirectWrite(self, 'err')
     self.write = sys.stdout.write
Exemplo n.º 13
0
Arquivo: gui.py Projeto: halbbob/dff
    def launch(self, modPath = None):
        self.splash.show()
        if modPath:
          self.loader = loader()
          self.loader.do_load(modPath, self.splash.showMessage)
        mainWindow = MainWindow(self.app, self.debug)
        mainWindow.show()

        self.splash.finish(mainWindow)
        sys.exit(self.app.exec_())
Exemplo n.º 14
0
 def __init__(self, IOout = None):
   self.oldstdout = sys.__stdout__
   self.oldstderr = sys.__stderr__
   self.lparent = []
   self.ioOut = IOout
   self.tm = TaskManager()
   self.loader = loader.loader()
   sys.stdout = RedirectWrite(self, 'out')
   sys.stderr = RedirectWrite(self, 'err')
   self.write = sys.stdout.write      
Exemplo n.º 15
0
    def __init__(self, parent):
        super(QStackedWidget, self).__init__()
        self.__mainWindow = parent        
        self.name = self.tr("Preview")
        self.loader = loader()
	self.lmodules = self.loader.modules
	void = QWidget()
	self.previousWidget = void 
	self.addWidget(void)
        self.setWindowIcon(QIcon(QPixmap(":viewer.png")))
        self.retranslateUi(self) 
        self.previousNode = None       
	self.mustUpdate = True
Exemplo n.º 16
0
  def __init__(self, parent):
    super(QWidget, self).__init__()
    EventHandler.__init__(self)
    self.setupUi(self)

    self.mainwindow = parent.parent.parent.parent
    self.model = ListNodeModel(self)
    self.name = self.windowTitle()
    self.type = "filebrowser"
    self.setObjectName(self.name)

    self.vfs = vfs.vfs()
    self.VFS = VFS.Get()
    self.loader = loader.loader()
    self.lmodules = self.loader.modules
    self.taskmanager = TaskManager()

    self.parent = parent
    self.icon = None

    self.createSubMenu()
    self.createLayout()