// The web directory you are going to access Moodle from. A symlink will be created here.
"www": "/var/www",
// The directory where the instances will be stored
- "storage": "/var/www/moodles",
+ "storage": "~/moodles",
// A directory used by MDK to store different kind of things such as backups and cached repositories.
- "moodle": "/home/fred/.moodle-sdk"
+ "moodle": "~/.moodle-sdk"
},
// List of remotes to work with
class BackupManager(object):
def __init__(self):
- self.path = os.path.join(C.get('dirs.moodle'), 'backup')
+ self.path = os.path.expanduser(os.path.join(C.get('dirs.moodle'), 'backup'))
def create(self, M):
"""Creates a new backup of M"""
def runScript(self, scriptname, **kwargs):
"""Runs a script on the instance"""
supported = ['php']
- directories = ['~/.moodle-sdk', '/etc/moodle-sdk']
+ directories = ['~/.moodle-sdk']
if C.get('dirs.moodle') != None:
directories.insert(0, C.get('dirs.moodle'))
directories.append(os.path.join(os.path.dirname(__file__), '..'))
raise Exception('Directory %s not found' % path)
# Directory paths
- self.path = os.path.abspath(os.path.realpath(path))
- self.cache = os.path.abspath(os.path.realpath(C.get('dirs.moodle')))
- self.www = os.path.abspath(os.path.realpath(C.get('dirs.www')))
+ self.path = os.path.abspath(os.path.realpath(os.path.expanduser(path)))
+ self.cache = os.path.abspath(os.path.realpath(os.path.expanduser(C.get('dirs.moodle'))))
+ self.www = os.path.abspath(os.path.realpath(os.path.expanduser(C.get('dirs.www'))))
# Directory names
self.wwwDir = wwwDir