]> wagnertech.de Git - SVBaL.git/blob - python/eh_util/eh_app/AWK/util.py
1948aad8800cf284701471ac9bd603021eca04fa
[SVBaL.git] / python / eh_util / eh_app / AWK / util.py
1 '''
2 Utilities für EHUtil
3 '''
4 import syslog
5 from http import cookies
6
7 def schreibe_log(eintrag):
8    syslog.openlog("eh_util")
9    syslog.syslog(eintrag) 
10
11 def write_http_data(key, value):
12     cookie = cookies.SimpleCookie()
13     cookie[key] = value
14     cookie[key]["path"] = "/eh_util"
15     print(cookie)
16
17 def lese_http_data(key):
18     import os
19     cookie_string = os.environ.get("HTTP_COOKIE")
20     cookie = cookies.SimpleCookie(cookie_string)
21     if key in cookie:
22         return cookie[key].value
23     return None
24     #return cookie[key] or None
25