mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
Allow charset <CharSet> with gam batch, like gam csv
This commit is contained in:
@@ -10534,9 +10534,13 @@ def ProcessGAMCommand(args):
|
|||||||
command = sys.argv[1].lower()
|
command = sys.argv[1].lower()
|
||||||
if command == u'batch':
|
if command == u'batch':
|
||||||
import shlex
|
import shlex
|
||||||
f = openFile(sys.argv[2])
|
i = 2
|
||||||
|
filename = sys.argv[i]
|
||||||
|
i, encoding = getCharSet(i+1)
|
||||||
|
f = openFile(filename)
|
||||||
|
batchFile = UTF8Recoder(f, encoding) if encoding != u'utf-8' else f
|
||||||
items = []
|
items = []
|
||||||
for line in f:
|
for line in batchFile:
|
||||||
argv = shlex.split(line)
|
argv = shlex.split(line)
|
||||||
if not argv:
|
if not argv:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user