clapp-pm 1.0.1__py3-none-any.whl → 1.0.2__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.1.dist-info → clapp_pm-1.0.2.dist-info}/METADATA +1 -1
- {clapp_pm-1.0.1.dist-info → clapp_pm-1.0.2.dist-info}/RECORD +9 -9
- doctor_command.py +27 -67
- installer.py +44 -41
- {clapp_pm-1.0.1.data → clapp_pm-1.0.2.data}/data/version.json +0 -0
- {clapp_pm-1.0.1.dist-info → clapp_pm-1.0.2.dist-info}/WHEEL +0 -0
- {clapp_pm-1.0.1.dist-info → clapp_pm-1.0.2.dist-info}/entry_points.txt +0 -0
- {clapp_pm-1.0.1.dist-info → clapp_pm-1.0.2.dist-info}/licenses/LICENSE +0 -0
- {clapp_pm-1.0.1.dist-info → clapp_pm-1.0.2.dist-info}/top_level.txt +0 -0
@@ -3,10 +3,10 @@ clapp_core.py,sha256=5tkzt7J4GKSv7Chv5Zoe9N0dv_sWlYGqYxmIn3dhEPY,1764
|
|
3
3
|
clean_command.py,sha256=nmzitkdNo0Ovgi-tGPUxa9mkAIFzwEzGNaTm82MUdvw,6806
|
4
4
|
cli_commands.py,sha256=ffJeRJTeipzHkSXhIUKrGzmymqtuv9bKCCQ2WGMQUD4,12482
|
5
5
|
dependency_resolver.py,sha256=slskJhZJ5rRIv0Gcefd-cakHxdYl45bPwE4s_0APpsA,8562
|
6
|
-
doctor_command.py,sha256=
|
6
|
+
doctor_command.py,sha256=jLnvpU9Oglq553bwgF7fhAcUChZTMD2Qle9ZxNHPefc,7680
|
7
7
|
info_command.py,sha256=b74Pl1-x_PSezALx-lS3FkEcVNTF7a9McTKk5XTDhjM,5629
|
8
8
|
install_command.py,sha256=tkEMuezZ_-GWCikMfzZzkL0OjnRcyNixtW9OC749GDw,7789
|
9
|
-
installer.py,sha256=
|
9
|
+
installer.py,sha256=EkQ5Z1Cq_Z5u_Ssv2Nc8hryI5E97x4D1QVjSqEHe0dE,10619
|
10
10
|
list_command.py,sha256=qbeocvrg2eXRklxbYS3audQhYHGXTlMBk_tNh1cMxd0,8391
|
11
11
|
main.py,sha256=aLwnLGv5AOjRsEBCyJKANKFKccpGEEo8PNe2_Mgm7w4,11806
|
12
12
|
manifest_schema.py,sha256=IxfKuYgcIhILJrDMOm5vjSJn2jp7hPpUoxtjPMCPvbE,2201
|
@@ -29,16 +29,16 @@ clapp-packages-repo/packages/test-app/main.py,sha256=rN4Zo9u53bIVjcUlul059knx6v-
|
|
29
29
|
clapp-packages-repo/packages/test-app/manifest.json,sha256=kJe4sjYdPRNZD5hEeca80jj3lxeEWBMJoZ59RW7tiKI,118
|
30
30
|
clapp-packages-repo/packages/test-app2/main.py,sha256=lHkbjTmehFY4VuYYF2dYiVBH7W0oqHHeY0I5W85iPTY,35
|
31
31
|
clapp-packages-repo/packages/test-app2/manifest.json,sha256=vshXJrtRxBc_ISM6E8KT5BSmveMbjWszenlgxgSN86w,121
|
32
|
-
clapp_pm-1.0.
|
33
|
-
clapp_pm-1.0.
|
32
|
+
clapp_pm-1.0.2.data/data/version.json,sha256=S7yOmQU4A-UqpUE3AX0vmjehgSS--fxuVEPG1YcIvDo,238
|
33
|
+
clapp_pm-1.0.2.dist-info/licenses/LICENSE,sha256=_hryv9pKR6udRexceUYuoYCJGmYBz7e-vRuFWmm38UY,1075
|
34
34
|
packages/hello-python/main.py,sha256=Dy-Ov-Vumj8oQYI6qKWU6fIKD0gCB8b7KzAJVrGyLMg,1429
|
35
35
|
packages/hello-python/manifest.json,sha256=fJOVJk_2rwpRJ6IeWMPieklJD3gAR279jvuqRH69s90,179
|
36
36
|
packages/test-app/main.py,sha256=rN4Zo9u53bIVjcUlul059knx6v-2Cd1MFftPS57FIRU,33
|
37
37
|
packages/test-app/manifest.json,sha256=kJe4sjYdPRNZD5hEeca80jj3lxeEWBMJoZ59RW7tiKI,118
|
38
38
|
packages/test-app2/main.py,sha256=lHkbjTmehFY4VuYYF2dYiVBH7W0oqHHeY0I5W85iPTY,35
|
39
39
|
packages/test-app2/manifest.json,sha256=vshXJrtRxBc_ISM6E8KT5BSmveMbjWszenlgxgSN86w,121
|
40
|
-
clapp_pm-1.0.
|
41
|
-
clapp_pm-1.0.
|
42
|
-
clapp_pm-1.0.
|
43
|
-
clapp_pm-1.0.
|
44
|
-
clapp_pm-1.0.
|
40
|
+
clapp_pm-1.0.2.dist-info/METADATA,sha256=Yqpr_xf6m8POnPt648jyOtC2wTLHNALOsY3nnI6uKSw,3979
|
41
|
+
clapp_pm-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
42
|
+
clapp_pm-1.0.2.dist-info/entry_points.txt,sha256=7j-3pQVpQfnaVzUV83g7zlCA30ePlnXkhHLAGGz9xrQ,36
|
43
|
+
clapp_pm-1.0.2.dist-info/top_level.txt,sha256=90PY3qqc7ZdaDsLvwHtQiUG0OZqpsjxw_zkjiTTFY0I,351
|
44
|
+
clapp_pm-1.0.2.dist-info/RECORD,,
|
doctor_command.py
CHANGED
@@ -20,7 +20,6 @@ from check_env import (
|
|
20
20
|
check_working_directory,
|
21
21
|
check_apps_directory,
|
22
22
|
check_permissions,
|
23
|
-
check_flet_installation
|
24
23
|
)
|
25
24
|
|
26
25
|
def check_clapp_config():
|
@@ -165,13 +164,25 @@ def check_python_modules():
|
|
165
164
|
else:
|
166
165
|
return True, f"Tüm gerekli modüller mevcut ({len(found)} modül)"
|
167
166
|
|
167
|
+
def check_apps_directory():
|
168
|
+
"""apps/ dizinini kontrol eder, yoksa otomatik oluşturur veya bilgi verir"""
|
169
|
+
apps_dir = Path("apps")
|
170
|
+
if apps_dir.exists():
|
171
|
+
return True, "apps/ dizini mevcut"
|
172
|
+
else:
|
173
|
+
try:
|
174
|
+
apps_dir.mkdir(parents=True, exist_ok=True)
|
175
|
+
return True, "apps/ dizini yoktu, otomatik oluşturuldu (ilk kurulum için normal)"
|
176
|
+
except Exception as e:
|
177
|
+
return False, f"apps/ dizini oluşturulamadı: {e}"
|
178
|
+
|
179
|
+
|
168
180
|
def run_doctor():
|
169
181
|
"""Kapsamlı sistem tanılaması yapar"""
|
170
182
|
print("🩺 clapp Sistem Tanılaması")
|
171
183
|
print("=" * 60)
|
172
184
|
print("Sisteminiz clapp için uygun mu kontrol ediliyor...")
|
173
185
|
print()
|
174
|
-
|
175
186
|
# Tüm kontroller
|
176
187
|
checks = [
|
177
188
|
("Python Sürümü", check_python_version),
|
@@ -187,93 +198,42 @@ def run_doctor():
|
|
187
198
|
("Yazma İzinleri", check_permissions),
|
188
199
|
("Disk Alanı", check_disk_space),
|
189
200
|
("Ağ Erişimi", check_network_access),
|
190
|
-
("Flet Kurulumu", check_flet_installation),
|
191
201
|
("clapp Konfigürasyonu", check_clapp_config),
|
192
202
|
]
|
193
|
-
|
194
203
|
passed = 0
|
195
204
|
failed = 0
|
196
205
|
warnings = 0
|
197
|
-
|
198
206
|
results = []
|
199
|
-
|
200
207
|
for check_name, check_func in checks:
|
201
208
|
try:
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
if success:
|
206
|
-
print(f"✅ {check_name}: {message}")
|
209
|
+
ok, msg = check_func()
|
210
|
+
if ok:
|
211
|
+
print(f"✅ {check_name}: {msg}")
|
207
212
|
passed += 1
|
208
213
|
else:
|
209
|
-
print(f"❌ {check_name}: {
|
214
|
+
print(f"❌ {check_name}: {msg}")
|
210
215
|
failed += 1
|
216
|
+
results.append((check_name, ok, msg))
|
211
217
|
except Exception as e:
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
warnings += 1
|
216
|
-
|
217
|
-
# Özet
|
218
|
+
print(f"❌ {check_name}: Kontrol sırasında hata: {e}")
|
219
|
+
failed += 1
|
220
|
+
results.append((check_name, False, str(e)))
|
218
221
|
print("\n" + "=" * 60)
|
219
|
-
print("📊 Tanılama Özeti:")
|
222
|
+
print(f"📊 Tanılama Özeti:")
|
220
223
|
print(f"✅ Başarılı: {passed}")
|
221
224
|
print(f"❌ Başarısız: {failed}")
|
222
225
|
print(f"⚠️ Uyarı: {warnings}")
|
223
|
-
|
224
|
-
# Genel durum
|
225
|
-
if failed == 0 and warnings == 0:
|
226
|
-
print("\n🎉 Mükemmel! Sisteminiz clapp için tamamen hazır.")
|
227
|
-
print("✨ Herhangi bir sorun bulunmadı.")
|
228
|
-
elif failed == 0:
|
229
|
-
print("\n✅ İyi! Sisteminiz clapp için genel olarak uygun.")
|
230
|
-
print("⚠️ Bazı küçük uyarılar var, ancak çalışmaya engel değil.")
|
231
|
-
else:
|
226
|
+
if failed > 0:
|
232
227
|
print("\n🔧 Dikkat! Bazı sorunlar bulundu.")
|
233
228
|
print("❌ Aşağıdaki sorunları çözmeniz önerilir:")
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
print("\n💡 Çözüm Önerileri:")
|
238
|
-
|
239
|
-
for check_name, success, message in results:
|
240
|
-
if not success:
|
241
|
-
print(f"\n🔧 {check_name}:")
|
242
|
-
print(f" Sorun: {message}")
|
243
|
-
|
244
|
-
# Spesifik öneriler
|
245
|
-
if "Python" in check_name and "sürüm" in message.lower():
|
246
|
-
print(" Çözüm: Python 3.8 veya daha yeni sürüm yükleyin")
|
247
|
-
elif "PATH" in check_name:
|
248
|
-
print(" Çözüm: Python Scripts dizinini PATH'e ekleyin")
|
249
|
-
print(" Detay: clapp check-env komutunu çalıştırın")
|
250
|
-
elif "apps/" in check_name:
|
251
|
-
print(" Çözüm: mkdir apps komutu ile apps dizini oluşturun")
|
252
|
-
elif "Flet" in check_name:
|
253
|
-
print(" Çözüm: pip install flet komutu ile Flet'i yükleyin")
|
254
|
-
elif "izin" in message.lower():
|
255
|
-
print(" Çözüm: Dizin izinlerini kontrol edin veya farklı dizinde çalıştırın")
|
256
|
-
elif "disk" in message.lower():
|
257
|
-
print(" Çözüm: Disk alanı açın veya farklı dizinde çalıştırın")
|
258
|
-
elif "ağ" in message.lower():
|
259
|
-
print(" Çözüm: İnternet bağlantınızı kontrol edin")
|
260
|
-
|
261
|
-
# Sonraki adımlar
|
262
|
-
print("\n🚀 Sonraki Adımlar:")
|
263
|
-
if failed == 0:
|
264
|
-
print("• clapp list - Yüklü uygulamaları listeleyin")
|
265
|
-
print("• clapp gui - Grafik arayüzü başlatın")
|
266
|
-
print("• clapp --help - Tüm komutları görün")
|
229
|
+
for name, ok, msg in results:
|
230
|
+
if not ok:
|
231
|
+
print(f"\n🔧 {name}:\n Sorun: {msg}")
|
267
232
|
else:
|
268
|
-
print("
|
269
|
-
print("• clapp doctor - Tekrar tanılama çalıştırın")
|
270
|
-
print("• clapp check-env - Temel kontrolleri yapın")
|
271
|
-
|
233
|
+
print("\n🚀 Her şey yolunda! clapp sorunsuz çalışabilir.")
|
272
234
|
print("\n📞 Yardım:")
|
273
235
|
print("• GitHub: https://github.com/user/clapp")
|
274
236
|
print("• Dokümantasyon: README.md dosyasını okuyun")
|
275
|
-
|
276
|
-
return failed == 0
|
277
237
|
|
278
238
|
if __name__ == "__main__":
|
279
239
|
run_doctor()
|
installer.py
CHANGED
@@ -7,81 +7,84 @@ import json
|
|
7
7
|
from manifest_validator import validate_manifest_verbose
|
8
8
|
from package_registry import app_exists
|
9
9
|
|
10
|
+
def find_app_folder(extract_path, app_name):
|
11
|
+
"""
|
12
|
+
Zip çıkarıldıktan sonra, extract_path altında **/packages/{app_name} klasörünü bulur.
|
13
|
+
"""
|
14
|
+
for root, dirs, files in os.walk(extract_path):
|
15
|
+
if os.path.basename(root) == app_name and os.path.basename(os.path.dirname(root)) == "packages":
|
16
|
+
return root
|
17
|
+
return None
|
18
|
+
|
19
|
+
|
10
20
|
def install_package(source, force=False):
|
11
21
|
"""
|
12
22
|
Bir .clapp paketini zip dosyasından veya URL'den yükler.
|
13
|
-
|
14
|
-
Args:
|
15
|
-
source (str): Yerel zip dosya yolu veya uzak URL
|
16
|
-
force (bool): Mevcut uygulamanın üzerine yazılmasına izin ver
|
17
|
-
|
18
|
-
Returns:
|
19
|
-
tuple: (success: bool, message: str)
|
20
23
|
"""
|
21
24
|
temp_dir = None
|
22
|
-
|
23
25
|
try:
|
24
|
-
# Geçici dizin oluştur
|
25
26
|
temp_dir = tempfile.mkdtemp()
|
26
|
-
|
27
|
-
# Kaynak türünü belirle (URL mu dosya yolu mu)
|
28
27
|
if source.startswith(('http://', 'https://')):
|
29
|
-
# URL'den indir
|
30
28
|
zip_path = download_package(source, temp_dir)
|
31
29
|
if not zip_path:
|
32
30
|
return False, "Paket indirilemedi"
|
33
31
|
else:
|
34
|
-
# Yerel dosya
|
35
32
|
if not os.path.exists(source):
|
36
33
|
return False, f"Dosya bulunamadı: {source}"
|
37
34
|
zip_path = source
|
38
|
-
|
39
|
-
# Zip dosyasını çıkart
|
40
35
|
extract_path = os.path.join(temp_dir, "extracted")
|
41
36
|
success, message = extract_package(zip_path, extract_path)
|
42
37
|
if not success:
|
43
38
|
return False, message
|
44
|
-
|
45
|
-
#
|
46
|
-
|
47
|
-
|
39
|
+
|
40
|
+
# --- YENİ: Doğru app klasörünü bul ---
|
41
|
+
# Önce manifesti bulmak için tüm app klasörlerini tara
|
42
|
+
app_folder = None
|
43
|
+
manifest = None
|
44
|
+
manifest_path = None
|
45
|
+
# Tüm packages altındaki app klasörlerini bul
|
46
|
+
for root, dirs, files in os.walk(extract_path):
|
47
|
+
if "manifest.json" in files:
|
48
|
+
with open(os.path.join(root, "manifest.json"), 'r', encoding='utf-8') as f:
|
49
|
+
try:
|
50
|
+
m = json.load(f)
|
51
|
+
if 'name' in m:
|
52
|
+
app_folder = root
|
53
|
+
manifest = m
|
54
|
+
manifest_path = os.path.join(root, "manifest.json")
|
55
|
+
break
|
56
|
+
except Exception:
|
57
|
+
continue
|
58
|
+
if not app_folder or not manifest:
|
59
|
+
return False, "Uygulama klasörü bulunamadı: manifest.json"
|
60
|
+
app_name = manifest['name']
|
61
|
+
|
62
|
+
# --- YENİ: Sadece packages/{app_name} klasörünü bul ve kopyala ---
|
63
|
+
app_real_folder = find_app_folder(extract_path, app_name)
|
64
|
+
if not app_real_folder:
|
65
|
+
return False, f"Uygulama klasörü bulunamadı: packages/{app_name}"
|
66
|
+
|
67
|
+
# Manifesti doğrula
|
68
|
+
is_valid, errors = validate_manifest_file(os.path.join(app_real_folder, "manifest.json"))
|
48
69
|
if not is_valid:
|
49
70
|
error_msg = "Manifest doğrulama hatası:\n" + "\n".join(errors)
|
50
71
|
return False, error_msg
|
51
|
-
|
52
|
-
# Manifest'i yükle
|
53
|
-
with open(manifest_path, 'r', encoding='utf-8') as f:
|
54
|
-
manifest = json.load(f)
|
55
|
-
|
56
|
-
app_name = manifest['name']
|
57
|
-
|
58
|
-
# Uygulama zaten var mı kontrol et
|
59
|
-
if app_exists(app_name) and not force:
|
60
|
-
return False, f"Uygulama '{app_name}' zaten yüklü. --force kullanarak üzerine yazabilirsiniz."
|
61
|
-
|
72
|
+
|
62
73
|
# Giriş dosyasının varlığını kontrol et
|
63
74
|
entry_file = manifest['entry']
|
64
|
-
entry_path = os.path.join(
|
75
|
+
entry_path = os.path.join(app_real_folder, entry_file)
|
65
76
|
if not os.path.exists(entry_path):
|
66
77
|
return False, f"Giriş dosyası bulunamadı: {entry_file}"
|
67
|
-
|
78
|
+
|
68
79
|
# Hedef dizini oluştur
|
69
80
|
target_dir = os.path.join("apps", app_name)
|
70
|
-
|
71
|
-
# Mevcut dizini sil (eğer varsa)
|
72
81
|
if os.path.exists(target_dir):
|
73
82
|
shutil.rmtree(target_dir)
|
74
|
-
|
75
|
-
# Dosyaları kopyala
|
76
|
-
shutil.copytree(extract_path, target_dir)
|
77
|
-
|
83
|
+
shutil.copytree(app_real_folder, target_dir)
|
78
84
|
return True, f"✅ '{app_name}' başarıyla yüklendi!"
|
79
|
-
|
80
85
|
except Exception as e:
|
81
86
|
return False, f"Yükleme hatası: {e}"
|
82
|
-
|
83
87
|
finally:
|
84
|
-
# Geçici dizini temizle
|
85
88
|
if temp_dir and os.path.exists(temp_dir):
|
86
89
|
shutil.rmtree(temp_dir)
|
87
90
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|