Skip to content

Commit

Permalink
replace deprecated pkg_resources ⇒ importlib
Browse files Browse the repository at this point in the history
  • Loading branch information
yktoo committed Aug 18, 2024
1 parent bb6005e commit 708d736
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/indicator_sound_switcher/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import fcntl
import gettext

from .indicator import SoundSwitcherIndicator, APP_ID
from .indicator import SoundSwitcherIndicator, APP_ID, APP_NAME, APP_VERSION


def _parse_cmd_line():
Expand Down Expand Up @@ -62,8 +62,8 @@ def main():
fcntl.lockf(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)

# Instantiate and run the indicator
logging.info('Starting indicator application')
logging.info('%s v%s', APP_NAME, APP_VERSION)
SoundSwitcherIndicator().run()

except OSError:
logging.info('Indicator is already running, exiting')
logging.info('%s is already running, exiting', APP_NAME)
4 changes: 2 additions & 2 deletions lib/indicator_sound_switcher/indicator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os.path
import logging
import time
import pkg_resources
from importlib.metadata import version

import gi

Expand Down Expand Up @@ -38,7 +38,7 @@
with this program. If not, see http://www.gnu.org/licenses/"""

# Determine app version
APP_VERSION = pkg_resources.require(APP_ID)[0].version
APP_VERSION = version(APP_ID)

YESNO = {False: 'No', True: 'Yes'}

Expand Down

0 comments on commit 708d736

Please sign in to comment.