hope I got the merge wright...
[monitor.git] / Rpyc / Demo / demo-2.py
diff --git a/Rpyc/Demo/demo-2.py b/Rpyc/Demo/demo-2.py
deleted file mode 100644 (file)
index 7ed797c..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#\r
-# okay, this demo is more advanced. here we'll learn about:\r
-#  * redirecting standard files\r
-#  * synchronous callbacks\r
-#  * the ulitities module\r
-#\r
-import sys\r
-import os \r
-from Rpyc.Factories import SocketConnection\r
-from Rpyc.Utils import hasattr, getattr, reload, upload, remote_interpreter\r
-\r
-c = SocketConnection("localhost", 22222)\r
-\r
-#\r
-# redirect our stdout to the server\r
-#\r
-sys.stdout = c.modules.sys.stdout\r
-print "this time we focus on `the seatle music`"\r
-\r
-#\r
-# and the other way round\r
-#\r
-sys.stdout = sys.__stdout__\r
-c.modules.sys.stdout = sys.stdout\r
-c.modules.sys.stdout.write("alice in chains\n")\r
-\r
-#\r
-# but you dont believe me, so \r
-#\r
-c.modules.Rpyc.Demo.testmodule.printer("tool")\r
-\r
-#\r
-# and restore that\r
-#\r
-c.modules.sys.stdout = c.modules.sys.__stdout__\r
-\r
-#\r
-# now let's play with callbacks\r
-#\r
-def f(text):\r
-    print text\r
-\r
-c.modules.Rpyc.Demo.testmodule.caller(f, "nirvana")\r
-\r
-#\r
-# and if you insist\r
-#\r
-def g(func, text):\r
-    c.modules.Rpyc.Demo.testmodule.caller(func, text)\r
-\r
-c.modules.Rpyc.Demo.testmodule.caller(g, f, "soundgarden")\r
-\r
-#\r
-# now for the utilities module. it gives us the following cool functions:\r
-#  * dir, getattr, hasattr, help, reload -- overriding builtins \r
-#  * upload, download -- transfering files/directories to/from the client/server (all the permutations)\r
-#  * remote_shell, remote_interpreter -- running remote processess and debugging\r
-#\r
-print hasattr(sys, "path")\r
-print hasattr(c.modules.sys, "path")\r
-\r
-print getattr(sys, "maxint")\r
-print getattr(c.modules.sys, "maxint")\r
-\r
-print reload(sys)\r
-print reload(c.modules.sys)\r
-\r
-f=open("lala.txt", "w")\r
-f.write("king crimson")\r
-f.close()\r
-upload(c, "lala.txt", "../lala.txt")\r
-os.remove("lala.txt")\r
-c.modules.os.remove("../lala.txt")\r
-\r
-remote_interpreter(c)\r
-\r
-\r
-print "goodbye"\r
-\r
-\r
-\r