def __init__(self, mainSocketPort): BetterResource.__init__(self) self.putChild('DisplayConnections', DisplayConnections()) self.putChild('SimpleResponse', SimpleResponse()) self.putChild('UnicodeRainbow', UnicodeRainbow()) self.putChild('NoOriginHeader', NoOriginHeader()) self.putChild('GetEndpointInfo', GetEndpointInfo(mainSocketPort))
def __init__(self, fileCache, mainSocketPort, domain, responseCacheOptions): BetterResource.__init__(self) self.putChild( "", MinervaBootstrap( fileCache, self.templateFile, dict(domain=domain, mainSocketPort=mainSocketPort, **self.dictionary) ), )
def __init__(self, mainSocketPort): import jinja2 BetterResource.__init__(self) self._mainSocketPort = mainSocketPort self._jinja2Env = jinja2.Environment() self._basePath = FilePath(__file__).parent() # this is minerva/dumbtest/ self._fileName = 'dumbtest.html'
def __init__(self, fileCache, templateFile, dictionary): """ C{fileCache} is a L{webmagic.filecache.FileCache}. C{templateFile} is a L{FilePath} representing the jinja2 template to use. The latest file contents are cached forever, even if you delete your references to the L{MinervaBootstrap}. C{dictionary} is a C{dict} whose keys are passed to the template. If this is mutated, new requests will have the new dictionary contents. """ BetterResource.__init__(self) self._fileCache = fileCache self._templateFile = templateFile self._dictionary = dictionary
def __init__(self, webPort, fileCache, mainSocketPort, domain, closureLibrary): import coreweb import minerva import demosminerva import js_coreweb import js_minerva import js_demosminerva BetterResource.__init__(self) # Cache for just two days so that corrupt cached copies don't break # users for a long time. responseCacheOptions = ResponseCacheOptions( cacheTime=60*60*24*2, httpCachePublic=False, httpsCachePublic=True) minervaPath = FilePath(minerva.__path__[0]) demosminervaPath = FilePath(demosminerva.__path__[0]) self.putChild('', BetterFile(demosminervaPath.child('index.html').path)) self.putChild('closure-library', BetterFile(closureLibrary.path)) self.putChild('js_coreweb', BetterFile(FilePath(js_coreweb.__file__).parent().path)) self.putChild('js_minerva', BetterFile(FilePath(js_minerva.__file__).parent().path)) self.putChild('js_demosminerva', BetterFile(FilePath(js_demosminerva.__file__).parent().path)) self.putChild('compiled_client', BetterFile( minervaPath.child('compiled_client').path, responseCacheOptions=responseCacheOptions)) # testres_Coreweb always needed for running tests. testres_Coreweb = FilePath(coreweb.__path__[0]).child('testres').path self.putChild('@testres_Coreweb', BetterFile(testres_Coreweb)) self.putChild('demosminerva_static', BetterFile( FilePath(__file__).sibling('static').path, fileCache=fileCache, rewriteCss=True, responseCacheOptions=responseCacheOptions)) self.putChild('goog-images', BetterFile( FilePath(googstyle.__file__).sibling('goog-images').path, responseCacheOptions=responseCacheOptions)) self.putChild('_minerva', webPort) commonArgs = (fileCache, mainSocketPort, domain, responseCacheOptions) self.putChild('whiteboard', WhiteboardResource(*commonArgs)) self.putChild('whiteboard_dev', WhiteboardDevResource(*commonArgs)) self.putChild('livejournal-stream', LjStreamResource(*commonArgs)) self.putChild('livejournal-stream_dev', LjStreamDevResource(*commonArgs))
def __init__(self, reactor, webPort, fileCache, mainSocketPort, domain, closureLibrary): import coreweb import minerva import js_minerva import js_coreweb BetterResource.__init__(self) self._reactor = reactor minervaPath = FilePath(minerva.__path__[0]) self.putChild('', BetterFile(minervaPath.child('index.html').path)) self.putChild('closure-library', BetterFile(closureLibrary.path)) self.putChild('js_coreweb', BetterFile(FilePath(js_coreweb.__file__).parent().path)) self.putChild('js_minerva', BetterFile(FilePath(js_minerva.__file__).parent().path)) self.putChild('compiled_client', BetterFile(minervaPath.child('compiled_client').path)) # testres_Coreweb always needed for running tests. testres_Coreweb = FilePath(coreweb.__path__[0]).child('testres').path self.putChild('@testres_Coreweb', BetterFile(testres_Coreweb)) testres_Minerva = ResourcesForTest(mainSocketPort) self.putChild('@testres_Minerva', testres_Minerva) # Also used by tests self.putChild('_minerva', webPort) self.putChild('js_minerva_tests.html', BetterFile( minervaPath.child('js_minerva_tests.html').path)) self.putChild('dumbtest', DumbTestPage(mainSocketPort)) self.putChild('chatapp', ChatAppPage(fileCache, domain, mainSocketPort)) # Used by chatapp self.putChild('wait_resource', WaitResource(clock=reactor)) # The docs are outside of the minerva package docsDir = FilePath(__file__).parent().sibling('docs') if docsDir.exists(): self.putChild('docs', BetterFile(docsDir.path)) self.putChild('form_sandbox', FormSandbox(self._reactor))
def __init__(self, webPort, fileCache, mainSocketPort, domain, closureLibrary): BetterResource.__init__(self)
def __init__( self, webPort, fileCache, mainSocketPort, domain, closureLibrary ): BetterResource.__init__(self)
def __init__(self, fileCache, domain, mainSocketPort): BetterResource.__init__(self) templateFile = FilePath(__file__).sibling('chatapp.html') self.putChild('', MinervaBootstrap(fileCache, templateFile, dict(domain=domain, dev_mode=True, mainSocketPort=mainSocketPort)))
def __init__(self): BetterResource.__init__(self) index = NonLeafWithIndexChild() self.putChild('', index)
def __init__(self): BetterResource.__init__(self) index = Leaf() self.putChild('', index)
def __init__(self): BetterResource.__init__(self) child = Leaf() self.putChild('child', child)
def __init__(self, mainSocketPort): BetterResource.__init__(self) self._mainSocketPort = mainSocketPort
def __init__(self, reactor): BetterResource.__init__(self) self._reactor = reactor
def __init__(self, mainSocketPort): BetterResource.__init__(self) self.putChild('', Index(mainSocketPort)) self.putChild('app.swf', static.File(FilePath(__file__).sibling('app.swf').path))