@@ -29,6 +29,7 @@ def main():
2929 parser .add_argument ('--depth' , '-d' , type = int , default = 0 , help = 'Set cutoff depth.' )
3030 parser .add_argument ('--root' , '-r' , type = str , default = os .path .sep , help = 'Set base root dir.' )
3131 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.' )
3233 parser .add_argument ('path' , type = str , default = '' , help = 'Path' , nargs = '?' )
3334 arguments = parser .parse_args ()
3435 app (arguments )
@@ -54,15 +55,15 @@ def app(args):
5455 if args .no_recursive :
5556 os .chdir (args .path )
5657 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 )
5859 else :
5960 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 )
6162 except TemplateNotFound as e :
6263 raise IndexGeneratorTemplateNotFound (str (e ))
6364
6465
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 ' ):
6667 if not template :
6768 environment = jinja2 .Environment (
6869 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
7576 )
7677 template = environment .get_template (name )
7778
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 ))
7980 # entries.sort(key=lambda x: x.isDir, reverse=True)
8081
8182 filelist = []
@@ -108,7 +109,7 @@ def generate_once(theme, root, files, name, if_print, base=os.path.sep, human=Fa
108109 print (html , file = f )
109110
110111
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 ' ):
112113 os .chdir (path )
113114 for root , dirs , files in os .walk ('.' ):
114115 if max_depth != 0 and root .count (os .sep ) >= max_depth :
0 commit comments