Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed some formatting in README.markdown that was causing problems when converted to reStructredText. Added version information to README.markdown. Added installation instructions to README.markdown. Python: Added RPC message logging using the logging module. Python: Now using Distribute instead of distutils. Python: Added redis as an installation dependency.
- Loading branch information
Showing
8 changed files
with
282 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
README.html | ||
# Ruby | ||
.rvmrc | ||
# PHP | ||
composer.lock | ||
composer.phar | ||
php/vendor | ||
# Python | ||
*.pyc | ||
python/LICENSE | ||
python/MANIFEST | ||
python/README.rst | ||
python/build/ | ||
python/dist/ | ||
python/build | ||
python/dist | ||
python/redisrpc.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,87 @@ | ||
TARGETS:=\ | ||
composer.phar\ | ||
php/vendor\ | ||
python/LICENSE\ | ||
python/README.rst\ | ||
python/MANIFEST\ | ||
python/dist | ||
BASIC_TARGETS:=\ | ||
README.html | ||
|
||
PHP_TARGETS:=\ | ||
$(BASIC_TARGETS)\ | ||
composer.phar\ | ||
php/vendor | ||
|
||
PYTHON_TARGETS:=\ | ||
$(BASIC_TARGETS)\ | ||
python/LICENSE\ | ||
python/README.rst\ | ||
python/dist | ||
|
||
ALL_TARGETS:=\ | ||
$(BASIC_TARGETS)\ | ||
$(PHP_TARGETS)\ | ||
$(PYTHON_TARGETS) | ||
|
||
.PHONY: help | ||
help: | ||
@echo 'Build Targets:' | ||
@echo ' all' | ||
@echo ' php' | ||
@echo ' python' | ||
@echo 'Clean Targets:' | ||
@echo ' clean-all' | ||
@echo ' clean-php' | ||
@echo ' clean-python' | ||
|
||
.PHONY: all | ||
all: $(TARGETS) | ||
all: $(ALL_TARGETS) | ||
|
||
.PHONY: basic | ||
basic: $(BASIC_TARGETS) | ||
|
||
.PHONY: php | ||
php: $(PHP_TARGETS) | ||
|
||
.PHONY: python | ||
python: $(PYTHON_TARGETS) | ||
|
||
.PHONY: clean-all | ||
clean-all: clean-php clean-python | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf $(TARGETS) python/build | ||
.PHONY: clean-php | ||
clean-php: | ||
@rm -rf $(PHP_TARGETS) | ||
@rm -rf composer.lock | ||
|
||
.PHONY: clean-python | ||
clean-python: | ||
@rm -rf $(PYTHON_TARGETS) | ||
@rm -rf python/*.pyc python/examples/*.pyc | ||
@rm -rf python/build | ||
@rm -rf python/redisrpc.egg-info | ||
|
||
######################### | ||
# Rules for Basic Targets | ||
######################### | ||
|
||
# Ref: https://github.com/alampros/Docter | ||
README.html: README.markdown | ||
docs/github-flavored-markdown.rb $< >$@ | ||
|
||
####################### | ||
# Rules for PHP Targets | ||
####################### | ||
|
||
composer.phar: | ||
curl -s http://getcomposer.org/installer | php | ||
|
||
php/vendor: composer.phar | ||
php composer.phar install | ||
|
||
########################## | ||
# Rules for Python Targets | ||
########################## | ||
|
||
python/LICENSE: LICENSE | ||
cp -a $< $@ | ||
|
||
# Ref: https://github.com/alampros/Docter | ||
python/README.rst: README.markdown | ||
~/bin/github-flavored-markdown.rb $< | pandoc --from=html --to=rst --output=$@ | ||
python/README.rst: README.html | ||
cat $< | pandoc --from=html --to=rst --output=$@ | ||
|
||
python/MANIFEST python/dist: python/LICENSE python/README.rst | ||
python/dist: python/LICENSE python/README.rst | ||
cd python && python setup.py sdist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env ruby | ||
# @author Aaron Lampros | ||
# | ||
# Github-flavored markdown to HTML, in a command-line util. | ||
# | ||
# $ cat README.md | ./github-flavored-markdown.rb | ||
# | ||
# Notes: | ||
# You will need to install Pygments for syntax coloring | ||
# ```bash | ||
# $ sudo easy_install pygments | ||
# ``` | ||
# | ||
# Install the gems `redcarpet` and `Pygments` | ||
# | ||
# | ||
require 'rubygems' | ||
require 'redcarpet' | ||
require 'pygments.rb' | ||
|
||
# puts Pygments.styles() | ||
# monokai | ||
# manni | ||
# perldoc | ||
# borland | ||
# colorful | ||
# default | ||
# murphy | ||
# vs | ||
# trac | ||
# tango | ||
# fruity | ||
# autumn | ||
# bw | ||
# emacs | ||
# vim | ||
# pastie | ||
# friendly | ||
# native | ||
class HTMLwithPygments < Redcarpet::Render::XHTML | ||
# def doc_header() | ||
# '<style>' + Pygments.css('.highlight',:style => 'default') + '</style>' | ||
# end | ||
# def block_code(code, language) | ||
# Pygments.highlight(code, :lexer => language, :options => {:encoding => 'utf-8'}) | ||
# end | ||
end | ||
|
||
|
||
def fromMarkdown(text) | ||
# options = [:fenced_code => true, :generate_toc => true, :hard_wrap => true, :no_intraemphasis => true, :strikethrough => true ,:gh_blockcode => true, :autolink => true, :xhtml => true, :tables => true] | ||
markdown = Redcarpet::Markdown.new(HTMLwithPygments, | ||
:fenced_code_blocks => true, | ||
:no_intra_emphasis => true, | ||
:autolink => true, | ||
:strikethrough => true, | ||
:lax_html_blocks => true, | ||
:superscript => true, | ||
:hard_wrap => true, | ||
:tables => true, | ||
:xhtml => true) | ||
markdown.render(text) | ||
end | ||
|
||
puts fromMarkdown(ARGF.read) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
#!/usr/bin/env python | ||
|
||
import logging | ||
import sys | ||
|
||
import redis | ||
import redisrpc | ||
|
||
import calc | ||
|
||
#redisrpc.DEBUG=True | ||
|
||
# Direct all RedisPRC logging messages to stderr. | ||
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) | ||
|
||
|
||
redis_server = redis.Redis() | ||
server = redisrpc.Server(redis_server, 'calc', calc.Calculator()) | ||
input_queue = 'calc' | ||
local_object = calc.Calculator() | ||
server = redisrpc.Server(redis_server, input_queue, local_object) | ||
server.run() |
Oops, something went wrong.