Minor tweaks.

This commit is contained in:
Ethan Dalool 2020-10-26 22:57:36 -07:00
parent 995dd3959f
commit bb75e8db53

View file

@ -332,6 +332,7 @@ def atag(path, display_name=None):
else: else:
# Diamond emoji # Diamond emoji
#icon = '\U0001F48E' #icon = '\U0001F48E'
# Gift emoji
icon = '\U0001F381' icon = '\U0001F381'
#print('anchor', path) #print('anchor', path)
@ -347,25 +348,21 @@ def atag(path, display_name=None):
return a return a
def generate_opendir(path): def generate_opendir(path):
#print('Listdir:', path)
# This places directories above files, each ordered alphabetically
try: try:
items = path.listdir() items = path.listdir()
except FileNotFoundError: except FileNotFoundError:
items = [] items = []
# This places directories above files, each ordered alphabetically
directories = [] directories = []
files = [] files = []
for item in sorted(items, key=lambda p: p.basename.lower()): for item in sorted(items, key=lambda p: p.basename.lower()):
if item.basename.lower() in {'thumbs.db', 'desktop.ini', '$recycle.bin'}:
continue
if item.is_dir: if item.is_dir:
directories.append(item) directories.append(item)
else: else:
if item.basename.lower() == 'thumbs.db':
continue
if item.basename.lower() == 'desktop.ini':
continue
files.append(item) files.append(item)
items = directories + files items = directories + files