diff options
author | Camil Staps | 2016-03-04 23:09:53 +0100 |
---|---|---|
committer | Camil Staps | 2016-03-04 23:10:12 +0100 |
commit | 5372ebb8be5a5e6669129b6dc78fa6f333b6e186 (patch) | |
tree | 37e96eeb9749a3f9cfae44082d72514f49785156 /project1/proj1_s4498062/webhttp/config.py | |
parent | Project one until step 8 in the readme (diff) |
Project 1: Config system; ETags; error pages
Diffstat (limited to 'project1/proj1_s4498062/webhttp/config.py')
-rw-r--r-- | project1/proj1_s4498062/webhttp/config.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/project1/proj1_s4498062/webhttp/config.py b/project1/proj1_s4498062/webhttp/config.py new file mode 100644 index 0000000..35d73cb --- /dev/null +++ b/project1/proj1_s4498062/webhttp/config.py @@ -0,0 +1,12 @@ +from configparser import SafeConfigParser + +__all__ = ['config'] + +scp = SafeConfigParser() + +def config(option=None, section='webhttp', type=lambda x:x): + if option == None: + return scp + else: + return type(scp.get(section, option)) + |