This file is indexed.

/usr/lib/python3/dist-packages/shredder/about.py is in rmlint-gui 2.6.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
#!/usr/bin/env python
# encoding: utf-8

"""Own module for the about dialog."""


# Stdlib:
import re
import logging

# Internal
from shredder import APP_TITLE, APP_DESCRIPTION

# External:
from gi.repository import Gtk, Gio


LOGGER = logging.getLogger('about')


MAIN_AUTHORS = [
    'Christopher Pahl <sahib@online.de>',
    'Daniel Thomas <thomas_d_j@yahoo.com.au>'
]


# Change when needed.
DOCUMENTERS = MAIN_AUTHORS


def _guess_rmlint_version():
    """Execute rmlint --version to extract the version.

    Shredder is always versioned the same way as rmlint.
    This is to make version problems less likely.
    """
    proc = Gio.Subprocess.new(
        ['rmlint', '--version'],
        Gio.SubprocessFlags.STDERR_PIPE
    )
    result, _, data = proc.communicate_utf8()
    if result and data:
        match = re.search(r'version (\d.\d.\d)', data)
        if match:
            return match.group(1)

    return '?.?.?'


class AboutDialog(Gtk.AboutDialog):
    """GtkAboutDialog for Shreddder"""
    def __init__(self, app_win):
        Gtk.AboutDialog.__init__(self)

        try:
            buttons = list(self.get_action_area())
            close_button = buttons[2]
            close_button.connect('clicked', lambda _: self.destroy())
            license_button = buttons[1]
            license_button.set_no_show_all(True)
        except IndexError:
            LOGGER.error('GtkAboutDialog layout changed...')

        self.set_transient_for(app_win)
        self.set_modal(True)
        self.set_license_type(Gtk.License.GPL_3_0)
        self.set_comments(APP_DESCRIPTION)
        self.set_wrap_license(True)
        self.set_program_name(APP_TITLE)
        self.set_version(_guess_rmlint_version())
        self.set_authors(MAIN_AUTHORS)
        self.set_documenters(DOCUMENTERS)
        self.set_website('http://rmlint.rtfd.org')
        self.set_website_label('rmlint.rtfd.org')
        self.set_logo(None)
        self.show_all()


if __name__ == '__main__':
    def main():
        """Show the about dialog as modal window."""
        import os
        from shredder.application import _load_app_icon

        win = Gtk.Window()
        win.connect('destroy', Gtk.main_quit)
        win.show_all()

        rel_dir = os.path.dirname(__file__)
        resource_file = os.path.join(rel_dir, 'resources/shredder.gresource')
        resource_bundle = Gio.Resource.load(resource_file)
        Gio.resources_register(resource_bundle)
        win.set_default_icon(_load_app_icon())

        about = AboutDialog(win)
        about.show()

        Gtk.main()

    main()