Example #1
0
    def _handleStopServer(self):
        if not self._serverThread:
            self.mainWindow.updateStatusBar(u'ERROR: Server is not currently active')
            print 'NO ACTIVE SERVER THREAD'
            return

        if not NGinxRunOps.isRunning():
            self.mainWindow.updateStatusBar(u'ERROR: No active NGinx server found')
            print 'NOT RUNNING'
            return

        NGinxRunOps.stopServer(self._serverThread.rootPath)
        self._serverThread = None
        self._updateDisplay()
Example #2
0
    def _handleStopServer(self):
        if not self._serverThread:
            self.mainWindow.updateStatusBar(
                u'ERROR: Server is not currently active')
            print 'NO ACTIVE SERVER THREAD'
            return

        if not NGinxRunOps.isRunning():
            self.mainWindow.updateStatusBar(
                u'ERROR: No active NGinx server found')
            print 'NOT RUNNING'
            return

        NGinxRunOps.stopServer(self._serverThread.rootPath)
        self._serverThread = None
        self._updateDisplay()
Example #3
0
    def _handleStartServer(self):
        if not NGinxSetupOps.commandExists():
            self.mainWindow.updateStatusBar(
                u'ERROR: No NGinx command available')
            print 'NO COMMAND'
            return

        if NGinxRunOps.isRunning():
            self.mainWindow.updateStatusBar(
                u'ERROR: An NGinx process is already active')
            print 'ALREADY RUNNING'
            return

        path = self.rootPath
        self.mainWindow.appConfig.set(AppConfigEnum.ROOT_PATH, path)
        recentPaths = self.mainWindow.appConfig.get(AppConfigEnum.RECENT_PATHS,
                                                    [])
        ListUtils.addIfMissing(path,
                               recentPaths,
                               reorder=True,
                               frontOrdering=True)
        self.mainWindow.appConfig.set(AppConfigEnum.RECENT_PATHS, recentPaths)

        thread = NGinxRemoteThread(self, rootPath=path)
        self._serverThread = thread
        thread.start()
        self.mainWindow.updateStatusBar(u'NGinx server now active')
        self._updateDisplay()
Example #4
0
    def _handleStartServer(self):
        if not NGinxSetupOps.commandExists():
            self.mainWindow.updateStatusBar(u'ERROR: No NGinx command available')
            print 'NO COMMAND'
            return

        if NGinxRunOps.isRunning():
            self.mainWindow.updateStatusBar(u'ERROR: An NGinx process is already active')
            print 'ALREADY RUNNING'
            return

        path = self.rootPath
        self.mainWindow.appConfig.set(AppConfigEnum.ROOT_PATH, path)
        recentPaths = self.mainWindow.appConfig.get(
            AppConfigEnum.RECENT_PATHS, []
        )
        ListUtils.addIfMissing(path, recentPaths, reorder=True, frontOrdering=True)
        self.mainWindow.appConfig.set(AppConfigEnum.RECENT_PATHS, recentPaths)

        thread = NGinxRemoteThread(self, rootPath=path)
        self._serverThread = thread
        thread.start()
        self.mainWindow.updateStatusBar(u'NGinx server now active')
        self._updateDisplay()
Example #5
0
 def _handleReloadServer(self):
     if not NGinxRunOps.isRunning() or not self._serverThread:
         return
     NGinxRunOps.reloadServer(self._serverThread.rootPath)
     self._updateDisplay()
Example #6
0
 def stopActiveServer(self):
     if not NGinxRunOps.isRunning() or self._serverThread is None:
         return
     NGinxRunOps.stopServer(self._serverThread.rootPath)
 def _runImpl(self):
     """Doc..."""
     self._output = NGinxRunOps.startServer(self._path)
     return self._output['code']
Example #8
0
 def _handleReloadServer(self):
     if not NGinxRunOps.isRunning() or not self._serverThread:
         return
     NGinxRunOps.reloadServer(self._serverThread.rootPath)
     self._updateDisplay()
Example #9
0
 def stopActiveServer(self):
     if not NGinxRunOps.isRunning() or self._serverThread is None:
         return
     NGinxRunOps.stopServer(self._serverThread.rootPath)