Import pyte

This commit is contained in:
Kovid Goyal
2016-10-14 13:23:50 +05:30
parent de072b3b42
commit d993a5732f
13 changed files with 2550 additions and 1 deletions

33
pyte/__main__.py Normal file
View File

@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
"""
pyte
~~~~
Command-line tool for "disassembling" escape and CSI sequences::
$ echo -e "\e[Jfoo" | python -m pyte
ERASE_IN_DISPLAY 0
DRAW f
DRAW o
DRAW o
LINEFEED
$ python -m pyte foo
DRAW f
DRAW o
DRAW o
:copyright: (c) 2011-2012 by Selectel.
:copyright: (c) 2012-2016 by pyte authors and contributors,
see AUTHORS for details.
:license: LGPL, see LICENSE for more details.
"""
if __name__ == "__main__":
import sys
import pyte
if len(sys.argv) == 1:
pyte.dis(sys.stdin.read())
else:
pyte.dis("".join(sys.argv[1:]))