Commits

Anonymous committed a6240de Draft

Added simple demo for usage

  • Participants
  • Parent commits 48ea008
  • Branches demo

Comments (0)

Files changed (1)

+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
+#
+"""Demo "app" for rfoo/rconsole
+
+Usage; run with no parameters and then in another terminal run rconsole.
+
+Once rconsole is connected check the contents of variable `counter`.
+Optionally try tab completion, example; enter "cou" then hit the Tab key.
+"""
+
+import os
+import sys
+import time
+
+from rfoo.utils import rconsole
+
+
+counter = 1
+
+
+def main(argv=None):
+    if argv is None:
+        argv = sys.argv
+
+    global counter
+
+    rconsole.spawn_server()
+    while counter:
+        time.sleep(10)
+        counter += 1
+
+    return 0
+
+if __name__ == "__main__":
+    sys.exit(main())