mirror of
https://github.com/powerline/powerline.git
synced 2025-05-03 14:20:59 +02:00
Add realpath() calls to Uv watchers where appropriate
This commit is contained in:
parent
c564b64530
commit
ad519b5e91
@ -63,6 +63,7 @@ class UvWatcher(object):
|
|||||||
self.loop = start_uv_thread()
|
self.loop = start_uv_thread()
|
||||||
|
|
||||||
def watch(self, path):
|
def watch(self, path):
|
||||||
|
path = realpath(path)
|
||||||
with self.lock:
|
with self.lock:
|
||||||
if path not in self.watches:
|
if path not in self.watches:
|
||||||
try:
|
try:
|
||||||
@ -80,6 +81,7 @@ class UvWatcher(object):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
def unwatch(self, path):
|
def unwatch(self, path):
|
||||||
|
path = realpath(path)
|
||||||
with self.lock:
|
with self.lock:
|
||||||
try:
|
try:
|
||||||
watch = self.watches.pop(path)
|
watch = self.watches.pop(path)
|
||||||
@ -89,7 +91,7 @@ class UvWatcher(object):
|
|||||||
|
|
||||||
def is_watching(self, path):
|
def is_watching(self, path):
|
||||||
with self.lock:
|
with self.lock:
|
||||||
return path in self.watches
|
return realpath(path) in self.watches
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
try:
|
try:
|
||||||
@ -119,6 +121,7 @@ class UvFileWatcher(UvWatcher):
|
|||||||
self.events.pop(path, None)
|
self.events.pop(path, None)
|
||||||
|
|
||||||
def __call__(self, path):
|
def __call__(self, path):
|
||||||
|
path = realpath(path)
|
||||||
with self.lock:
|
with self.lock:
|
||||||
events = self.events.pop(path, None)
|
events = self.events.pop(path, None)
|
||||||
if events:
|
if events:
|
||||||
@ -139,7 +142,7 @@ class UvTreeWatcher(UvWatcher):
|
|||||||
self.watch_directory(self.basedir)
|
self.watch_directory(self.basedir)
|
||||||
|
|
||||||
def watch_directory(self, path):
|
def watch_directory(self, path):
|
||||||
os.path.walk(path, self.watch_one_directory, None)
|
os.path.walk(realpath(path), self.watch_one_directory, None)
|
||||||
|
|
||||||
def watch_one_directory(self, arg, dirname, fnames):
|
def watch_one_directory(self, arg, dirname, fnames):
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user