Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add __main__.py to output basic format and support information
To help debug and show supported formats, users can run: $ python -m PIL to get basic format and support information about the installed version of Pillow. The new feature works as follows: $ python -m PIL -------------------------------------------------------------------- Pillow 6.1.0.dev0 -------------------------------------------------------------------- Python modules loaded from .../Pillow/src/PIL Binary modules loaded from .../Pillow/src/PIL -------------------------------------------------------------------- Python 3.7.3 (default, May 11 2019, 00:38:04) [GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] -------------------------------------------------------------------- --- PIL CORE support ok --- TKINTER support ok --- FREETYPE2 support ok --- LITTLECMS2 support ok --- WEBP support ok --- WEBP Transparency support ok --- WEBPMUX support ok --- WEBP Animation support ok --- JPEG support ok --- OPENJPEG (JPEG2000) support ok --- ZLIB (PNG/ZIP) support ok --- LIBTIFF support ok --- RAQM (Bidirectional Text) support ok -------------------------------------------------------------------- BLP Extensions: .blp Features: open -------------------------------------------------------------------- BMP image/bmp Extensions: .bmp Features: open, save -------------------------------------------------------------------- BUFR Extensions: .bufr Features: open, save -------------------------------------------------------------------- …
- Loading branch information
Showing
4 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from __future__ import unicode_literals | ||
|
||
import os | ||
import subprocess | ||
import sys | ||
from unittest import TestCase | ||
|
||
|
||
class TestMain(TestCase): | ||
def test_main(self): | ||
out = subprocess.check_output([sys.executable, "-m", "PIL"]).decode("utf-8") | ||
lines = out.splitlines() | ||
self.assertEqual(lines[0], "-" * 68) | ||
self.assertTrue(lines[1].startswith("Pillow ")) | ||
self.assertEqual(lines[2], "-" * 68) | ||
self.assertTrue(lines[3].startswith("Python modules loaded from ")) | ||
self.assertTrue(lines[4].startswith("Binary modules loaded from ")) | ||
self.assertEqual(lines[5], "-" * 68) | ||
self.assertTrue(lines[6].startswith("Python ")) | ||
jpeg = ( | ||
os.linesep + | ||
"-" * 68 + os.linesep + | ||
"JPEG image/jpeg" + os.linesep + | ||
"Extensions: .jfif, .jpe, .jpeg, .jpg" + os.linesep + | ||
"Features: open, save" + os.linesep + | ||
"-" * 68 + os.linesep | ||
) | ||
self.assertIn(jpeg, out) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .features import pilinfo | ||
|
||
pilinfo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters