예제 #1
0
 def __init__(self, application):
     """
     Initialize
     """
     self.application = application
     self.config      = application.config
     self.root        = PackageRedirectPage(self)   
     self.editor      = EditorPage(self.root)
     self.preferences = PreferencesPage(self.root)
     self.about       = AboutPage(self.root)
 def __init__(self, application):
     """
     Initialize
     """
     self.application = application
     self.config = application.config
     self.tempWebDir = application.tempWebDir
     self.root = PackageRedirectPage(self)
     self.editor = EditorPage(self.root)
     self.preferences = PreferencesPage(self.root)
     self.about = AboutPage(self.root)
예제 #3
0
 def __init__(self, application, packagePath=None):
     """
     Initialize
     """
     self.application = application
     self.config = application.config
     self.tempWebDir = application.tempWebDir
     self.root = PackageRedirectPage(self, packagePath)
     self.editor = EditorPage(self.root)
     self.stylemanager = StyleManagerPage(self.root)
     self.preferences = PreferencesPage(self.root)
     self.xliffexportpreferences = XliffExportPreferencesPage(self.root)
     self.xliffimportpreferences = XliffImportPreferencesPage(self.root)
     self.dirtree = DirTreePage(self.root)
     self.about = AboutPage(self.root)
     self.quit = QuitPage(self.root)
     self.iecmwaring = IECMWarningPage(self.root)
     self.monitoring = False
예제 #4
0
 def __init__(self, application, packagePath=None):
     """
     Initialize
     """
     self.application = application
     self.config = application.config
     self.tempWebDir = application.tempWebDir
     self.root = PackageRedirectPage(self, packagePath)
     self.editor = EditorPage(self.root)
     self.stylemanager = StyleManagerPage(self.root)
     self.preferences = PreferencesPage(self.root)
     self.xliffimportpreferences = XliffImportPreferencesPage(self.root)
     self.dirtree = DirTreePage(self.root)
     self.about = AboutPage(self.root)
     self.releasenotes = ReleaseNotesPage(self.root)
     self.styledesigner = StyleDesigner(self.root)
     # jrf - legal notes
     self.legal = LegalPage(self.root)
     self.quit = QuitPage(self.root)
     self.iecmwaring = IECMWarningPage(self.root)
     self.oauth = OauthPage(self.root)
     self.monitoring = False
예제 #5
0
class WebServer:
    """
    Encapsulates some twisted components to serve
    all webpages, scripts and nevow functionality
    """
    def __init__(self, application):
        """
        Initialize
        """
        self.application = application
        self.config      = application.config
        self.root        = PackageRedirectPage(self)   
        self.editor      = EditorPage(self.root)
        self.preferences = PreferencesPage(self.root)
        self.about       = AboutPage(self.root)
    def run(self):
        """
        Start serving webpages from the local web server
        """
        log.debug("start web server running")
        webDir = self.config.webDir
        self.root.putChild("images",      static.File(webDir+"/images"))
        self.root.putChild("css",         static.File(webDir+"/css"))   
        self.root.putChild("scripts",     static.File(webDir+"/scripts"))
        self.root.putChild("style",       static.File(webDir+"/style"))
        self.root.putChild("docs",        static.File(webDir+"/docs"))
        xulDir = self.config.xulDir
        self.root.putChild("xulscripts",  static.File(xulDir+"/scripts"))
        self.root.putChild("xultemplates",  static.File(xulDir+"/templates"))
        self.root.putChild("templates",   static.File(webDir+"/templates"))
        self.root.putChild("editor",      self.editor)
        self.root.putChild("preferences", self.preferences)
        self.root.putChild("about",       self.about)
        try:
            reactor.listenTCP(self.config.port, appserver.NevowSite(self.root),
                              interface="127.0.0.1")
        except CannotListenError, exc:
            log.error("Can't listen on interface 127.0.0.1, port %s: %s" % 
                      (self.config.port, unicode(exc)))
        else:
예제 #6
0
class WebServer:
    """
    Encapsulates some twisted components to serve
    all webpages, scripts and nevow functionality
    """
    def __init__(self, application):
        """
        Initialize
        """
        self.application = application
        self.config      = application.config
        self.root        = PackageRedirectPage(self)   
        self.editor      = EditorPage(self.root)
        self.preferences = PreferencesPage(self.root)
        self.about       = AboutPage(self.root)
    def run(self):
        """
        Start serving webpages from the local web server
        """
        log.debug("start web server running")
        webDir = self.config.webDir
        self.root.putChild("images",      static.File(webDir+"/images"))
        self.root.putChild("css",         static.File(webDir+"/css"))   
        self.root.putChild("scripts",     static.File(webDir+"/scripts"))
        self.root.putChild("style",       static.File(webDir+"/style"))
        self.root.putChild("docs",        static.File(webDir+"/docs"))
        xulDir = self.config.xulDir
        self.root.putChild("xulscripts",  static.File(xulDir+"/scripts"))
        self.root.putChild("xultemplates",  static.File(xulDir+"/templates"))
        self.root.putChild("templates",   static.File(webDir+"/templates"))
        self.root.putChild("editor",      self.editor)
        self.root.putChild("preferences", self.preferences)
        self.root.putChild("about",       self.about)
        verbose_port_search = 0
        port_test_done = 0
        found_port = 0
        test_port_num = self.config.port
        test_port_count = 0
        max_port_tests = 5000
        while not port_test_done:
            test_port_num = self.config.port + test_port_count
            try:
                if verbose_port_search:
                    print "trying to listenTCP on port# ", test_port_num
                reactor.listenTCP(test_port_num, appserver.NevowSite(self.root),
                                  interface="127.0.0.1")
                if verbose_port_search:
                    print "still here after listenTCP on port# ", test_port_num
                found_port = 1
                port_test_done = 1
            except CannotListenError, exc:
                if verbose_port_search:
                    print "caught exception after listenTCP on port# ", test_port_num
                last_exception = exc
                test_port_count += 1
                if test_port_count >= max_port_tests:
                    port_test_done = 1
        if found_port:
            self.config.port = test_port_num
            if verbose_port_search:
                print "found available eXe port# ", self.config.port
            reactor.run()
        else:
            print "Sorry, unable to find an available port in the range of: ", self.config.port, " - ", test_port_num
            print "last exception: ", unicode(last_exception)
            log.error("Can't listen on interface 127.0.0.1, ports %s-%s, last exception: %s" % 
                          (self.config.port, test_port_num, unicode(last_exception)))