Skip to content

Commit 99abb72

Browse files
0.3.0 early testing
1 parent f9c8578 commit 99abb72

File tree

553 files changed

+52
-1912
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

553 files changed

+52
-1912
lines changed

index_generator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
APP_NAME = 'Index Generator'
2-
APP_VERSION = '0.2.9'
2+
APP_VERSION = '0.3.0'
33
APP_URL = 'https://github.com/BruceZhang1993/index-generator'
44
PACKAGE_NAME = 'index-generator'
55
LICENSE = 'MIT'

index_generator/__main__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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:

index_generator/icons/material/3d.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

index_generator/icons/material/actionscript.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

index_generator/icons/material/android.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

index_generator/icons/material/angular-component.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

index_generator/icons/material/angular-directive.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

index_generator/icons/material/angular-guard.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

index_generator/icons/material/angular-pipe.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

index_generator/icons/material/angular-resolver.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)