Skip to content

Commit

Permalink
Add example twisted.cfg buildout configuration and cone.tac t…
Browse files Browse the repository at this point in the history
…wisted configuration file for running cone with twisted WSGI.
  • Loading branch information
rnixx committed Aug 2, 2014
1 parent 6f7a7a8 commit 2a68eca
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,6 +5,7 @@
/.pydevproject
/.pydevproject.bak
/.settings/
/twistd.pid
/src/cone.app.egg-info/
/bin/
/env/
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Expand Up @@ -73,6 +73,10 @@ Changes
1.0.dev0 (unreleased)
---------------------

- Add example ``twisted.cfg`` buildout configuration and ``cone.tac`` twisted
configuration file for running cone with twisted WSGI.
[rnix, 2014-08-02]

- Adopt ``IWorkflowState`` interface. Workflow name is now set directly
on node. Optional a trnaslation string factory can be set for workflow
state and transision translations.
Expand Down
9 changes: 1 addition & 8 deletions buildout.cfg → base.cfg
@@ -1,6 +1,5 @@
[buildout]
parts =
instance
test
coverage
pydev
Expand Down Expand Up @@ -34,12 +33,6 @@ yafowil.bootstrap = git git@github.com:bluedynamics/yafowil.bootstrap.git
cone.tile = git git@github.com:bluedynamics/cone.tile.git
bdajax = git git@github.com:bluedynamics/bdajax.git

[instance]
recipe = zc.recipe.egg:scripts
dependent-scripts = true
eggs =
cone.app

[testenv]
TESTRUN_MARKER = True

Expand Down Expand Up @@ -68,7 +61,7 @@ mode = 755

[pydev]
recipe = pb.recipes.pydev
eggs = ${instance:eggs}
eggs = ${test:eggs}

[sphinx]
recipe = collective.recipe.sphinxbuilder
Expand Down
26 changes: 26 additions & 0 deletions cone.tac
@@ -0,0 +1,26 @@
import os
from twisted.web.server import Site
from twisted.web.wsgi import WSGIResource
from twisted.internet import reactor
from twisted.application import (
internet,
service,
)
from pyramid.paster import get_app


config='./cone.ini'
config = os.path.abspath(config)
port = 8081


# Get the WSGI application
myApp = get_app(config, 'main')

# Twisted WSGI server setup
resource = WSGIResource(reactor, reactor.getThreadPool(), myApp)
factory = Site(resource)

# Twisted Application setup
application = service.Application('cone')
internet.TCPServer(port, factory).setServiceParent(application)
10 changes: 10 additions & 0 deletions paster.cfg
@@ -0,0 +1,10 @@
[buildout]
extends = base.cfg

parts += instance

[instance]
recipe = zc.recipe.egg:scripts
dependent-scripts = true
eggs =
cone.app
25 changes: 25 additions & 0 deletions twisted.cfg
@@ -0,0 +1,25 @@
[buildout]
extends = base.cfg

parts += scripts

[twisted]
recipe = zc.recipe.egg
eggs =
Twisted

[config]
app = cone.app
eggs = cone.app

[scripts]
recipe = minitage.recipe.scripts
interpreter = python

# Add our package source to the python path to allow twisted TAPs to be
# accessible at runtime.
extra-paths = ${buildout:directory}/${config:app}

eggs =
${config:eggs}
${twisted:eggs}

0 comments on commit 2a68eca

Please sign in to comment.