@@ -29,6 +29,7 @@ def main():
29
29
parser .add_argument ('--depth' , '-d' , type = int , default = 0 , help = 'Set cutoff depth.' )
30
30
parser .add_argument ('--root' , '-r' , type = str , default = os .path .sep , help = 'Set base root dir.' )
31
31
parser .add_argument ('--human' , action = 'store_true' , default = False , help = 'Make size human readable.' )
32
+ parser .add_argument ('--iconset' , action = 'store' , default = 'papirus' , help = 'Choose iconset.' )
32
33
parser .add_argument ('path' , type = str , default = '' , help = 'Path' , nargs = '?' )
33
34
arguments = parser .parse_args ()
34
35
app (arguments )
@@ -54,15 +55,15 @@ def app(args):
54
55
if args .no_recursive :
55
56
os .chdir (args .path )
56
57
generate_once (args .theme , '.' , os .listdir ('.' ), args .name , args .print , base = args .root , human = args .human ,
57
- template = os .path .abspath (args .template ) if args .template else '' )
58
+ template = os .path .abspath (args .template ) if args .template else '' , iconset = args . iconset )
58
59
else :
59
60
generate_recursively (args .theme , args .path , args .name , args .print , args .depth , base = args .root , human = args .human ,
60
- template = os .path .abspath (args .template ) if args .template else '' )
61
+ template = os .path .abspath (args .template ) if args .template else '' , iconset = args . iconset )
61
62
except TemplateNotFound as e :
62
63
raise IndexGeneratorTemplateNotFound (str (e ))
63
64
64
65
65
- def generate_once (theme , root , files , name , if_print , base = os .path .sep , human = False , template = '' , iconset = 'material ' ):
66
+ def generate_once (theme , root , files , name , if_print , base = os .path .sep , human = False , template = '' , iconset = 'papirus ' ):
66
67
if not template :
67
68
environment = jinja2 .Environment (
68
69
loader = jinja2 .PackageLoader ('index_generator' , 'templates/' + theme ),
@@ -75,7 +76,7 @@ def generate_once(theme, root, files, name, if_print, base=os.path.sep, human=Fa
75
76
)
76
77
template = environment .get_template (name )
77
78
78
- entries = list (map (lambda f1 : Entry (f1 , root , base = base , human = human ), files ))
79
+ entries = list (map (lambda f1 : Entry (f1 , root , base = base , human = human , iconset = iconset ), files ))
79
80
# entries.sort(key=lambda x: x.isDir, reverse=True)
80
81
81
82
filelist = []
@@ -108,7 +109,7 @@ def generate_once(theme, root, files, name, if_print, base=os.path.sep, human=Fa
108
109
print (html , file = f )
109
110
110
111
111
- def generate_recursively (theme , path , name , if_print , max_depth = 0 , base = os .path .sep , human = False , template = '' , iconset = 'material ' ):
112
+ def generate_recursively (theme , path , name , if_print , max_depth = 0 , base = os .path .sep , human = False , template = '' , iconset = 'papirus ' ):
112
113
os .chdir (path )
113
114
for root , dirs , files in os .walk ('.' ):
114
115
if max_depth != 0 and root .count (os .sep ) >= max_depth :
0 commit comments