File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ classifiers = [
2525requires-python = " >=3.7"
2626dependencies = [
2727 " packaging" ,
28- " importlib_resources" ,
2928 " dbus-next;sys_platform=='linux'" ,
3029 " rubicon-objc;sys_platform=='darwin'" ,
3130 " winsdk==1.0.0b9;sys_platform=='win32'" ,
Original file line number Diff line number Diff line change 1010import logging
1111from enum import Enum
1212from collections import deque
13+ from pathlib import Path
1314from typing import (
1415 Dict ,
1516 Callable ,
1617 Any ,
1718 Deque ,
1819 List ,
1920 Sequence ,
21+ ContextManager ,
2022)
21- from pathlib import Path
2223
23- from importlib_resources import files , as_file
24+ try :
25+ from importlib .resources import as_file , files
26+
27+ def resource_path (package : str , resource : str ) -> ContextManager [Path ]:
28+ return as_file (files (package ) / resource )
29+
30+ except ImportError :
31+ from importlib .resources import path as resource_path
2432
2533
2634logger = logging .getLogger (__name__ )
2735
28- PYTHON_ICON_PATH : Path = as_file (
29- files ("desktop_notifier.resources" ).joinpath ("python.png" ) # type: ignore
30- ).__enter__ ()
36+ PYTHON_ICON_PATH = resource_path ("desktop_notifier.resources" , "python.png" ).__enter__ ()
3137
3238
3339class AuthorisationError (Exception ):
You can’t perform that action at this time.
0 commit comments