Skip to content

Commit dbe7efe

Browse files
author
sleepntsheep
committed
refactor
1 parent 60ab4ce commit dbe7efe

File tree

4 files changed

+43
-18
lines changed

4 files changed

+43
-18
lines changed

aniinfo/__init__.py

Whitespace-only changes.

aniinfo/data/config.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"title_language" : "romaji",
3+
"comment_1" : "title_language can be romaji, english , or native",
4+
5+
"anime_show_studio" : true,
6+
"anime_show_season" : true,
7+
"anime_show_genres" : false,
8+
"anime_show_status" : true,
9+
"anime_show_episode" : true,
10+
"anime_show_format" : true,
11+
12+
"manga_show_status" : true,
13+
"manga_show_genres" : true,
14+
"manga_show_chapter" : true,
15+
"manga_show_volume" : true,
16+
17+
"char_show_birthdate": true,
18+
"char_show_gender" : true,
19+
"char_show_age" : true,
20+
"char_name_format" : "full",
21+
"comment_2" : "char_name_format can be can be first, last, full, or native",
22+
23+
"per_page" : 10
24+
}

aniinfo/main.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22
import sys
33
from .data import anime
44

5-
def help():
5+
def main():
66
args = sys.argv
77
if len(args) == 1:
8-
print('''$ aniinfo -a <anime name>\
9-
to config, paste content of https://github.com/r4yish/aniinfo/blob/main/aniinfo/data/config.json\
10-
to $HOME/.config/aniinfo/config.json''')
8+
print('''$ aniinfo -a <anime name>
9+
to config, paste content of https://github.com/r4yish/aniinfo/blob/main/aniinfo/data/config.json
10+
to $HOME/.config/aniinfo/config.json''')
11+
sys.exit()
1112

12-
parser = argparse.ArgumentParser()
13-
parser.add_argument("--anime", '-a')
14-
parser.add_argument("--manga", '-m')
15-
parser.add_argument("--characters", '-c')
16-
parser.add_argument("--page", '-p')
17-
args = parser.parse_args()
13+
parser = argparse.ArgumentParser()
14+
parser.add_argument("--anime", '-a')
15+
parser.add_argument("--manga", '-m')
16+
parser.add_argument("--characters", '-c')
17+
parser.add_argument("--page", '-p')
18+
args = parser.parse_args()
1819

19-
if args.anime:
20-
anime.search_anime(args.anime, args.page)
20+
if args.anime:
21+
anime.search_anime(args.anime, args.page)
2122

22-
elif args.manga:
23-
anime.search_manga(args.manga, args.page)
23+
elif args.manga:
24+
anime.search_manga(args.manga, args.page)
2425

25-
elif args.characters:
26-
anime.search_char(args.characters, args.page)
26+
elif args.characters:
27+
anime.search_char(args.characters, args.page)

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ def read_requirements():
1010

1111
setup(
1212
name='aniinfo',
13-
version='0.4.6',
13+
version='0.4.7',
1414
packages=['aniinfo', 'aniinfo/data'],
1515
data_files=[('config', ['aniinfo/data/config.json'])],
1616
include_package_data=True,
1717
install_requires=read_requirements(),
1818
entry_points='''
1919
[console_scripts]
20-
aniinfo=aniinfo.main:help
20+
aniinfo=aniinfo.main:main
2121
'''
2222
)

0 commit comments

Comments
 (0)