本文整理汇总了Python中PIL.__version__方法的典型用法代码示例。如果您正苦于以下问题:Python PIL.__version__方法的具体用法?Python PIL.__version__怎么用?Python PIL.__version__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PIL
的用法示例。
在下文中一共展示了PIL.__version__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: about
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def about(self, *args):
dialog = Gtk.AboutDialog(transient_for=self)
dialog.set_logo_icon_name('io.github.ImEditor')
dialog.set_program_name('ImEditor')
dialog.set_version('0.9.4')
dialog.set_website('https://imeditor.github.io')
dialog.set_authors(['Nathan Seva', 'Hugo Posnic'])
gtk_version = '{}.{}.{}'.format(Gtk.get_major_version(),
Gtk.get_minor_version(), Gtk.get_micro_version())
comment = '{}\n\n'.format(_("Simple & versatile image editor"))
comment += 'Gtk: {} Pillow: {}'.format(gtk_version, pil_version)
dialog.set_comments(comment)
text = _("Distributed under the GNU GPL(v3) license.\n")
text += 'https://github.com/ImEditor/ImEditor/blob/master/LICENSE\n'
dialog.set_license(text)
dialog.run()
dialog.destroy()
示例2: handler
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def handler(data, context):
"""Handle request.
Args:
data (obj): the request data
context (Context): an object containing request and configuration details
Returns:
(bytes, string): data to return to client, (optional) response content type
"""
# use the imported library
print('pillow: {}\n{}'.format(PIL.__version__, dir(_imaging)))
processed_input = _process_input(data, context)
response = requests.post(context.rest_uri, data=processed_input)
return _process_output(response, context)
示例3: check6_bsddb3
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def check6_bsddb3(self):
'''bsddb3 - Python Bindings for Oracle Berkeley DB
requires Berkeley DB
PY_BSDDB3_VER_MIN = (6, 0, 1) # 6.x series at least
'''
self.append_text("\n")
# Start check
try:
import bsddb3 as bsddb
bsddb_str = bsddb.__version__ # Python adaptation layer
# Underlying DB library
bsddb_db_str = str(bsddb.db.version()).replace(', ', '.')\
.replace('(', '').replace(')', '')
except ImportError:
bsddb_str = 'not found'
bsddb_db_str = 'not found'
result = ("* Berkeley Database library (bsddb3: " + bsddb_db_str +
") (Python-bsddb3 : " + bsddb_str + ")")
# End check
self.append_text(result)
示例4: check_fontconfig
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def check_fontconfig(self):
''' The python-fontconfig library is used to support the Genealogical
Symbols tab of the Preferences. Without it Genealogical Symbols don't
work '''
try:
import fontconfig
vers = fontconfig.__version__
if vers.startswith("0.5."):
result = ("* python-fontconfig " + vers +
" (Success version 0.5.x is installed.)")
else:
result = ("* python-fontconfig " + vers +
" (Requires version 0.5.x)")
except ImportError:
result = "* python-fontconfig Not found, (Requires version 0.5.x)"
# End check
self.append_text(result)
#Optional
示例5: check23_pedigreechart
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def check23_pedigreechart(self):
'''PedigreeChart - Can optionally use - NumPy if installed
https://github.com/gramps-project/addons-source/blob/master/PedigreeChart/PedigreeChart.py
'''
self.append_text("\n")
self.render_text("""<b>03. <a href="https://gramps-project.org/wiki"""
"""/index.php?title=PedigreeChart">"""
"""Addon:PedigreeChart</a> :</b> """)
# Start check
try:
import numpy
numpy_ver = str(numpy.__version__)
#print("numpy.__version__ :" + numpy_ver )
# NUMPY_check = True
except ImportError:
numpy_ver = "Not found"
# NUMPY_check = False
result = "(NumPy : " + numpy_ver + " )"
# End check
self.append_text(result)
#self.append_text("\n")
示例6: test_pyroma
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def test_pyroma(self):
# Arrange
data = pyroma.projectdata.get_data(".")
# Act
rating = pyroma.ratings.rate(data)
# Assert
if "rc" in __version__:
# Pyroma needs to chill about RC versions and not kill all our tests.
self.assertEqual(
rating,
(9, ["The package's version number does not comply with PEP-386."]),
)
else:
# Should have a near-perfect score
self.assertEqual(rating, (9, ["Your package does not have license data."]))
示例7: __call__
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def __call__(self, imgs, point_meta):
"""
Args:
img (PIL.Image): Image to be cropped.
point_meta : Point_Meta
Returns:
PIL.Image: Rotated image.
"""
point_meta = point_meta.copy()
if isinstance(imgs, list): is_list = True
else: is_list, imgs = False, [imgs]
degree = (random.random() - 0.5) * 2 * self.max_rotate_degree
center = (imgs[0].size[0] / 2, imgs[0].size[1] / 2)
if PIL.__version__[0] == '4':
imgs = [ img.rotate(degree, center=center) for img in imgs ]
else:
imgs = [ img.rotate(degree) for img in imgs ]
point_meta.apply_rotate(center, degree)
point_meta.apply_bound(imgs[0].size[0], imgs[0].size[1])
if is_list == False: imgs = imgs[0]
return imgs, point_meta
示例8: get_lib_versions
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def get_lib_versions():
versions = {}
#PIL
try:
import PIL
versions["PIL"] = PIL.__version__
except ImportError:
versions["PIL"] = "Not found!"
#PLY
try:
from ply import lex
versions["PLY"] = lex.__version__
except ImportError:
versions["PLY"] = "Not found!"
return versions
示例9: get_nml_version
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def get_nml_version():
# First check if this is a git repository, and use that version if available.
# (unless this is a released tarball, see below)
try:
from nml import version_update
version = version_update.get_git_version()
if version:
return version
except ImportError:
# version_update is excluded from release tarballs,
# so that the predetermined version is always used.
pass
# No repository was found. Return the version which was saved upon build.
try:
from nml import __version__
version = __version__.version
except ImportError:
version = 'unknown'
return version
示例10: prepare_logger
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def prepare_logger(xargs):
args = copy.deepcopy( xargs )
from log_utils import Logger
logger = Logger(args.save_dir, args.rand_seed)
logger.log('Main Function with logger : {:}'.format(logger))
logger.log('Arguments : -------------------------------')
for name, value in args._get_kwargs():
logger.log('{:16} : {:}'.format(name, value))
logger.log("Python Version : {:}".format(sys.version.replace('\n', ' ')))
logger.log("Pillow Version : {:}".format(PIL.__version__))
logger.log("PyTorch Version : {:}".format(torch.__version__))
logger.log("cuDNN Version : {:}".format(torch.backends.cudnn.version()))
logger.log("CUDA available : {:}".format(torch.cuda.is_available()))
logger.log("CUDA GPU numbers : {:}".format(torch.cuda.device_count()))
logger.log("CUDA_VISIBLE_DEVICES : {:}".format(os.environ['CUDA_VISIBLE_DEVICES'] if 'CUDA_VISIBLE_DEVICES' in os.environ else 'None'))
return logger
示例11: get_pil_version
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def get_pil_version():
return "\n Pillow ({})".format(PIL.__version__)
示例12: get_config_values
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def get_config_values():
"""
Read the package versions into a dictionary.
"""
output = OrderedDict()
output["MONAI"] = monai.__version__
output["Python"] = sys.version.replace("\n", " ")
output["Numpy"] = np.version.full_version
output["Pytorch"] = torch.__version__
return output
示例13: get_torch_version_tuple
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def get_torch_version_tuple():
"""
Returns:
tuple of ints represents the pytorch major/minor version.
"""
return tuple([int(x) for x in torch.__version__.split(".")[:2]])
示例14: check17_pillow
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def check17_pillow(self):
'''PILLOW
Allows Production of jpg images from non-jpg images in LaTeX documents
#TODO prculley mentions that : And PIL (Pillow) is also used by the
main Gramps ([]narrativeweb and []other reports for image cropping)
as well as [x]editexifmetadata and the
new [x]latexdoc type addons (genealogytree).
#TODO add check for PILLOW to "gramps -v" section
https://github.com/gramps-project/gramps/blob/maintenance/gramps50/gramps/plugins/docgen/latexdoc.py
'''
#self.append_text("\n")
# Start check
try:
import PIL
# from PIL import Image
try:
pil_ver = PIL.__version__
except Exception:
try:
pil_ver = str(PIL.PILLOW_VERSION)
except Exception:
try:
#print(dir(PIL))
pil_ver = str(PIL.VERSION)
except Exception:
pil_ver = "Installed but does not supply version"
except ImportError:
pil_ver = "Not found"
result = "(PILLOW " + pil_ver + ")"
# End check
self.append_text(result)
示例15: collect_env_info
# 需要导入模块: import PIL [as 别名]
# 或者: from PIL import __version__ [as 别名]
def collect_env_info():
"""Returns env info as a string.
Code source: github.com/facebookresearch/maskrcnn-benchmark
"""
from torch.utils.collect_env import get_pretty_env_info
env_str = get_pretty_env_info()
env_str += '\n Pillow ({})'.format(PIL.__version__)
return env_str