Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python feature flag compat #1061

Merged
merged 4 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/rpm-matrix.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
{
"props": [
{
"platform": "fedora",
"dist": "fc42",
"spec": "fapolicy-analyzer.spec",
"image": "registry.fedoraproject.org/fedora:42",
"chroot": "fedora-rawhide-x86_64",
"version": "42",
"prerelease": true
},
{
"platform": "fedora",
"dist": "fc41",
Expand Down
6 changes: 3 additions & 3 deletions fapolicy_analyzer/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from typing import Dict, Optional, Sequence, Tuple

import gi
import pkg_resources

from fapolicy_analyzer.ui.strings import (
RESOURCE_LOAD_FAILURE_DIALOG_ADD_TEXT,
RESOURCE_LOAD_FAILURE_DIALOG_TEXT,
Expand All @@ -37,8 +37,8 @@

DOMAIN = "fapolicy_analyzer"
locale.setlocale(locale.LC_ALL, locale.getlocale())
locale_path = pkg_resources.resource_filename("fapolicy_analyzer", "locale")
locale.bindtextdomain(DOMAIN, locale_path)
locale_path = resources.path("fapolicy_analyzer", "locale")
locale.bindtextdomain(DOMAIN, str(locale_path))
locale.textdomain(DOMAIN)

_RESOURCES: Dict[str, str] = {}
Expand Down
12 changes: 9 additions & 3 deletions fapolicy_analyzer/ui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import logging
import os
import json
from fapolicy_analyzer.ui.stats import StatsViewPage

from locale import gettext as _
from os import getenv, geteuid, path
from threading import Thread
Expand All @@ -27,6 +27,10 @@

import fapolicy_analyzer.ui.strings as strings
from fapolicy_analyzer import System, is_audit_available, is_stats_available

if is_stats_available():
from fapolicy_analyzer.ui.stats import StatsViewPage

from fapolicy_analyzer import __version__ as app_version
from fapolicy_analyzer.ui import get_resource
from fapolicy_analyzer.ui.action_toolbar import ActionToolbar
Expand Down Expand Up @@ -82,8 +86,10 @@ def router(page: PAGE_SELECTION, *data) -> UIPage:
PAGE_SELECTION.PROFILER: ProfilerPage,
PAGE_SELECTION.CONFIG: ConfigAdminPage,
PAGE_SELECTION.TRUST_FILTER: TrustFilterAdminPage,
PAGE_SELECTION.STATS_VIEW: StatsViewPage,
}.get(page, RulesAdminPage)
}
if is_stats_available():
route[PAGE_SELECTION.STATS_VIEW] = StatsViewPage
route = route.get(page, route)
return route(*data)


Expand Down
1 change: 0 additions & 1 deletion scripts/srpm/fapolicy-analyzer.el9.spec
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ Requires: python3-more-itertools
Requires: python3-rx
Requires: python3-importlib-metadata
Requires: python3-toml
Requires: python3-matplotlib-gtk3

Requires: gtk3
Requires: gtksourceview3
Expand Down
Loading