]> git.ipfire.org Git - pbs.git/commitdiff
packages: Drop the unused is_viewable() method
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jul 2025 15:06:12 +0000 (15:06 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jul 2025 15:06:12 +0000 (15:06 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/constants.py.in
src/buildservice/packages.py

index 3a1ecaa448c9b563b4aa3202daedd146fab5aa23..344ae85b3a72b7657292021cb0737033b6636a31 100644 (file)
@@ -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.
index ec8a6b6467e423435263293d3e71091fb98c0e3d..d53af5d27448e1c7fc86e25beaa65bd4f759cfc4 100644 (file)
@@ -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):