summaryrefslogtreecommitdiffstats
path: root/contrib/python/Pillow/py3/PIL/GribStubImagePlugin.py
diff options
context:
space:
mode:
authormaxim-yurchuk <[email protected]>2025-02-11 13:26:52 +0300
committermaxim-yurchuk <[email protected]>2025-02-11 13:57:59 +0300
commitf895bba65827952ed934b2b46f9a45e30a191fd2 (patch)
tree03260c906d9ec41cdc03e2a496b15d407459cec0 /contrib/python/Pillow/py3/PIL/GribStubImagePlugin.py
parent5f7060466f7b9707818c2091e1a25c14f33c3474 (diff)
Remove deps on pandas
<https://github.com/ydb-platform/ydb/pull/14418> <https://github.com/ydb-platform/ydb/pull/14419> \-- аналогичные правки в gh Хочу залить в обход синка, чтобы посмотреть удалится ли pandas в нашей gh репе через piglet commit_hash:abca127aa37d4dbb94b07e1e18cdb8eb5b711860
Diffstat (limited to 'contrib/python/Pillow/py3/PIL/GribStubImagePlugin.py')
-rw-r--r--contrib/python/Pillow/py3/PIL/GribStubImagePlugin.py74
1 files changed, 0 insertions, 74 deletions
diff --git a/contrib/python/Pillow/py3/PIL/GribStubImagePlugin.py b/contrib/python/Pillow/py3/PIL/GribStubImagePlugin.py
deleted file mode 100644
index f8106800c42..00000000000
--- a/contrib/python/Pillow/py3/PIL/GribStubImagePlugin.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#
-# The Python Imaging Library
-# $Id$
-#
-# GRIB stub adapter
-#
-# Copyright (c) 1996-2003 by Fredrik Lundh
-#
-# See the README file for information on usage and redistribution.
-#
-from __future__ import annotations
-
-from . import Image, ImageFile
-
-_handler = None
-
-
-def register_handler(handler):
- """
- Install application-specific GRIB image handler.
-
- :param handler: Handler object.
- """
- global _handler
- _handler = handler
-
-
-# --------------------------------------------------------------------
-# Image adapter
-
-
-def _accept(prefix):
- return prefix[:4] == b"GRIB" and prefix[7] == 1
-
-
-class GribStubImageFile(ImageFile.StubImageFile):
- format = "GRIB"
- format_description = "GRIB"
-
- def _open(self):
- offset = self.fp.tell()
-
- if not _accept(self.fp.read(8)):
- msg = "Not a GRIB file"
- raise SyntaxError(msg)
-
- self.fp.seek(offset)
-
- # make something up
- self._mode = "F"
- self._size = 1, 1
-
- loader = self._load()
- if loader:
- loader.open(self)
-
- def _load(self):
- return _handler
-
-
-def _save(im, fp, filename):
- if _handler is None or not hasattr(_handler, "save"):
- msg = "GRIB save handler not installed"
- raise OSError(msg)
- _handler.save(im, fp, filename)
-
-
-# --------------------------------------------------------------------
-# Registry
-
-Image.register_open(GribStubImageFile.format, GribStubImageFile, _accept)
-Image.register_save(GribStubImageFile.format, _save)
-
-Image.register_extension(GribStubImageFile.format, ".grib")