Home | History | Annotate | Download | only in pyautolib

Lines Matching refs:_path

31   _path = ''
44 self._path = path
45 if os.path.exists(self._path):
47 assert os.path.isdir(self._path), '%s is not a directory' % self._path
49 assert os.path.isfile(self._path), '%s is not a file' % self._path
51 self._backup_basename = os.path.basename(self._path)
52 self._backup_dir = tempfile.mkdtemp(dir=os.path.dirname(self._path),
54 logging.info('Backing up %s in %s' % (self._path, self._backup_dir))
55 shutil.move(self._path,
64 logging.info('Reinstating backup from %s to %s' % (from_path, self._path))
65 shutil.move(from_path, self._path)
70 if not os.path.exists(os.path.dirname(self._path)):
71 os.makedirs(os.path.dirname(self._path))
73 os.mkdir(self._path)
75 open(self._path, 'w').close()
78 if os.path.exists(self._path):
79 if os.path.isdir(self._path):
80 shutil.rmtree(self._path, ignore_errors=True)
82 os.remove(self._path)