Skip to content

Commit f7896eb

Browse files
author
Benjamin W. Smith
committed
Copying project from mercurial repo for the hell of it.
0 parents  commit f7896eb

35 files changed

Lines changed: 3183 additions & 0 deletions

LICENSE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Copyright (c) 2009, Benjamin W. Smith
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or
8+
other materials provided with the distribution.
9+
* Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software
10+
without specific prior written permission.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
13+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
14+
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
15+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
16+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
17+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
==========================================
2+
stompy - Python STOMP client library
3+
==========================================
4+
5+
This is useful for connecting to and communicating with
6+
Apache `ActiveMQ`_ (an open source `Java Message Service`_ (JMS)
7+
message broker) or other brokers with support for the `STOMP`_ protocol.
8+
9+
The majority of the methods available take a single argument; a dictionary.
10+
This dictionary should contain the necessary bits you need
11+
to pass to the `STOMP`_ server. It is outlined in each method
12+
exactly what it needs to work.
13+
14+
For specifics on the protocol, see the `STOMP protocol specification`_.
15+
16+
This library is basically a Python implementation of Perl's `Net::Stomp`_.
17+
18+
To enable the `ActiveMQ`_ Broker for `STOMP`_ add the following to the
19+
``activemq.xml`` configuration::
20+
21+
<connector>
22+
<serverTransport uri="stomp://localhost:61613"/>
23+
</connector>
24+
25+
See http://bitbucket.org/benjaminws/python-stomp/ for latest code.
26+
27+
.. _`ActiveMQ`: http://activemq.apache.org/
28+
.. _`Java Message Service`: http://java.sun.com/products/jms/
29+
.. _`STOMP`: http://stomp.codehaus.org/
30+
.. _`STOMP protocol specification`: http://stomp.codehaus.org/Protocol
31+
.. _`Net::Stomp`: http://search.cpan.org/perldoc?Net::Stomp
32+
33+
Thanks for patches and support go out to:
34+
35+
Ask Solem Hoel (asksol) http://github.com/ask
36+
Victor Ng (crankycoder) http://crankycoder.com/
37+
Justin Azoff (justinazoff) http://www.bouncybouncy.net/

TODO

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Get better performance from get_line and parse_frame?

docs/Makefile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
9+
# Internal variables.
10+
PAPEROPT_a4 = -D latex_paper_size=a4
11+
PAPEROPT_letter = -D latex_paper_size=letter
12+
ALLSPHINXOPTS = -d .build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
13+
14+
.PHONY: help clean html web pickle htmlhelp latex changes linkcheck
15+
16+
help:
17+
@echo "Please use \`make <target>' where <target> is one of"
18+
@echo " html to make standalone HTML files"
19+
@echo " pickle to make pickle files"
20+
@echo " json to make JSON files"
21+
@echo " htmlhelp to make HTML files and a HTML help project"
22+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
23+
@echo " changes to make an overview over all changed/added/deprecated items"
24+
@echo " linkcheck to check all external links for integrity"
25+
26+
clean:
27+
-rm -rf .build/*
28+
29+
html:
30+
mkdir -p .build/html .build/doctrees
31+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) .build/html
32+
@echo
33+
@echo "Build finished. The HTML pages are in .build/html."
34+
35+
pickle:
36+
mkdir -p .build/pickle .build/doctrees
37+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) .build/pickle
38+
@echo
39+
@echo "Build finished; now you can process the pickle files."
40+
41+
web: pickle
42+
43+
json:
44+
mkdir -p .build/json .build/doctrees
45+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) .build/json
46+
@echo
47+
@echo "Build finished; now you can process the JSON files."
48+
49+
htmlhelp:
50+
mkdir -p .build/htmlhelp .build/doctrees
51+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) .build/htmlhelp
52+
@echo
53+
@echo "Build finished; now you can run HTML Help Workshop with the" \
54+
".hhp project file in .build/htmlhelp."
55+
56+
latex:
57+
mkdir -p .build/latex .build/doctrees
58+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) .build/latex
59+
@echo
60+
@echo "Build finished; the LaTeX files are in .build/latex."
61+
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
62+
"run these through (pdf)latex."
63+
64+
changes:
65+
mkdir -p .build/changes .build/doctrees
66+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) .build/changes
67+
@echo
68+
@echo "The overview file is in .build/changes."
69+
70+
linkcheck:
71+
mkdir -p .build/linkcheck .build/doctrees
72+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) .build/linkcheck
73+
@echo
74+
@echo "Link check complete; look for any errors in the above output " \
75+
"or in .build/linkcheck/output.txt."

docs/_ext/applyxrefs.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
"""Adds xref targets to the top of files."""
2+
3+
import sys
4+
import os
5+
6+
testing = False
7+
8+
DONT_TOUCH = (
9+
'./index.txt',
10+
)
11+
12+
13+
def target_name(fn):
14+
if fn.endswith('.txt'):
15+
fn = fn[:-4]
16+
return '_' + fn.lstrip('./').replace('/', '-')
17+
18+
19+
def process_file(fn, lines):
20+
lines.insert(0, '\n')
21+
lines.insert(0, '.. %s:\n' % target_name(fn))
22+
try:
23+
f = open(fn, 'w')
24+
except IOError:
25+
print("Can't open %s for writing. Not touching it." % fn)
26+
return
27+
try:
28+
f.writelines(lines)
29+
except IOError:
30+
print("Can't write to %s. Not touching it." % fn)
31+
finally:
32+
f.close()
33+
34+
35+
def has_target(fn):
36+
try:
37+
f = open(fn, 'r')
38+
except IOError:
39+
print("Can't open %s. Not touching it." % fn)
40+
return (True, None)
41+
readok = True
42+
try:
43+
lines = f.readlines()
44+
except IOError:
45+
print("Can't read %s. Not touching it." % fn)
46+
readok = False
47+
finally:
48+
f.close()
49+
if not readok:
50+
return (True, None)
51+
52+
#print fn, len(lines)
53+
if len(lines) < 1:
54+
print("Not touching empty file %s." % fn)
55+
return (True, None)
56+
if lines[0].startswith('.. _'):
57+
return (True, None)
58+
return (False, lines)
59+
60+
61+
def main(argv=None):
62+
if argv is None:
63+
argv = sys.argv
64+
65+
if len(argv) == 1:
66+
argv.extend('.')
67+
68+
files = []
69+
for root in argv[1:]:
70+
for (dirpath, dirnames, filenames) in os.walk(root):
71+
files.extend([(dirpath, f) for f in filenames])
72+
files.sort()
73+
files = [os.path.join(p, fn) for p, fn in files if fn.endswith('.txt')]
74+
#print files
75+
76+
for fn in files:
77+
if fn in DONT_TOUCH:
78+
print("Skipping blacklisted file %s." % fn)
79+
continue
80+
81+
target_found, lines = has_target(fn)
82+
if not target_found:
83+
if testing:
84+
print '%s: %s' % (fn, lines[0]),
85+
else:
86+
print "Adding xref to %s" % fn
87+
process_file(fn, lines)
88+
else:
89+
print "Skipping %s: already has a xref" % fn
90+
91+
if __name__ == '__main__':
92+
sys.exit(main())

0 commit comments

Comments
 (0)