Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated examples
  • Loading branch information
Dmitry Vasiliev committed Jan 9, 2010
1 parent 650b51f commit bc94165
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/generator.erl
Expand Up @@ -3,7 +3,7 @@

generate(N) when N >= 0 ->
Port = open_port({spawn, "python handler.py"},
[{packet, 1}, nouse_stdio, binary, {env, [{"PYTHONPATH", "../src"}]}]),
[{packet, 4}, nouse_stdio, binary, {env, [{"PYTHONPATH", "../src"}]}]),
generate(Port, N),
receive
{Port, {data, Data}} ->
Expand Down
2 changes: 1 addition & 1 deletion examples/handler.py
Expand Up @@ -17,4 +17,4 @@ def handle(self, port, message):

if __name__ == "__main__":
proto = EventHandler()
proto.run(Port())
proto.run(Port(packet=4))
2 changes: 1 addition & 1 deletion examples/hello.erl
@@ -1,7 +1,7 @@
-module(hello).
-export([hello/1]).

hello(Name) ->
hello(Name) when is_list(Name) ->
Port = open_port({spawn, "python hello.py"},
[{packet, 1}, nouse_stdio, binary, {env, [{"PYTHONPATH", "../src"}]}]),
port_command(Port, term_to_binary({hello, Name})),
Expand Down
4 changes: 2 additions & 2 deletions examples/hello.py
@@ -1,10 +1,10 @@
from erlport import Port, Protocol
from erlport import Port, Protocol, String


class HelloProtocol(Protocol):

def handle_hello(self, name):
return "Hello, %s" % name
return "Hello, %s" % String(name)


if __name__ == "__main__":
Expand Down

0 comments on commit bc94165

Please sign in to comment.