8
8
9
9
10
10
# Utility functions
11
- def get_ordering (dir ):
11
+ def get_ordering (dir , include_directory_path = False ):
12
12
"""Read gallery_order.txt in dir and return content of the file as a List"""
13
13
file_path = os .path .join (dir , 'gallery_order.txt' )
14
14
f = open (file_path , "r" )
@@ -18,7 +18,10 @@ def get_ordering(dir):
18
18
if line == "unsorted" :
19
19
ordered_list .append (UNSORTED )
20
20
else :
21
- ordered_list .append (line )
21
+ if include_directory_path :
22
+ ordered_list .append (os .path .join (dir , line ))
23
+ else :
24
+ ordered_list .append (line )
22
25
23
26
return ordered_list
24
27
@@ -69,9 +72,9 @@ def list_directory(parent_dir):
69
72
# UNSORTED
70
73
# ]
71
74
72
- plot_types_directory = "../galleries/plot_types/"
73
- plot_types_order = get_ordering (plot_types_directory )
74
75
76
+ plot_types_directory = "../galleries/plot_types/"
77
+ plot_types_order = get_ordering (plot_types_directory , include_directory_path = True )
75
78
76
79
folder_lists = [examples_order , tutorials_order , plot_types_order ]
77
80
explicit_order_folders = [fd for folders in folder_lists
@@ -133,7 +136,7 @@ def __call__(self, item):
133
136
134
137
for dir in list_directory (plot_types_directory ):
135
138
try :
136
- ordered_subdirs = get_ordering (dir )
139
+ ordered_subdirs = get_ordering (dir , include_directory_path = False )
137
140
list_all .extend (ordered_subdirs )
138
141
except FileNotFoundError :
139
142
# Fallback to ordering already defined in list_all
0 commit comments