删除调试日志
This commit is contained in:
parent
2fc67a0082
commit
b42ca46218
@ -70,14 +70,9 @@ def extract_package(zip_path: str) -> Dict[str, Any]:
|
|||||||
@handle_errors
|
@handle_errors
|
||||||
def analyze_package(temp_dir: str) -> Dict[str, Any]:
|
def analyze_package(temp_dir: str) -> Dict[str, Any]:
|
||||||
"""分析安装包结构"""
|
"""分析安装包结构"""
|
||||||
print(f"[DEBUG] analyze_package called with temp_dir: {temp_dir}")
|
|
||||||
|
|
||||||
# 查找根目录
|
# 查找根目录
|
||||||
root_items = os.listdir(temp_dir)
|
root_items = os.listdir(temp_dir)
|
||||||
print(f"[DEBUG] temp_dir contents: {root_items}")
|
|
||||||
|
|
||||||
root_dir = os.path.join(temp_dir, root_items[0]) if len(root_items) == 1 and os.path.isdir(os.path.join(temp_dir, root_items[0])) else temp_dir
|
root_dir = os.path.join(temp_dir, root_items[0]) if len(root_items) == 1 and os.path.isdir(os.path.join(temp_dir, root_items[0])) else temp_dir
|
||||||
print(f"[DEBUG] resolved root_dir: {root_dir}")
|
|
||||||
|
|
||||||
package_info = {
|
package_info = {
|
||||||
'app_name': os.path.basename(root_dir),
|
'app_name': os.path.basename(root_dir),
|
||||||
@ -90,8 +85,6 @@ def analyze_package(temp_dir: str) -> Dict[str, Any]:
|
|||||||
'root_dir': root_dir # 保存根目录路径
|
'root_dir': root_dir # 保存根目录路径
|
||||||
}
|
}
|
||||||
|
|
||||||
print(f"[DEBUG] initial app_name from basename: {package_info['app_name']}")
|
|
||||||
|
|
||||||
# 检查配置文件
|
# 检查配置文件
|
||||||
if os.path.exists(os.path.join(root_dir, 'setup.py')):
|
if os.path.exists(os.path.join(root_dir, 'setup.py')):
|
||||||
package_info['has_backend'] = True
|
package_info['has_backend'] = True
|
||||||
@ -119,7 +112,6 @@ def analyze_package(temp_dir: str) -> Dict[str, Any]:
|
|||||||
break
|
break
|
||||||
|
|
||||||
# 从 hooks.py 提取 app_name
|
# 从 hooks.py 提取 app_name
|
||||||
print(f"[DEBUG] hooks_path: {hooks_path}, exists: {os.path.exists(hooks_path)}")
|
|
||||||
if os.path.exists(hooks_path):
|
if os.path.exists(hooks_path):
|
||||||
try:
|
try:
|
||||||
with open(hooks_path, 'r', encoding='utf-8') as f:
|
with open(hooks_path, 'r', encoding='utf-8') as f:
|
||||||
@ -128,13 +120,9 @@ def analyze_package(temp_dir: str) -> Dict[str, Any]:
|
|||||||
name_match = re.search(r'app_name\s*=\s*["\']([^"\']+)["\']', content)
|
name_match = re.search(r'app_name\s*=\s*["\']([^"\']+)["\']', content)
|
||||||
if name_match:
|
if name_match:
|
||||||
package_info['app_name'] = name_match.group(1)
|
package_info['app_name'] = name_match.group(1)
|
||||||
print(f"[DEBUG] extracted app_name from hooks.py: {package_info['app_name']}")
|
except:
|
||||||
except Exception as e:
|
|
||||||
print(f"[DEBUG] failed to extract app_name from hooks.py: {e}")
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
print(f"[DEBUG] final app_name: {package_info['app_name']}")
|
|
||||||
|
|
||||||
package_info['has_hooks'] = os.path.exists(hooks_path)
|
package_info['has_hooks'] = os.path.exists(hooks_path)
|
||||||
|
|
||||||
# 扫描文件
|
# 扫描文件
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user