mirror of
https://github.com/powerline/powerline.git
synced 2025-07-31 01:35:40 +02:00
parent
fcf5702b7f
commit
1a3ff92a62
@ -9,6 +9,7 @@ from collections import defaultdict
|
|||||||
|
|
||||||
from powerline.lib.watcher import create_tree_watcher
|
from powerline.lib.watcher import create_tree_watcher
|
||||||
from powerline.lib.unicode import out_u
|
from powerline.lib.unicode import out_u
|
||||||
|
from powerline.lib.path import join
|
||||||
|
|
||||||
|
|
||||||
def generate_directories(path):
|
def generate_directories(path):
|
||||||
@ -97,7 +98,7 @@ class FileStatusCache(dict):
|
|||||||
if nparent == parent:
|
if nparent == parent:
|
||||||
break
|
break
|
||||||
parent = nparent
|
parent = nparent
|
||||||
ignore_files.add(os.path.join(parent, ignore_file_name))
|
ignore_files.add(join(parent, ignore_file_name))
|
||||||
for f in extra_ignore_files:
|
for f in extra_ignore_files:
|
||||||
ignore_files.add(f)
|
ignore_files.add(f)
|
||||||
self.keypath_ignore_map[keypath] = ignore_files
|
self.keypath_ignore_map[keypath] = ignore_files
|
||||||
@ -121,7 +122,7 @@ file_status_cache = FileStatusCache()
|
|||||||
|
|
||||||
def get_file_status(directory, dirstate_file, file_path, ignore_file_name, get_func, create_watcher, extra_ignore_files=()):
|
def get_file_status(directory, dirstate_file, file_path, ignore_file_name, get_func, create_watcher, extra_ignore_files=()):
|
||||||
global file_status_cache
|
global file_status_cache
|
||||||
keypath = file_path if os.path.isabs(file_path) else os.path.join(directory, file_path)
|
keypath = file_path if os.path.isabs(file_path) else join(directory, file_path)
|
||||||
file_status_cache.update_maps(keypath, directory, dirstate_file, ignore_file_name, extra_ignore_files)
|
file_status_cache.update_maps(keypath, directory, dirstate_file, ignore_file_name, extra_ignore_files)
|
||||||
|
|
||||||
with file_status_lock:
|
with file_status_lock:
|
||||||
|
@ -166,5 +166,3 @@ def user(pl, hide_user=None):
|
|||||||
'contents': username,
|
'contents': username,
|
||||||
'highlight_group': ['user'] if euid != 0 else ['superuser', 'user'],
|
'highlight_group': ['user'] if euid != 0 else ['superuser', 'user'],
|
||||||
}]
|
}]
|
||||||
if 'psutil' not in globals():
|
|
||||||
user = requires_segment_info(user)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user