Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nathan/Eilisha Shiraini
colorcode
Commits
30d4fc79
Commit
30d4fc79
authored
Sep 27, 2018
by
Nathan/Eilisha Shiraini
Browse files
Added possibility to send image to stdout
parent
ad6cf472
Changes
1
Hide whitespace changes
Inline
Side-by-side
colorcode/cli.py
View file @
30d4fc79
...
...
@@ -7,6 +7,7 @@ including argument parsing and main procedure
"""
import
argparse
import
sys
from
.loader
import
BUILDERS
from
.imgen.interleave
import
INTERLEAVING_MODES
,
BEST_PARSE_MODE
...
...
@@ -167,4 +168,7 @@ def main():
codes
=
[
g
.
encode
()
for
g
in
cgenInstances
]
imgenerator
=
ImGenerator
(
codes
,
**
imgenKwargs
)
imgenerator
.
drawCode
()
imgenerator
.
saveImage
(
outfile
)
if
outfile
==
"-"
:
imgenerator
.
saveImage
(
sys
.
stdout
.
buffer
,
format
=
"png"
)
else
:
imgenerator
.
saveImage
(
outfile
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment