aboutsummaryrefslogtreecommitdiffstats
path: root/entropy_harvester/random241arg.py
diff options
context:
space:
mode:
authorDavid Runge <david.runge@frqrec.com>2014-02-15 01:32:28 +0100
committerDavid Runge <david.runge@frqrec.com>2014-02-15 01:32:28 +0100
commit29d861e10548e25339e24cfd2db1e3a9fc748e41 (patch)
treee55f4104dbd07ef285a325b1e50a61628522b50b /entropy_harvester/random241arg.py
parent7aa2d1e204c96c7c61210361f0469c23ff11450b (diff)
downloadrandom241-29d861e10548e25339e24cfd2db1e3a9fc748e41.tar.gz
random241-29d861e10548e25339e24cfd2db1e3a9fc748e41.tar.bz2
random241-29d861e10548e25339e24cfd2db1e3a9fc748e41.tar.xz
random241-29d861e10548e25339e24cfd2db1e3a9fc748e41.zip
Adding random241*.py files to subdirectory
Diffstat (limited to 'entropy_harvester/random241arg.py')
-rwxr-xr-xentropy_harvester/random241arg.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/entropy_harvester/random241arg.py b/entropy_harvester/random241arg.py
new file mode 100755
index 0000000..4bd00d8
--- /dev/null
+++ b/entropy_harvester/random241arg.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python2
+
+from sys import argv
+
+
+def read_params():
+ # Checks the given parameters
+ info = """Use the program as following:
+ random241.py [option] <param> ...
+ Options:
+ -c number of cam to use (starts with first found camera 0 (default))
+ -r remote address to send the output to (standard 192.168.0.7)
+ """
+ default = {'-c': "1", '-r': "192.168.0.7"}
+ parameters = default.copy()
+ if len(argv) != 3:
+ for i in xrange(1, len(argv) - 1, 2):
+ if argv[i] in parameters:
+ parameters[argv[i]] = argv[i + 1]
+ else:
+ print info
+ return 0
+ return parameters
+ else:
+ return default