OK... I decided that txtorcon's endpoint constructor should only take string arguments besides the reactor arg... because serverFromString passes only str args to the endpoint constructor.
I wrote the endpoint parser to be as simple as possible. The endpoint's `listen` method now handles the tor configuration and launch logic... and returns a deferred which will fire with an IListenPort. The pip method definitely works... my code works but prints traceback with this error: "Unexpected error while writing cache file" Do you as well? Here's my endpoint parser plugin: https://github.com/david415/txtorcon/blob/endpoint_parser_plugin-rewrite3/twisted/plugins/txtorcon_endpoint_parser.py Here's how I install it: cd ~/projects/virtualenv-1.11.5 ./virtualenv.py ~/virtenv-txtorcon . ~/virtenv-txtorcon/bin/activate usewithtor pip install twisted cd ~/projects git clone https://github.com/david415/txtorcon.git cd txtorcon git checkout endpoint_parser_plugin-rewrite3 python setup.py install Running the example code: cd examples python launch_tor_endpoint.py Unexpected error while writing cache file Traceback (most recent call last): File "/home/human/virtenv-txtorcon/local/lib/python2.7/site-packages/twisted/internet/endpoints.py", line 1465, in serverFromString return _serverFromStringLegacy(reactor, description, _NO_DEFAULT) File "/home/human/virtenv-txtorcon/local/lib/python2.7/site-packages/twisted/internet/endpoints.py", line 1393, in _serverFromStringLegacy nameOrPlugin, args, kw = _parseServer(description, None, default) File "/home/human/virtenv-txtorcon/local/lib/python2.7/site-packages/twisted/internet/endpoints.py", line 1380, in _parseServer for plugin in getPlugins(IStreamServerEndpointStringParser): File "/home/human/virtenv-txtorcon/local/lib/python2.7/site-packages/twisted/plugin.py", line 209, in getPlugins allDropins = getCache(package) --- <exception caught here> --- File "/home/human/virtenv-txtorcon/local/lib/python2.7/site-packages/twisted/plugin.py", line 181, in getCache dropinPath.setContent(pickle.dumps(dropinDotCache)) exceptions.AttributeError: 'ZipPath' object has no attribute 'setContent' I have set up a hidden service, advertised at: <<class 'twisted.internet.tcp.Port'> of twisted.web.server.Site on 55141> http://mqrcnytlnh4xynmh.onion:80 locally listening on IPv4Address(TCP, '127.0.0.1', 55141) and txtorcon's setup.py output: python setup.py install WARNING: not using PyPi over SSH! running install running bdist_egg running egg_info writing requirements to txtorcon.egg-info/requires.txt writing txtorcon.egg-info/PKG-INFO writing top-level names to txtorcon.egg-info/top_level.txt writing dependency_links to txtorcon.egg-info/dependency_links.txt package init file 'twisted/plugins/__init__.py' not found (or not a regular file) reading manifest file 'txtorcon.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'scripts/*.py' warning: no previously-included files found matching 'docs/_static/*~' warning: no previously-included files found matching 'examples/*~' writing manifest file 'txtorcon.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/twisted creating build/bdist.linux-x86_64/egg/twisted/plugins copying build/lib.linux-x86_64-2.7/twisted/plugins/txtorcon_endpoint_parser.py -> build/bdist.linux-x86_64/egg/twisted/plugins creating build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/stream.py -> build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/log.py -> build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/torconfig.py -> build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/router.py -> build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/torcontrolprotocol.py -> build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/circuit.py -> build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/addrmap.py -> build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/interface.py -> build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/spaghetti.py -> build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/torstate.py -> build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/torinfo.py -> build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/__init__.py -> build/bdist.linux-x86_64/egg/txtorcon copying build/lib.linux-x86_64-2.7/txtorcon/util.py -> build/bdist.linux-x86_64/egg/txtorcon byte-compiling build/bdist.linux-x86_64/egg/twisted/plugins/txtorcon_endpoint_parser.py to txtorcon_endpoint_parser.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/stream.py to stream.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/log.py to log.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/torconfig.py to torconfig.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/router.py to router.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/torcontrolprotocol.py to torcontrolprotocol.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/circuit.py to circuit.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/addrmap.py to addrmap.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/interface.py to interface.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/spaghetti.py to spaghetti.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/torstate.py to torstate.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/torinfo.py to torinfo.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/__init__.py to __init__.pyc byte-compiling build/bdist.linux-x86_64/egg/txtorcon/util.py to util.pyc installing package data to build/bdist.linux-x86_64/egg running install_data creating build/bdist.linux-x86_64/egg/share creating build/bdist.linux-x86_64/egg/share/txtorcon copying INSTALL -> build/bdist.linux-x86_64/egg/share/txtorcon copying README.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying TODO -> build/bdist.linux-x86_64/egg/share/txtorcon copying meejah.asc -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/apilinks_sphinxext.py -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/conf.py -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/Makefile -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/txtorcon-interface.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/txtorcon-launching.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/txtorcon-state.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/txtorcon.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/txtorcon-util.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/examples.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/releases.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/walkthrough.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/introduction.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/txtorcon-config.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/index.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/txtorcon-protocol.rst -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/_static/logo.png -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/_static/haiku.css -> build/bdist.linux-x86_64/egg/share/txtorcon copying docs/_static/avatar.png -> build/bdist.linux-x86_64/egg/share/txtorcon creating build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/monitor.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/launch_tor.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/webui_server.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/stream_circuit_logger.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/launch_tor_with_simplehttpd.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/launch_tor_endpoint.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/circuit_for_next_stream.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/dump_config.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/schedule_bandwidth.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/disallow_streams_by_port.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/attach_streams_by_country.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/launch_tor_with_hiddenservice.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/circuit_failure_rates.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples copying examples/tor_info.py -> build/bdist.linux-x86_64/egg/share/txtorcon/examples creating build/bdist.linux-x86_64/egg/EGG-INFO copying txtorcon.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying txtorcon.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying txtorcon.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying txtorcon.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying txtorcon.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... creating 'dist/txtorcon-0.9.2-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing txtorcon-0.9.2-py2.7.egg Copying txtorcon-0.9.2-py2.7.egg to /home/human/virtenv-txtorcon/lib/python2.7/site-packages Adding txtorcon 0.9.2 to easy-install.pth file Installed /home/human/virtenv-txtorcon/lib/python2.7/site-packages/txtorcon-0.9.2-py2.7.egg Processing dependencies for txtorcon==0.9.2 Searching for zope.interface==4.1.1 Best match: zope.interface 4.1.1 Adding zope.interface 4.1.1 to easy-install.pth file Using /home/human/virtenv-txtorcon/lib/python2.7/site-packages Searching for Twisted==13.2.0 Best match: Twisted 13.2.0 Adding Twisted 13.2.0 to easy-install.pth file Using /home/human/virtenv-txtorcon/lib/python2.7/site-packages Searching for setuptools==3.4.4 Best match: setuptools 3.4.4 Adding setuptools 3.4.4 to easy-install.pth file Installing easy_install-3.4 script to /home/human/virtenv-txtorcon/bin Installing easy_install script to /home/human/virtenv-txtorcon/bin Using /home/human/virtenv-txtorcon/lib/python2.7/site-packages Finished processing dependencies for txtorcon==0.9.2 > This stack overflow question still hasn't gotten a great answer: > <https://stackoverflow.com/questions/7275295/how-do-i-write-a-setup-py-for-a-twistd-twisted-plugin-that-works-with-setuptools> > If you figure something out, please post it there. > > However, assuming a post-deluvian version of pip, this simple setup appears > to work OK for me: > <https://github.com/glyph/txsni/blob/master/setup.py#L16> > and I haven't found a setup that breaks it yet. > > -glyph > > > _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python