"""MDK config class"""
userFile = None
+ _instance = None
+
+ def __new__(cls, *args, **kwargs):
+ if not cls._instance:
+ cls._instance = super(Conf, cls).__new__(cls, *args, **kwargs)
+ return cls._instance
- def __init__(self):
- self.userFile = os.path.expanduser('~/.moodle-sdk/config.json')
+ def __init__(self, userfile=None):
+ if userfile == None:
+ userfile = os.path.expanduser('~/.moodle-sdk/config.json')
+ self.userFile = userfile
files = [
os.path.join(os.path.dirname(__file__), '..', 'config-dist.json'),
os.path.join(os.path.dirname(__file__), '..', 'config.json'),