Skip to content

Commit 227eef4

Browse files
authored
Merge pull request #5 from Vopaaz/dev
Make setting format not depend on having input file
2 parents 41016e5 + 4da4df6 commit 227eef4

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

cnki2bibtex/cnki2bib.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ def launch(inputfile, copy, outputdefault, outputfile, id_format):
3131
3232
INPUTFILE: Optional. The input .net file to be converted. If left empty, the contents in the clipboard will be used.'''
3333

34-
if not copy and not outputdefault and not outputfile:
34+
if id_format:
35+
setIDFormat(id_format)
36+
click.echo(f"Id format set to {id_format}")
37+
38+
if not copy and not outputdefault and not outputfile and not id_format:
3539
click.echo("Why are you calling me ???")
3640
return
3741

@@ -40,9 +44,6 @@ def launch(inputfile, copy, outputdefault, outputfile, id_format):
4044
logging.warning(
4145
"The input file may not be a NoteExpress Entries file.")
4246

43-
if id_format:
44-
setIDFormat(id_format)
45-
4647
try:
4748
with open(inputfile, 'r', encoding="utf-8") as f:
4849
cnkiNetFileContent = f.read()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='cnki2bib',
8-
version='0.2.5',
8+
version='0.2.6',
99
author='Vopaaz',
1010
author_email="liyifan945@163.com",
1111
url="https://github.com/Vopaaz/CNKI_2_BibTeX",

0 commit comments

Comments
 (0)