Skip to content

Commit 911ff8a

Browse files
committed
try release && test on wins
1 parent d202832 commit 911ff8a

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

jsoncsv/main.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# coding=utf-8
2-
32
import click
4-
import sys
53

64
from jsoncsv import jsontool
75
from jsoncsv import dumptool
@@ -52,11 +50,11 @@ def separator_type(sep):
5250
@click.argument(
5351
'input',
5452
type=click.File('r'),
55-
default=sys.stdin)
53+
default='-')
5654
@click.argument(
5755
'output',
5856
type=click.File('w'),
59-
default=sys.stdout)
57+
default='-')
6058
def jsoncsv(output, input, expand, restore, safe, separator, json_array):
6159
if expand and restore:
6260
raise click.UsageError('can not choose both, default is `-e`')
@@ -94,16 +92,13 @@ def jsoncsv(output, input, expand, restore, safe, separator, json_array):
9492
help='enable sort the headers keys')
9593
@click.argument(
9694
'input',
97-
type=click.File('r'),
98-
default=sys.stdin)
95+
type=click.File('r', encoding='utf-8'),
96+
default='-')
9997
@click.argument(
10098
'output',
10199
type=click.File('wb'),
102-
default=sys.stdout)
100+
default='-')
103101
def mkexcel(output, input, sort_, row, type_):
104-
if output == sys.stdout:
105-
output = click.get_binary_stream('stdout')
106-
107102
klass = dumptool.DumpCSV
108103
if type_ == "xls":
109104
klass = dumptool.DumpXLS

0 commit comments

Comments
 (0)