Skip to content

Commit

Permalink
gui: don't make Polkit a hard dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
SeeSpotRun committed Apr 20, 2021
1 parent 6db7402 commit 459e7a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion gui/shredder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
gi.require_version('Gtk', '3.0')
gi.require_version('Rsvg', '2.0')
gi.require_version('PangoCairo', '1.0')
gi.require_version('Polkit', '1.0')
gi.require_version('GtkSource', '3.0')

# Name of your application:
Expand Down
8 changes: 4 additions & 4 deletions gui/shredder/views/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import time
import logging

LOGGER = logging.getLogger('editor')

# External:
from gi.repository import Gtk
from gi.repository import GLib
Expand All @@ -25,6 +27,7 @@
try:
from gi.repository import Polkit
except ImportError:
LOGGER.warning("Warning: failed to import Polkit, root option will not be enabled")
Polkit = None

# Internal:
Expand All @@ -33,9 +36,6 @@
from shredder.runner import Script


LOGGER = logging.getLogger('editor')


REMOVED_LABEL = '''<big>{s}</big><small> {n} removed</small>
<small>Currently {t}</small> <b><big>{p}</big></b>
'''
Expand Down Expand Up @@ -125,7 +125,7 @@ def _set_source_lang(view, lang):
# Fallback to the normal Gtk.TextView if no GtkSource.View could be imported
# This is the bare minimum we support. It's neither pretty nor very useful.
except ImportError:

LOGGER.warning("Warning: failed to import GtkSource, bare minimum editor only")
def _create_source_view():
"""Create a suitable text view + buffer for showing a sh script."""
LOGGER.info('No GtkSourceView found.')
Expand Down

0 comments on commit 459e7a3

Please sign in to comment.