From 27ca872db30aaa59bea67f0ac0cfb441497b1ec7 Mon Sep 17 00:00:00 2001 From: Louie S Date: Sun, 2 Apr 2023 19:50:51 -0700 Subject: Fix local import --- backend/__pycache__/config.cpython-39.pyc | Bin 413 -> 426 bytes backend/endpoints/get_plist.py | 8 +++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/__pycache__/config.cpython-39.pyc b/backend/__pycache__/config.cpython-39.pyc index 92c0291..662d54d 100644 Binary files a/backend/__pycache__/config.cpython-39.pyc and b/backend/__pycache__/config.cpython-39.pyc differ diff --git a/backend/endpoints/get_plist.py b/backend/endpoints/get_plist.py index 76275b7..cfa56bf 100644 --- a/backend/endpoints/get_plist.py +++ b/backend/endpoints/get_plist.py @@ -2,8 +2,10 @@ import json import logging import os import plistlib +import sys -from ..config import Config +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from config import Config output = dict() output["paths"] = [] @@ -11,13 +13,13 @@ output["paths"] = [] def find_plist(path): with os.scandir(path) as it: for entry in it: - if entry.name == "." or entry.name == "..": + if entry.name == "." or entry.name == ".." or entry.name == "Resources": continue if(os.DirEntry.is_dir(entry)): find_plist(path + "/" + entry.name) elif(entry.name == "Info.plist"): #parse_plist(path + "/" + entry.name) - output["paths"] += path + "/" + entry.name + output["paths"].append(path + "/" + entry.name) def parse_plist(path): with open(path, "rb") as fp: -- cgit