From: Michael Tremer Date: Thu, 10 Jul 2025 15:06:12 +0000 (+0000) Subject: packages: Drop the unused is_viewable() method X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4ce40cf6eeb8a3cb6a56adf2f96153ac5153db7;p=pbs.git packages: Drop the unused is_viewable() method Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/constants.py.in b/src/buildservice/constants.py.in index 3a1ecaa4..344ae85b 100644 --- a/src/buildservice/constants.py.in +++ b/src/buildservice/constants.py.in @@ -6,38 +6,6 @@ LOCALEDIR = "@localedir@" TEMPLATESDIR = "@templatesdir@" STATICDIR = "@staticdir@" -FILE_EXTENSIONS_VIEWABLE = ( - ".c", - ".cc", - ".cfg", - ".conf", - ".config", - ".cpp", - ".diff", - ".h", - ".nm", - ".patch", - ".patch0", - ".patch1", - ".patch2", - ".patch3", - ".patch4", - ".patch5", - ".patch6", - ".patch7", - ".patch8", - ".patch9", - ".pl", - ".pm", - ".py", - ".S", - ".s", - ".sh", - ".txt", - "Kconfig", - "Makefile", -) - # Bug update messages. BUG_TESTING_MSG = """\ %(package_name)s has been pushed to the %(distro_name)s %(repo_name)s repository. diff --git a/src/buildservice/packages.py b/src/buildservice/packages.py index ec8a6b64..d53af5d2 100644 --- a/src/buildservice/packages.py +++ b/src/buildservice/packages.py @@ -751,23 +751,6 @@ class File(sqlmodel.SQLModel, table=True): # All regular files are downloadable return self.type == stat.S_IFREG - # Viewable? - - def is_viewable(self): - # Empty files cannot be viewed. - if self.size == 0: - return False - - # Files that are of type text/* are viewable - if self.mimetype and self.mimetype.startswith("text/"): - return True - - for ext in FILE_EXTENSIONS_VIEWABLE: - if self.path.endswith(ext): - return True - - return False - # Send Payload async def open(self):