Extract installed helper to standalone
MODIFY
plextraktsync/path.py
plextraktsync/path.py
-import site
from os import getenv, makedirs
from os.path import abspath, dirname, exists, join
@@ -44,13 +43,9 @@ def app_dir(self):
@cached_property
def installed(self):
- """
- Return true if this package is installed to site-packages
- """
- absdir = dirname(dirname(__file__))
- paths = site.getsitepackages()
+ from plextraktsync.util.packaging import installed
- return absdir in paths
+ return installed()
@staticmethod
def ensure_dir(directory):

ADD
plextraktsync/util/packaging.py
+import site
+from os.path import dirname
+
+
+def installed():
+ """
+ Return true if this package is installed to site-packages
+ """
+ absdir = dirname(dirname(dirname(__file__)))
+ paths = site.getsitepackages()
+
+ return absdir in paths

Extract installed helper to standalone