refuse to run on a unc drive

This commit is contained in:
Damien Elmes 2012-08-01 12:12:09 +09:00
parent 269fb29901
commit fde7db2d14

View file

@ -58,6 +58,7 @@ class ProfileManager(object):
self.name = None
# instantiate base folder
self.base = base or self._defaultBase()
self.ensureLocalFS()
self.ensureBaseExists()
# load metadata
self.firstRun = self._loadMeta()
@ -71,6 +72,15 @@ class ProfileManager(object):
# Base creation
######################################################################
def ensureLocalFS(self):
if self.base.startswith("\\\\"):
QMessageBox.critical(
None, "Error", """\
To use Anki on a network share, the share must be mapped to a local drive \
letter. Please see the 'File Locations' section of the manual for more \
information.""")
raise Exception("unc")
def ensureBaseExists(self):
try:
self._ensureExists(self.base)