]> wagnertech.de Git - SVBaL.git/blobdiff - python/eh_util/eh_app/AWK/util.py
pydev-s6
[SVBaL.git] / python / eh_util / eh_app / AWK / util.py
diff --git a/python/eh_util/eh_app/AWK/util.py b/python/eh_util/eh_app/AWK/util.py
new file mode 100644 (file)
index 0000000..1948aad
--- /dev/null
@@ -0,0 +1,25 @@
+'''
+Utilities für EHUtil
+'''
+import syslog
+from http import cookies
+
+def schreibe_log(eintrag):
+   syslog.openlog("eh_util")
+   syslog.syslog(eintrag) 
+
+def write_http_data(key, value):
+    cookie = cookies.SimpleCookie()
+    cookie[key] = value
+    cookie[key]["path"] = "/eh_util"
+    print(cookie)
+
+def lese_http_data(key):
+    import os
+    cookie_string = os.environ.get("HTTP_COOKIE")
+    cookie = cookies.SimpleCookie(cookie_string)
+    if key in cookie:
+        return cookie[key].value
+    return None
+    #return cookie[key] or None
\ No newline at end of file