Commit bddaee85 authored by Alexander Hiam's avatar Alexander Hiam

don't pass 'allow_no_value' to SafeConfigParser if Python < 2.7

parent cf3cd8be
#!/usr/bin/python
import cherrypy, pronterface, re, ConfigParser, threading
import cherrypy, pronterface, re, ConfigParser, threading, sys
import os.path
users = {}
......@@ -233,7 +233,11 @@ class XMLstatus(object):
class WebInterface(object):
def __init__(self, pface):
config = ConfigParser.SafeConfigParser(allow_no_value=True)
if (sys.version_info[1] > 6):
# 'allow_no_value' wasn't added until 2.7
config = ConfigParser.SafeConfigParser(allow_no_value=True)
else:
config = ConfigParser.SafeConfigParser()
config.read('auth.config')
users[config.get("user", "user")] = config.get("user", "pass")
self.pface = pface
......@@ -369,4 +373,4 @@ def StartWebInterfaceThread(webInterface):
if __name__ == '__main__':
cherrypy.config.update("http.config")
cherrypy.quickstart(WebInterfaceStub())
\ No newline at end of file
cherrypy.quickstart(WebInterfaceStub())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment