Exemplo n.º 1
0
 def test_join(self):
     self.assertEqual(os.path.join(self.base, 'b'),
                      utils.safe_abs_path(self.base, "b"))
     self.assertEqual(os.path.join(self.base, 'b', 'c'),
                      utils.safe_abs_path(self.base, "b", 'c'))
     self.assertEqual(self.base,
                      utils.safe_abs_path(self.base, "b", 'c', '../..'))
Exemplo n.º 2
0
 def test_join(self):
     self.assertEqual(os.path.join(self.base, 'b'),
                      utils.safe_abs_path(self.base, "b"))
     self.assertEqual(os.path.join(self.base, 'b', 'c'),
                      utils.safe_abs_path(self.base, "b", 'c'))
     self.assertEqual(self.base,
                      utils.safe_abs_path(self.base, "b", 'c', '../..'))
Exemplo n.º 3
0
 def get_lock(self, name):
     path = utils.safe_abs_path(self._dir, name.decode())
     if path in self._reserved_paths:
         raise ValueError("Unable to create a lock using"
                          " reserved path '%s' for lock"
                          " with name '%s'" % (path, name))
     return locking.SharedWeakLockHelper(self._dir, FileLock, path)
Exemplo n.º 4
0
 def get_lock(self, name):
     path = utils.safe_abs_path(self._dir, name.decode())
     if path in self._reserved_paths:
         raise ValueError("Unable to create a lock using"
                          " reserved path '%s' for lock"
                          " with name '%s'" % (path, name))
     return self._get_raw_lock(path, self._member_id)
Exemplo n.º 5
0
Arquivo: file.py Projeto: csfreak/tooz
 def get_lock(self, name):
     path = utils.safe_abs_path(self._dir, name.decode())
     if path in self._reserved_paths:
         raise ValueError("Unable to create a lock using"
                          " reserved path '%s' for lock"
                          " with name '%s'" % (path, name))
     return self._get_raw_lock(path, self._member_id)