예제 #1
0
 def _execute(self, command, wait=False, extra_env={}):
     env = os.environ.copy()
     env['bbv_ip']=str(globaldata.ADDRESS())
     env['bbv_port']=str(globaldata.PORT())
     env.update(extra_env)
     
     po = subprocess.Popen(command.encode('utf-8'), stdin=None, stdout=subprocess.PIPE, shell=True, env=env)
     if wait:
         return po.communicate()
     return ('','')
예제 #2
0
    def run(self):
        """ Run the webserver """
        ip = globaldata.ADDRESS()
        port = globaldata.PORT()
        sys.argv = [sys.argv[0], '']
        sys.argv[1] = ':'.join((ip, str(port)))

        urls = self.get_urls()
        classes = self.get_classes()
        self.app = web.application(urls, classes)
        self.app.run()
예제 #3
0
 def run(self, server=True):
     if server:
         run_server()
     self.window.set_size(self.width,self.height)
     self.window.show(self.window_state)
     if self.url.find('://') == -1:
         if not self.url.startswith('/'):
             self.url = '/'+self.url
         self.url = "http://%s:%s%s" %(globaldata.ADDRESS(),globaldata.PORT(),self.url)
     self.window.load_url(self.url)
     globaldata.ICON = self.icon
     sys.exit(self.window.run())
예제 #4
0
    def run(self, start_server=True):
        server = run_server() if start_server else None

        if self.url.find('://') == -1:
            if not self.url.startswith('/'):
                self.url = '/'+self.url
            self.url = "http://%s:%s%s" % (globaldata.ADDRESS(),
                                           globaldata.PORT(), self.url)
        self.window.load_url(self.url)
        self.window.set_size(self.width, self.height, self.window_state)
        self.window.style(self.black)
        self.window.show(self.window_state)
        globaldata.ICON = self.icon
        self.window.run()
        if server:
            server.stop()