Skip to content

Commit

Permalink
chore: do not use deprecated pkg_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
raimund-schluessler committed Jun 4, 2024
1 parent 25ebe41 commit 98ec632
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bmicro/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def main():
import os
import pkg_resources
from importlib import resources
import sys
import logging

Expand All @@ -13,9 +13,10 @@ def main():
"""
app = QtWidgets.QApplication(sys.argv)
# set window icon
imdir = pkg_resources.resource_filename("bmicro", "img")
icon_path = os.path.join(imdir, "icon.png")
app.setWindowIcon(QtGui.QIcon(icon_path))
ref = resources.files('bmicro') / 'img'
with resources.as_file(ref) as imdir:
icon_path = os.path.join(imdir, "icon.png")
app.setWindowIcon(QtGui.QIcon(icon_path))

window = BMicro()
window.show()
Expand Down

0 comments on commit 98ec632

Please sign in to comment.