clapp-pm 1.0.41__py3-none-any.whl → 1.0.43__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {clapp_pm-1.0.41.data → clapp_pm-1.0.43.data}/data/version.json +1 -1
- {clapp_pm-1.0.41.dist-info → clapp_pm-1.0.43.dist-info}/METADATA +1 -1
- {clapp_pm-1.0.41.dist-info → clapp_pm-1.0.43.dist-info}/RECORD +33 -9
- packages/cloud-calc/README.md +93 -0
- packages/cloud-calc/clapp-packages-repo/README.md +46 -0
- packages/cloud-calc/clapp-packages-repo/index.json +40 -0
- packages/cloud-calc/clapp-packages-repo/packages.json +40 -0
- packages/cloud-calc/main.py +364 -0
- packages/cloud-calc/manifest.json +8 -0
- packages/cloud-calc/requirements.txt +1 -0
- packages/pycloudos/README.md +279 -0
- packages/pycloudos/main.py +193 -0
- packages/pycloudos/manifest.json +15 -0
- packages/pycloudos/pycloud_fs/home/Desktop/test_desktop_file.txt +11 -0
- packages/pycloudos/pycloud_fs/home/default/Desktop/test_dosya.txt +1 -0
- packages/pycloudos/pycloud_fs/home/default/Desktop/test_script.py +11 -0
- packages/pycloudos/rain/__init__.py +7 -0
- packages/pycloudos/rain/dock.py +722 -0
- packages/pycloudos/rain/flet_html_widgets.py +0 -0
- packages/pycloudos/rain/theme.py +930 -0
- packages/pycloudos/rain/ui.py +381 -0
- packages/pycloudos/rain/wallpaper.py +830 -0
- packages/pycloudos/rain/widgets.py +688 -0
- packages/pycloudos/rain/windowmanager.py +605 -0
- packages/pycloudos/requirements-dev.txt +43 -0
- packages/pycloudos/requirements.txt +43 -0
- packages/pycloudos/setup_deps.py +422 -0
- publish_command.py +32 -44
- version.py +1 -1
- {clapp_pm-1.0.41.dist-info → clapp_pm-1.0.43.dist-info}/WHEEL +0 -0
- {clapp_pm-1.0.41.dist-info → clapp_pm-1.0.43.dist-info}/entry_points.txt +0 -0
- {clapp_pm-1.0.41.dist-info → clapp_pm-1.0.43.dist-info}/licenses/LICENSE +0 -0
- {clapp_pm-1.0.41.dist-info → clapp_pm-1.0.43.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,422 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
PyCloud OS Dependency Setup Script
|
4
|
+
Bağımlılıkları yükler ve kontrol eder - Cursorrules Enhanced
|
5
|
+
"""
|
6
|
+
|
7
|
+
import sys
|
8
|
+
import subprocess
|
9
|
+
import importlib
|
10
|
+
import json
|
11
|
+
from pathlib import Path
|
12
|
+
from typing import Dict, List, Tuple, Optional, Set
|
13
|
+
|
14
|
+
# Gerekli paketler ve import isimleri
|
15
|
+
REQUIRED_PACKAGES = {
|
16
|
+
"PyQt6": "PyQt6",
|
17
|
+
"PyQt6-WebEngine": "PyQt6.QtWebEngineWidgets",
|
18
|
+
"Pillow": "PIL",
|
19
|
+
"psutil": "psutil",
|
20
|
+
"requests": "requests",
|
21
|
+
"pyserial": "serial",
|
22
|
+
"Flask": "flask",
|
23
|
+
"jsonschema": "jsonschema"
|
24
|
+
}
|
25
|
+
|
26
|
+
# Opsiyonel paketler
|
27
|
+
OPTIONAL_PACKAGES = {
|
28
|
+
"pytest": "pytest",
|
29
|
+
"black": "black",
|
30
|
+
"flake8": "flake8",
|
31
|
+
"sphinx": "sphinx"
|
32
|
+
}
|
33
|
+
|
34
|
+
# Yeni cursorrules özellikler için desteklenen çekirdek modüller
|
35
|
+
SUPPORTED_CORE_MODULES = {
|
36
|
+
"core.fs": "Dosya sistemi erişimi",
|
37
|
+
"core.config": "Yapılandırma sistemi",
|
38
|
+
"core.events": "Olay sistemi",
|
39
|
+
"core.notify": "Bildirim sistemi",
|
40
|
+
"core.users": "Kullanıcı sistemi",
|
41
|
+
"core.security": "Güvenlik sistemi",
|
42
|
+
"core.process": "İşlem yönetimi",
|
43
|
+
"core.thread": "Thread yönetimi",
|
44
|
+
"core.memory": "Bellek yönetimi",
|
45
|
+
"core.audio": "Ses sistemi",
|
46
|
+
"core.network": "Ağ erişimi"
|
47
|
+
}
|
48
|
+
|
49
|
+
# Desteklenen izin türleri
|
50
|
+
SUPPORTED_PERMISSIONS = {
|
51
|
+
"fs.read": "Dosya okuma izni",
|
52
|
+
"fs.write": "Dosya yazma izni",
|
53
|
+
"network": "Ağ erişim izni",
|
54
|
+
"audio": "Ses sistemi izni",
|
55
|
+
"camera": "Kamera erişim izni",
|
56
|
+
"microphone": "Mikrofon erişim izni",
|
57
|
+
"location": "Konum erişim izni",
|
58
|
+
"notifications": "Bildirim gönderme izni",
|
59
|
+
"system": "Sistem seviyesi erişim izni",
|
60
|
+
"clipboard": "Pano erişim izni",
|
61
|
+
"processes": "İşlem yönetimi izni",
|
62
|
+
"threads": "Thread yönetimi izni"
|
63
|
+
}
|
64
|
+
|
65
|
+
def check_python_version() -> bool:
|
66
|
+
"""Python versiyonunu kontrol et"""
|
67
|
+
version = sys.version_info
|
68
|
+
if version.major < 3 or (version.major == 3 and version.minor < 8):
|
69
|
+
print(f"❌ Python 3.8+ gerekli, mevcut: {version.major}.{version.minor}")
|
70
|
+
return False
|
71
|
+
|
72
|
+
print(f"✅ Python {version.major}.{version.minor}.{version.micro}")
|
73
|
+
return True
|
74
|
+
|
75
|
+
def check_package_installed(package_name: str, import_name: str) -> bool:
|
76
|
+
"""Paketin yüklü olup olmadığını kontrol et"""
|
77
|
+
try:
|
78
|
+
importlib.import_module(import_name)
|
79
|
+
return True
|
80
|
+
except ImportError:
|
81
|
+
return False
|
82
|
+
|
83
|
+
def install_package(package_name: str) -> bool:
|
84
|
+
"""Paketi pip ile yükle"""
|
85
|
+
try:
|
86
|
+
print(f"📦 {package_name} yükleniyor...")
|
87
|
+
result = subprocess.run([
|
88
|
+
sys.executable, "-m", "pip", "install", package_name
|
89
|
+
], capture_output=True, text=True)
|
90
|
+
|
91
|
+
if result.returncode == 0:
|
92
|
+
print(f"✅ {package_name} başarıyla yüklendi")
|
93
|
+
return True
|
94
|
+
else:
|
95
|
+
print(f"❌ {package_name} yüklenemedi: {result.stderr}")
|
96
|
+
return False
|
97
|
+
except Exception as e:
|
98
|
+
print(f"❌ {package_name} yükleme hatası: {e}")
|
99
|
+
return False
|
100
|
+
|
101
|
+
def check_and_install_dependencies(packages: Dict[str, str], required: bool = True) -> Tuple[List[str], List[str]]:
|
102
|
+
"""Bağımlılıkları kontrol et ve eksikleri yükle"""
|
103
|
+
missing = []
|
104
|
+
installed = []
|
105
|
+
|
106
|
+
for package_name, import_name in packages.items():
|
107
|
+
if check_package_installed(package_name, import_name):
|
108
|
+
print(f"✅ {package_name}")
|
109
|
+
installed.append(package_name)
|
110
|
+
else:
|
111
|
+
print(f"❌ {package_name} eksik")
|
112
|
+
|
113
|
+
if required:
|
114
|
+
if install_package(package_name):
|
115
|
+
# Yükleme başarılıysa installed listesine ekle
|
116
|
+
installed.append(package_name)
|
117
|
+
# Tekrar kontrol et
|
118
|
+
if check_package_installed(package_name, import_name):
|
119
|
+
print(f"✅ {package_name} doğrulandı")
|
120
|
+
else:
|
121
|
+
print(f"⚠️ {package_name} yüklendi ama import edilemiyor")
|
122
|
+
missing.append(package_name)
|
123
|
+
else:
|
124
|
+
print(f"⚠️ {package_name} yüklenemedi")
|
125
|
+
missing.append(package_name)
|
126
|
+
else:
|
127
|
+
missing.append(package_name)
|
128
|
+
|
129
|
+
return installed, missing
|
130
|
+
|
131
|
+
def analyze_app_manifest(app_dir: Path) -> Dict:
|
132
|
+
"""Uygulama manifest'ini analiz et - cursorrules enhanced"""
|
133
|
+
app_json = app_dir / "app.json"
|
134
|
+
analysis = {
|
135
|
+
"name": app_dir.name,
|
136
|
+
"valid": False,
|
137
|
+
"requires": [],
|
138
|
+
"permissions": {},
|
139
|
+
"core_modules": [],
|
140
|
+
"python_packages": [],
|
141
|
+
"unknown_requirements": [],
|
142
|
+
"permission_warnings": [],
|
143
|
+
"errors": []
|
144
|
+
}
|
145
|
+
|
146
|
+
if not app_json.exists():
|
147
|
+
analysis["errors"].append("app.json not found")
|
148
|
+
return analysis
|
149
|
+
|
150
|
+
try:
|
151
|
+
with open(app_json, 'r', encoding='utf-8') as f:
|
152
|
+
data = json.load(f)
|
153
|
+
|
154
|
+
analysis["name"] = data.get('name', app_dir.name)
|
155
|
+
analysis["valid"] = True
|
156
|
+
|
157
|
+
# Requires analizi (yeni cursorrules özelliği)
|
158
|
+
requires = data.get('requires', [])
|
159
|
+
analysis["requires"] = requires
|
160
|
+
|
161
|
+
for requirement in requires:
|
162
|
+
if requirement.startswith("core."):
|
163
|
+
# Çekirdek modül gereksinimi
|
164
|
+
analysis["core_modules"].append(requirement)
|
165
|
+
if requirement not in SUPPORTED_CORE_MODULES:
|
166
|
+
analysis["errors"].append(f"Unsupported core module: {requirement}")
|
167
|
+
|
168
|
+
elif requirement.startswith("python"):
|
169
|
+
# Python sürüm gereksinimi
|
170
|
+
continue # Python sürümlerini atla
|
171
|
+
|
172
|
+
elif requirement in ["pyqt6", "psutil", "requests", "flask", "pillow"]:
|
173
|
+
# Bilinen Python paketi
|
174
|
+
analysis["python_packages"].append(requirement)
|
175
|
+
|
176
|
+
else:
|
177
|
+
# Bilinmeyen gereksinim
|
178
|
+
analysis["unknown_requirements"].append(requirement)
|
179
|
+
|
180
|
+
# Permissions analizi (yeni cursorrules özelliği)
|
181
|
+
permissions = data.get('permissions', {})
|
182
|
+
if isinstance(permissions, list):
|
183
|
+
# Eski format: ["filesystem", "network"]
|
184
|
+
permissions = {perm: True for perm in permissions}
|
185
|
+
|
186
|
+
analysis["permissions"] = permissions
|
187
|
+
|
188
|
+
for permission, granted in permissions.items():
|
189
|
+
if permission not in SUPPORTED_PERMISSIONS:
|
190
|
+
analysis["permission_warnings"].append(f"Unknown permission: {permission}")
|
191
|
+
|
192
|
+
if permission == "system" and granted:
|
193
|
+
analysis["permission_warnings"].append("System permission requested - requires admin approval")
|
194
|
+
|
195
|
+
if permission in ["fs.write", "network"] and granted:
|
196
|
+
analysis["permission_warnings"].append(f"High-risk permission: {permission}")
|
197
|
+
|
198
|
+
except json.JSONDecodeError as e:
|
199
|
+
analysis["errors"].append(f"Invalid JSON: {e}")
|
200
|
+
except Exception as e:
|
201
|
+
analysis["errors"].append(f"Analysis error: {e}")
|
202
|
+
|
203
|
+
return analysis
|
204
|
+
|
205
|
+
def check_app_dependencies() -> Dict[str, List[str]]:
|
206
|
+
"""Uygulama bağımlılıklarını kontrol et - legacy uyumluluk"""
|
207
|
+
apps_dir = Path("apps")
|
208
|
+
app_deps = {}
|
209
|
+
|
210
|
+
if not apps_dir.exists():
|
211
|
+
print("⚠️ apps/ klasörü bulunamadı")
|
212
|
+
return app_deps
|
213
|
+
|
214
|
+
for app_dir in apps_dir.iterdir():
|
215
|
+
if app_dir.is_dir():
|
216
|
+
app_json = app_dir / "app.json"
|
217
|
+
if app_json.exists():
|
218
|
+
try:
|
219
|
+
with open(app_json, 'r', encoding='utf-8') as f:
|
220
|
+
data = json.load(f)
|
221
|
+
|
222
|
+
requires = data.get('requires', [])
|
223
|
+
if requires:
|
224
|
+
app_deps[data.get('name', app_dir.name)] = requires
|
225
|
+
|
226
|
+
except Exception as e:
|
227
|
+
print(f"⚠️ {app_dir.name}/app.json okunamadı: {e}")
|
228
|
+
|
229
|
+
return app_deps
|
230
|
+
|
231
|
+
def analyze_all_apps() -> Dict:
|
232
|
+
"""Tüm uygulamaları analiz et - cursorrules enhanced"""
|
233
|
+
apps_dir = Path("apps")
|
234
|
+
analysis = {
|
235
|
+
"total_apps": 0,
|
236
|
+
"valid_apps": 0,
|
237
|
+
"apps_with_core_modules": 0,
|
238
|
+
"apps_with_permissions": 0,
|
239
|
+
"all_core_modules": set(),
|
240
|
+
"all_permissions": set(),
|
241
|
+
"all_python_packages": set(),
|
242
|
+
"apps": {},
|
243
|
+
"warnings": [],
|
244
|
+
"errors": []
|
245
|
+
}
|
246
|
+
|
247
|
+
if not apps_dir.exists():
|
248
|
+
analysis["errors"].append("apps/ directory not found")
|
249
|
+
return analysis
|
250
|
+
|
251
|
+
for app_dir in apps_dir.iterdir():
|
252
|
+
if app_dir.is_dir() and not app_dir.name.startswith('.'):
|
253
|
+
analysis["total_apps"] += 1
|
254
|
+
|
255
|
+
app_analysis = analyze_app_manifest(app_dir)
|
256
|
+
analysis["apps"][app_dir.name] = app_analysis
|
257
|
+
|
258
|
+
if app_analysis["valid"]:
|
259
|
+
analysis["valid_apps"] += 1
|
260
|
+
|
261
|
+
if app_analysis["core_modules"]:
|
262
|
+
analysis["apps_with_core_modules"] += 1
|
263
|
+
analysis["all_core_modules"].update(app_analysis["core_modules"])
|
264
|
+
|
265
|
+
if app_analysis["permissions"]:
|
266
|
+
analysis["apps_with_permissions"] += 1
|
267
|
+
analysis["all_permissions"].update(app_analysis["permissions"].keys())
|
268
|
+
|
269
|
+
analysis["all_python_packages"].update(app_analysis["python_packages"])
|
270
|
+
|
271
|
+
# Uyarıları topla
|
272
|
+
analysis["warnings"].extend([
|
273
|
+
f"{app_analysis['name']}: {warning}"
|
274
|
+
for warning in app_analysis["permission_warnings"]
|
275
|
+
])
|
276
|
+
|
277
|
+
# Hataları topla
|
278
|
+
analysis["errors"].extend([
|
279
|
+
f"{app_analysis['name']}: {error}"
|
280
|
+
for error in app_analysis["errors"]
|
281
|
+
])
|
282
|
+
|
283
|
+
return analysis
|
284
|
+
|
285
|
+
def generate_requirements_from_apps():
|
286
|
+
"""Uygulama bağımlılıklarından requirements.txt oluştur - legacy"""
|
287
|
+
app_deps = check_app_dependencies()
|
288
|
+
all_deps = set()
|
289
|
+
|
290
|
+
for app_name, deps in app_deps.items():
|
291
|
+
for dep in deps:
|
292
|
+
if dep.startswith("python"):
|
293
|
+
continue # Python sürümlerini atla
|
294
|
+
all_deps.add(dep)
|
295
|
+
|
296
|
+
print("\n📋 Uygulama bağımlılıkları (Legacy Format):")
|
297
|
+
for app_name, deps in app_deps.items():
|
298
|
+
print(f" {app_name}: {', '.join(deps)}")
|
299
|
+
|
300
|
+
print(f"\n📦 Toplam benzersiz bağımlılık: {len(all_deps)}")
|
301
|
+
for dep in sorted(all_deps):
|
302
|
+
print(f" - {dep}")
|
303
|
+
|
304
|
+
def generate_enhanced_analysis():
|
305
|
+
"""Gelişmiş uygulama analizi - cursorrules enhanced"""
|
306
|
+
print("\n🔍 Gelişmiş Uygulama Analizi (Cursorrules Enhanced):")
|
307
|
+
print("=" * 60)
|
308
|
+
|
309
|
+
analysis = analyze_all_apps()
|
310
|
+
|
311
|
+
print(f"📊 Genel İstatistikler:")
|
312
|
+
print(f" Toplam uygulama: {analysis['total_apps']}")
|
313
|
+
print(f" Geçerli uygulama: {analysis['valid_apps']}")
|
314
|
+
print(f" Çekirdek modül kullanan: {analysis['apps_with_core_modules']}")
|
315
|
+
print(f" İzin sistemi kullanan: {analysis['apps_with_permissions']}")
|
316
|
+
|
317
|
+
if analysis['all_core_modules']:
|
318
|
+
print(f"\n🔗 Kullanılan Çekirdek Modüller ({len(analysis['all_core_modules'])}):")
|
319
|
+
for module in sorted(analysis['all_core_modules']):
|
320
|
+
description = SUPPORTED_CORE_MODULES.get(module, "Bilinmeyen modül")
|
321
|
+
status = "✅" if module in SUPPORTED_CORE_MODULES else "❌"
|
322
|
+
print(f" {status} {module} - {description}")
|
323
|
+
|
324
|
+
if analysis['all_permissions']:
|
325
|
+
print(f"\n🔐 Kullanılan İzinler ({len(analysis['all_permissions'])}):")
|
326
|
+
for permission in sorted(analysis['all_permissions']):
|
327
|
+
description = SUPPORTED_PERMISSIONS.get(permission, "Bilinmeyen izin")
|
328
|
+
status = "✅" if permission in SUPPORTED_PERMISSIONS else "❌"
|
329
|
+
risk = "🔴" if permission in ["system", "fs.write", "network"] else "🟢"
|
330
|
+
print(f" {status} {risk} {permission} - {description}")
|
331
|
+
|
332
|
+
if analysis['all_python_packages']:
|
333
|
+
print(f"\n📦 Python Paket Gereksinimleri ({len(analysis['all_python_packages'])}):")
|
334
|
+
for package in sorted(analysis['all_python_packages']):
|
335
|
+
print(f" - {package}")
|
336
|
+
|
337
|
+
if analysis['warnings']:
|
338
|
+
print(f"\n⚠️ Uyarılar ({len(analysis['warnings'])}):")
|
339
|
+
for warning in analysis['warnings'][:10]: # İlk 10 uyarı
|
340
|
+
print(f" {warning}")
|
341
|
+
if len(analysis['warnings']) > 10:
|
342
|
+
print(f" ... ve {len(analysis['warnings']) - 10} uyarı daha")
|
343
|
+
|
344
|
+
if analysis['errors']:
|
345
|
+
print(f"\n❌ Hatalar ({len(analysis['errors'])}):")
|
346
|
+
for error in analysis['errors'][:10]: # İlk 10 hata
|
347
|
+
print(f" {error}")
|
348
|
+
if len(analysis['errors']) > 10:
|
349
|
+
print(f" ... ve {len(analysis['errors']) - 10} hata daha")
|
350
|
+
|
351
|
+
# Detaylı uygulama listesi
|
352
|
+
print(f"\n📱 Uygulama Detayları:")
|
353
|
+
for app_id, app_data in analysis['apps'].items():
|
354
|
+
if app_data['valid']:
|
355
|
+
core_count = len(app_data['core_modules'])
|
356
|
+
perm_count = len(app_data['permissions'])
|
357
|
+
status_icons = []
|
358
|
+
|
359
|
+
if core_count > 0:
|
360
|
+
status_icons.append(f"🔗{core_count}")
|
361
|
+
if perm_count > 0:
|
362
|
+
status_icons.append(f"🔐{perm_count}")
|
363
|
+
if app_data['errors']:
|
364
|
+
status_icons.append("❌")
|
365
|
+
if app_data['permission_warnings']:
|
366
|
+
status_icons.append("⚠️")
|
367
|
+
|
368
|
+
status = " ".join(status_icons) if status_icons else "✅"
|
369
|
+
print(f" {status} {app_data['name']}")
|
370
|
+
|
371
|
+
def main():
|
372
|
+
"""Ana fonksiyon"""
|
373
|
+
print("🌩️ PyCloud OS Bağımlılık Kurulum Scripti (Cursorrules Enhanced)")
|
374
|
+
print("=" * 70)
|
375
|
+
|
376
|
+
# Python versiyonu kontrol et
|
377
|
+
if not check_python_version():
|
378
|
+
sys.exit(1)
|
379
|
+
|
380
|
+
print("\n📋 Gerekli paketler kontrol ediliyor...")
|
381
|
+
installed, missing = check_and_install_dependencies(REQUIRED_PACKAGES, required=True)
|
382
|
+
|
383
|
+
print("\n📋 Opsiyonel paketler kontrol ediliyor...")
|
384
|
+
opt_installed, opt_missing = check_and_install_dependencies(OPTIONAL_PACKAGES, required=False)
|
385
|
+
|
386
|
+
print("\n📱 Uygulama bağımlılıkları kontrol ediliyor...")
|
387
|
+
generate_requirements_from_apps()
|
388
|
+
|
389
|
+
# Yeni cursorrules analizi
|
390
|
+
generate_enhanced_analysis()
|
391
|
+
|
392
|
+
# Özet
|
393
|
+
print("\n📊 Kurulum Özeti:")
|
394
|
+
print(f"✅ Yüklü gerekli paketler: {len(installed)}/{len(REQUIRED_PACKAGES)}")
|
395
|
+
print(f"📦 Yüklü opsiyonel paketler: {len(opt_installed)}/{len(OPTIONAL_PACKAGES)}")
|
396
|
+
|
397
|
+
if missing:
|
398
|
+
print(f"❌ Eksik gerekli paketler: {', '.join(missing)}")
|
399
|
+
return 1
|
400
|
+
|
401
|
+
print("\n🎉 Tüm gerekli bağımlılıklar hazır!")
|
402
|
+
|
403
|
+
# PyQt6 test et
|
404
|
+
try:
|
405
|
+
from PyQt6.QtWidgets import QApplication
|
406
|
+
print("✅ PyQt6 GUI sistemi kullanılabilir")
|
407
|
+
except ImportError:
|
408
|
+
print("⚠️ PyQt6 GUI sistemi kullanılamıyor")
|
409
|
+
|
410
|
+
# Cursorrules uyumluluk kontrolü
|
411
|
+
print("\n🔗 Cursorrules Uyumluluk Kontrolü:")
|
412
|
+
print(f"✅ {len(SUPPORTED_CORE_MODULES)} çekirdek modül destekleniyor")
|
413
|
+
print(f"✅ {len(SUPPORTED_PERMISSIONS)} izin türü destekleniyor")
|
414
|
+
print("✅ Bridge sistemi hazır")
|
415
|
+
print("✅ ModuleAdapter sistemi hazır")
|
416
|
+
print("✅ PermissionManager sistemi hazır")
|
417
|
+
print("✅ SandboxManager sistemi hazır")
|
418
|
+
|
419
|
+
return 0
|
420
|
+
|
421
|
+
if __name__ == "__main__":
|
422
|
+
sys.exit(main())
|
publish_command.py
CHANGED
@@ -57,13 +57,18 @@ def validate_app_folder(folder_path: str) -> Tuple[bool, str, Optional[dict]]:
|
|
57
57
|
|
58
58
|
def copy_app_to_packages(source_folder: str, app_name: str) -> Tuple[bool, str]:
|
59
59
|
"""
|
60
|
-
Uygulama klasörünü packages/ altına kopyalar
|
60
|
+
Uygulama klasörünü ana clapp dizinindeki packages/ altına kopyalar
|
61
61
|
|
62
62
|
Returns:
|
63
63
|
(success, message)
|
64
64
|
"""
|
65
65
|
try:
|
66
|
-
|
66
|
+
# Ana clapp dizinini bul
|
67
|
+
clapp_root, _ = find_clapp_root_with_build_index()
|
68
|
+
if not clapp_root:
|
69
|
+
return False, "Ana clapp dizini bulunamadı"
|
70
|
+
|
71
|
+
packages_dir = os.path.join(clapp_root, "packages")
|
67
72
|
target_path = os.path.join(packages_dir, app_name)
|
68
73
|
|
69
74
|
# packages klasörünü oluştur
|
@@ -143,74 +148,56 @@ def find_clapp_root_with_build_index():
|
|
143
148
|
import os
|
144
149
|
import subprocess
|
145
150
|
|
146
|
-
# Debug bilgisi
|
147
|
-
print(f"🔍 Mevcut çalışma dizini: {os.getcwd()}")
|
148
|
-
print(f"🔍 publish_command.py konumu: {os.path.dirname(os.path.abspath(__file__))}")
|
149
|
-
|
150
151
|
# 1. which clapp konumundan arama
|
151
152
|
try:
|
152
153
|
result = subprocess.run(['which', 'clapp'], capture_output=True, text=True)
|
153
154
|
if result.returncode == 0:
|
154
155
|
clapp_path = result.stdout.strip()
|
155
|
-
print(f"🔍 1. which clapp sonucu: {clapp_path}")
|
156
156
|
|
157
157
|
# clapp komutunun bulunduğu dizinden başlayarak yukarı çık
|
158
158
|
clapp_dir = os.path.dirname(clapp_path)
|
159
159
|
search_dir = clapp_dir
|
160
160
|
|
161
|
-
print(f"🔍 1. Arama: {clapp_dir} dizininden başlıyor...")
|
162
161
|
while search_dir != os.path.dirname(search_dir): # Root'a ulaşana kadar
|
163
162
|
build_index_path = os.path.join(search_dir, "build_index.py")
|
164
|
-
print(f" Kontrol ediliyor: {build_index_path}")
|
165
163
|
if os.path.exists(build_index_path):
|
166
|
-
print(f"✅ build_index.py which clapp yanında bulundu: {build_index_path}")
|
167
164
|
return search_dir, build_index_path
|
168
165
|
search_dir = os.path.dirname(search_dir)
|
169
|
-
except Exception
|
170
|
-
|
166
|
+
except Exception:
|
167
|
+
pass
|
171
168
|
|
172
169
|
# 2. pyenv which clapp konumundan arama
|
173
170
|
try:
|
174
171
|
result = subprocess.run(['pyenv', 'which', 'clapp'], capture_output=True, text=True)
|
175
172
|
if result.returncode == 0:
|
176
173
|
clapp_path = result.stdout.strip()
|
177
|
-
print(f"🔍 2. pyenv which clapp sonucu: {clapp_path}")
|
178
174
|
|
179
175
|
# clapp komutunun bulunduğu dizinden başlayarak yukarı çık
|
180
176
|
clapp_dir = os.path.dirname(clapp_path)
|
181
177
|
search_dir = clapp_dir
|
182
178
|
|
183
|
-
print(f"🔍 2. Arama: {clapp_dir} dizininden başlıyor...")
|
184
179
|
while search_dir != os.path.dirname(search_dir): # Root'a ulaşana kadar
|
185
180
|
build_index_path = os.path.join(search_dir, "build_index.py")
|
186
|
-
print(f" Kontrol ediliyor: {build_index_path}")
|
187
181
|
if os.path.exists(build_index_path):
|
188
|
-
print(f"✅ build_index.py pyenv which clapp yanında bulundu: {build_index_path}")
|
189
182
|
return search_dir, build_index_path
|
190
183
|
search_dir = os.path.dirname(search_dir)
|
191
|
-
except Exception
|
192
|
-
|
184
|
+
except Exception:
|
185
|
+
pass
|
193
186
|
|
194
187
|
# 3. Kesin konum kontrolü
|
195
188
|
clapp_home = "/Users/melihburakmemis/Desktop/clapp"
|
196
189
|
build_index_path = os.path.join(clapp_home, "build_index.py")
|
197
|
-
print(f"🔍 3. Kesin konum kontrolü: {build_index_path}")
|
198
190
|
if os.path.exists(build_index_path):
|
199
|
-
print(f"✅ build_index.py kesin konumda bulundu: {build_index_path}")
|
200
191
|
return clapp_home, build_index_path
|
201
192
|
|
202
193
|
# 4. Fallback: Mevcut çalışma dizininden başlayarak yukarı çık
|
203
194
|
search_dir = os.getcwd()
|
204
|
-
print(f"🔍 4. Fallback arama: {search_dir} dizininden başlıyor...")
|
205
195
|
while search_dir != os.path.dirname(search_dir): # Root'a ulaşana kadar
|
206
196
|
build_index_path = os.path.join(search_dir, "build_index.py")
|
207
|
-
print(f" Kontrol ediliyor: {build_index_path}")
|
208
197
|
if os.path.exists(build_index_path):
|
209
|
-
print(f"✅ build_index.py bulundu: {build_index_path}")
|
210
198
|
return search_dir, build_index_path
|
211
199
|
search_dir = os.path.dirname(search_dir)
|
212
200
|
|
213
|
-
print("❌ build_index.py hiçbir yerde bulunamadı!")
|
214
201
|
return None, None
|
215
202
|
|
216
203
|
|
@@ -227,11 +214,11 @@ def update_index() -> Tuple[bool, str]:
|
|
227
214
|
# build_index.py'yi ana dizinde çalıştır
|
228
215
|
result = subprocess.run([
|
229
216
|
sys.executable, build_index_path
|
230
|
-
],
|
217
|
+
], cwd=clapp_root)
|
231
218
|
if result.returncode == 0:
|
232
219
|
return True, "Index başarıyla güncellendi"
|
233
220
|
else:
|
234
|
-
return False, f"Index güncelleme hatası:
|
221
|
+
return False, f"Index güncelleme hatası: Çalıştırılan dizin: {clapp_root}"
|
235
222
|
except Exception as e:
|
236
223
|
return False, f"Index script çalıştırılamadı: {e}"
|
237
224
|
|
@@ -256,8 +243,12 @@ def push_to_clapp_packages_repo(app_name: str, app_version: str) -> Tuple[bool,
|
|
256
243
|
packages_repo_path
|
257
244
|
], check=True, cwd=".")
|
258
245
|
|
259
|
-
#
|
260
|
-
|
246
|
+
# Ana clapp dizinindeki packages klasöründen uygulamayı kopyala
|
247
|
+
clapp_root, _ = find_clapp_root_with_build_index()
|
248
|
+
if not clapp_root:
|
249
|
+
return False, "Ana clapp dizini bulunamadı"
|
250
|
+
|
251
|
+
source_app = os.path.join(clapp_root, "packages", app_name)
|
261
252
|
target_app = os.path.join(packages_repo_path, "packages", app_name)
|
262
253
|
|
263
254
|
# Hedef packages klasörünü oluştur (yoksa)
|
@@ -268,7 +259,7 @@ def push_to_clapp_packages_repo(app_name: str, app_version: str) -> Tuple[bool,
|
|
268
259
|
if os.path.exists(target_app):
|
269
260
|
shutil.rmtree(target_app)
|
270
261
|
|
271
|
-
#
|
262
|
+
# Uygulamayı kopyala
|
272
263
|
shutil.copytree(source_app, target_app)
|
273
264
|
print(f"✅ {app_name} uygulaması clapp-packages reposuna kopyalandı")
|
274
265
|
|
@@ -358,26 +349,23 @@ def publish_app(folder_path: str, force: bool = False, push_to_github: bool = Fa
|
|
358
349
|
app_version = manifest['version']
|
359
350
|
print(f"✅ {app_name} v{app_version} doğrulandı")
|
360
351
|
|
361
|
-
# 2.
|
352
|
+
# 2. Uygulamayı packages klasörüne kopyala
|
362
353
|
print("2️⃣ Uygulama kopyalanıyor...")
|
363
|
-
|
354
|
+
success, message = copy_app_to_packages(folder_path, app_name)
|
355
|
+
if not success:
|
356
|
+
return False, message
|
364
357
|
|
365
|
-
|
366
|
-
return False, copy_message
|
367
|
-
|
368
|
-
# 3. Index'i güncelle
|
358
|
+
# 3. Index güncelle
|
369
359
|
print("3️⃣ Index güncelleniyor...")
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
return False, index_message
|
360
|
+
success, message = update_index()
|
361
|
+
if not success:
|
362
|
+
return False, message
|
374
363
|
|
375
|
-
# 4. clapp-packages reposuna push
|
364
|
+
# 4. Eğer push isteniyorsa, clapp-packages reposuna push et
|
376
365
|
if push_to_github:
|
377
|
-
|
378
|
-
if not
|
379
|
-
|
380
|
-
return True, f"🎉 '{app_name}' yerel olarak publish edildi! clapp-packages push başarısız."
|
366
|
+
success, message = push_to_clapp_packages_repo(app_name, app_version)
|
367
|
+
if not success:
|
368
|
+
return False, message
|
381
369
|
|
382
370
|
return True, f"🎉 '{app_name}' başarıyla publish edildi! Index güncellendi."
|
383
371
|
|
version.py
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|