clapp-pm 1.0.19__py3-none-any.whl → 1.0.21__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.
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Hello Python - Basit Python merhaba dünya uygulaması
4
+ clapp paket yöneticisi için örnek uygulama
5
+ """
6
+
7
+ import sys
8
+ import os
9
+ from datetime import datetime
10
+
11
+ def main():
12
+ """Ana fonksiyon"""
13
+ print("🐍 Merhaba Python Dünyası!")
14
+ print("=" * 40)
15
+
16
+ # Uygulama bilgileri
17
+ print(f"📦 Uygulama: hello-python")
18
+ print(f"🔢 Sürüm: 1.0.0")
19
+ print(f"💻 Dil: Python {sys.version.split()[0]}")
20
+ print(f"📅 Tarih: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
21
+
22
+ # Sistem bilgileri
23
+ print(f"\n🖥️ Sistem Bilgileri:")
24
+ print(f" İşletim Sistemi: {os.name}")
25
+ print(f" Python Sürümü: {sys.version}")
26
+ print(f" Çalışma Dizini: {os.getcwd()}")
27
+
28
+ # Basit hesaplama
29
+ print(f"\n🧮 Basit Hesaplama:")
30
+ a, b = 15, 25
31
+ print(f" {a} + {b} = {a + b}")
32
+ print(f" {a} * {b} = {a * b}")
33
+
34
+ # Dosya listesi
35
+ print(f"\n📁 Mevcut Dizin İçeriği:")
36
+ try:
37
+ files = os.listdir('.')
38
+ for i, file in enumerate(files[:5], 1):
39
+ print(f" {i}. {file}")
40
+ if len(files) > 5:
41
+ print(f" ... ve {len(files) - 5} dosya daha")
42
+ except Exception as e:
43
+ print(f" Dosya listesi alınamadı: {e}")
44
+
45
+ print(f"\n✅ hello-python uygulaması başarıyla çalıştı!")
46
+ print("🎉 clapp paket yöneticisine hoş geldiniz!")
47
+
48
+ if __name__ == "__main__":
49
+ main()
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "hello-python",
3
+ "version": "1.0.0",
4
+ "language": "python",
5
+ "entry": "main.py",
6
+ "description": "Basit Python merhaba dünya uygulaması",
7
+ "dependencies": []
8
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "app_name": "clapp",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "author": "Melih Burak Memiş",
5
5
  "description": "Basit ve güçlü paket yöneticisi",
6
6
  "source": "https://github.com/melihburak/clapp",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clapp-pm
3
- Version: 1.0.19
3
+ Version: 1.0.21
4
4
  Summary: Lightweight cross-language app manager for Python and Lua
5
5
  Home-page: https://github.com/mburakmmm/clapp
6
6
  Author: Melih Burak Memiş
@@ -2,26 +2,28 @@ cache_manager.py,sha256=HdQ3vnZO_YP0vyotzjP5wozltVNgkJAxrvYFXhGLGCI,13287
2
2
  check_env.py,sha256=9O8CrdWGcxd_WBV5bsAAZG9iAaiO-nGYDYY-gYZ9G3M,4132
3
3
  clapp_core.py,sha256=5tkzt7J4GKSv7Chv5Zoe9N0dv_sWlYGqYxmIn3dhEPY,1764
4
4
  clean_command.py,sha256=nmzitkdNo0Ovgi-tGPUxa9mkAIFzwEzGNaTm82MUdvw,6806
5
- cli_commands.py,sha256=CLKimHefiMjXzBfS4wHiG1tj7C54BpwVIlVU_fDjRqI,12740
5
+ cli_commands.py,sha256=nC7bGzUQZwV11KI4iV0s-tvmnT8nwZHFLy0GfV0a1qE,13143
6
6
  dependency_resolver.py,sha256=OyzWOW45OWTr8BX0gcy5fFbk9qIVBP9JQyMtXrKPmEM,24499
7
7
  doctor_command.py,sha256=8Tv_em4mp-ibaDPXli6uyhYV--Fb6lHyDnnS2S0_d7c,7654
8
8
  info_command.py,sha256=b74Pl1-x_PSezALx-lS3FkEcVNTF7a9McTKk5XTDhjM,5629
9
- install_command.py,sha256=1Ogy_4nOsnLXzoUBys9yeLf5jKkGv9C40wuGZo2COC0,9445
10
- installer.py,sha256=EkQ5Z1Cq_Z5u_Ssv2Nc8hryI5E97x4D1QVjSqEHe0dE,10619
9
+ install_command.py,sha256=9m7C7dVvRop5-4TUy5V2aGb59jSPRp4NAx8QJIOC2tA,9556
10
+ installer.py,sha256=IElGtgQl1GvakiWGOiewLPIepdf00K_uek_KZcsC85A,10976
11
11
  list_command.py,sha256=qbeocvrg2eXRklxbYS3audQhYHGXTlMBk_tNh1cMxd0,8391
12
12
  main.py,sha256=uf2-LzBBFIwIiyg1kcyZG4J1B9f5U33VHieBXu1uLi8,23889
13
13
  manifest_schema.py,sha256=qR6dIpYL1zwAJmrij05gkgE_urN3qVamoUi2BgR7Lv4,2801
14
14
  manifest_validator.py,sha256=JW0mETHDQCSMhodZ5sntr5KPU8T5LYv4IiVoAp4zOIY,8092
15
+ new_command.py,sha256=gz1w8zMf-gFITtRQAc9G2WES2akuCwdH7dtuDu9TacU,5926
15
16
  package_registry.py,sha256=Rco15cvz-6lpCEDdCzwGZNCKtvVhlFIsEPy-WFAESMM,4233
16
17
  package_runner.py,sha256=GqLPlQRxh7g3bDgGDSVpmHdeRXaP5f6s8kp8QVnw5LM,5783
17
18
  package_signing.py,sha256=ModMAzLk08rkI6zd8QKhyCH5BFbB-7dy8pwqKYatFQo,4579
18
19
  post_install_hint.py,sha256=wjMPCgRurZiGu6hv_se-XA36KqBCdeYdRCD1q7FrJzQ,4918
20
+ progress_utils.py,sha256=yiQ2e-jrU8UVt36iOC_pdKx6cuv1YPNCTZNIItbEPPU,8263
19
21
  publish_command.py,sha256=P05AFbu_mxcc1yAiwShN5Yi9PX1o_7TFXD1mowJcqJE,8589
20
22
  remote_registry.py,sha256=rPBIM_ESXUt0br5cARQ4YbzUoTda0G4e1KGzfyYMbpQ,8235
21
23
  smart_search.py,sha256=R5O5CDXqlQc-N-6R6D5k36_-arCB-wnKfmWr5zMYWUI,15741
22
24
  uninstall_command.py,sha256=rQYbZ-XMw8Xxw1fmgGdDaBQmgBGqyJ_rTBZkvEV5HV0,7066
23
25
  validate_command.py,sha256=idaujErzrwuZNT6DYCVTVwZqBDEEi1GTxIXAGBgKMKM,7623
24
- version.py,sha256=OnZFRa6JP1bAWkOBVf8P5NTFNziBsBUhGuKbE1Kzuy4,224
26
+ version.py,sha256=H9_enMWKOmwY_YpwVRxCb26vBaOVq9GK3iQUblkJn68,224
25
27
  version_command.py,sha256=DZuYWtohSeM5PJNYCflBy36_k0vex3tYV2C8ixEA9ho,4259
26
28
  version_manager.py,sha256=fpC7jxhIW1wZhJ9IkVwyqkgJN4mhBjUUbaLefXLDMiM,11423
27
29
  where_command.py,sha256=TcLoXLGmrPSHQuvlceVuuKBsfeadIwz-E0G_5okH14g,6420
@@ -54,21 +56,15 @@ backup_current/where_command.py,sha256=TcLoXLGmrPSHQuvlceVuuKBsfeadIwz-E0G_5okH1
54
56
  clapp-packages-repo/README.md,sha256=stsqg4c5qWcUZxRabvbD0DEwzjJEGDGvxpA4bGbzJqg,1688
55
57
  clapp-packages-repo/index.json,sha256=Z1tF-OZrWxMjue7q-nUMVJy1UhWop9zwh05gDqy5fCM,894
56
58
  clapp-packages-repo/packages.json,sha256=kjcUn29aMFs89bmjZLK33EMeuy0KZQmyLbdvuCwzCZQ,1148
57
- clapp-packages-repo/packages/hello-python/main.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
- clapp-packages-repo/packages/hello-python/manifest.json,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
+ clapp-packages-repo/packages/hello-python/main.py,sha256=Dy-Ov-Vumj8oQYI6qKWU6fIKD0gCB8b7KzAJVrGyLMg,1429
60
+ clapp-packages-repo/packages/hello-python/manifest.json,sha256=fJOVJk_2rwpRJ6IeWMPieklJD3gAR279jvuqRH69s90,179
59
61
  clapp-packages-repo/packages/test-app/main.py,sha256=rN4Zo9u53bIVjcUlul059knx6v-2Cd1MFftPS57FIRU,33
60
62
  clapp-packages-repo/packages/test-app/manifest.json,sha256=kJe4sjYdPRNZD5hEeca80jj3lxeEWBMJoZ59RW7tiKI,118
61
63
  clapp-packages-repo/packages/test-app2/main.py,sha256=lHkbjTmehFY4VuYYF2dYiVBH7W0oqHHeY0I5W85iPTY,35
62
64
  clapp-packages-repo/packages/test-app2/manifest.json,sha256=vshXJrtRxBc_ISM6E8KT5BSmveMbjWszenlgxgSN86w,121
63
- clapp_pm-1.0.19.data/data/version.json,sha256=XPwOQqKgrCzt75qizoYTYTOOtnYG9KEw9v0kX_E7OV0,239
64
- clapp_pm-1.0.19.dist-info/licenses/LICENSE,sha256=_hryv9pKR6udRexceUYuoYCJGmYBz7e-vRuFWmm38UY,1075
65
+ clapp_pm-1.0.21.data/data/version.json,sha256=14ypbLPPM7__r9B0nGVxi9y3DQRkDYpd70LvStBPIXQ,239
66
+ clapp_pm-1.0.21.dist-info/licenses/LICENSE,sha256=_hryv9pKR6udRexceUYuoYCJGmYBz7e-vRuFWmm38UY,1075
65
67
  docs/developer_guide.md,sha256=B-S141TSNy7e8T9KaV6Fr-ZAFhYqqgcwqWijjX0C2Xc,7336
66
- packages/hello-python/main.py,sha256=Dy-Ov-Vumj8oQYI6qKWU6fIKD0gCB8b7KzAJVrGyLMg,1429
67
- packages/hello-python/manifest.json,sha256=fJOVJk_2rwpRJ6IeWMPieklJD3gAR279jvuqRH69s90,179
68
- packages/test-app/main.py,sha256=rN4Zo9u53bIVjcUlul059knx6v-2Cd1MFftPS57FIRU,33
69
- packages/test-app/manifest.json,sha256=kJe4sjYdPRNZD5hEeca80jj3lxeEWBMJoZ59RW7tiKI,118
70
- packages/test-app2/main.py,sha256=lHkbjTmehFY4VuYYF2dYiVBH7W0oqHHeY0I5W85iPTY,35
71
- packages/test-app2/manifest.json,sha256=vshXJrtRxBc_ISM6E8KT5BSmveMbjWszenlgxgSN86w,121
72
68
  templates/dart/manifest.json,sha256=ycVKZxrArzcSoRZ5LKKe8aOerwk5Z-7VX0td86aim0M,267
73
69
  templates/lua/manifest.json,sha256=CRIy0dP6Pr3vH6IV4dObGs4KqqJ_sURsY0wAgK2av7E,262
74
70
  templates/python/README.md,sha256=AqVgCZ-cwXBuDHFoJdYkAHAuB6SjSjqXQrjhLu0q7cc,964
@@ -77,8 +73,8 @@ templates/python/manifest.json,sha256=hjmKqsEkWEBTwxFgm35MkvuwWZ2CQWq9Zo8uHodqHr
77
73
  test-app/README.md,sha256=AqVgCZ-cwXBuDHFoJdYkAHAuB6SjSjqXQrjhLu0q7cc,964
78
74
  test-app/main.py,sha256=24IEuyHSuPWJp2-xYhInUNEWqeueGxAO3NBgHkEgLdQ,1562
79
75
  test-app/manifest.json,sha256=MM1nl5Bljrnsik3fwsrgFBchfgwIb2REoBwwzNpFHQU,284
80
- clapp_pm-1.0.19.dist-info/METADATA,sha256=iuBWYnuIEotxHmSd-FXUKu15kOJNUPYoIGG7Udzncsk,3980
81
- clapp_pm-1.0.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
82
- clapp_pm-1.0.19.dist-info/entry_points.txt,sha256=7j-3pQVpQfnaVzUV83g7zlCA30ePlnXkhHLAGGz9xrQ,36
83
- clapp_pm-1.0.19.dist-info/top_level.txt,sha256=sXrnwBW_jVjAEv4wOWMwbUXRZ22PpUseU9O9XOnCtFY,457
84
- clapp_pm-1.0.19.dist-info/RECORD,,
76
+ clapp_pm-1.0.21.dist-info/METADATA,sha256=x7XdkEWtZ2OidLL19YVZOzCEY1RPf2ilwr6VuZehWgM,3980
77
+ clapp_pm-1.0.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
78
+ clapp_pm-1.0.21.dist-info/entry_points.txt,sha256=7j-3pQVpQfnaVzUV83g7zlCA30ePlnXkhHLAGGz9xrQ,36
79
+ clapp_pm-1.0.21.dist-info/top_level.txt,sha256=2FeS-lC1OV3lBqLAHahLU8vcWxlxSDLNJSk-4MmymKk,475
80
+ clapp_pm-1.0.21.dist-info/RECORD,,
@@ -15,11 +15,12 @@ list_command
15
15
  main
16
16
  manifest_schema
17
17
  manifest_validator
18
+ new_command
18
19
  package_registry
19
20
  package_runner
20
21
  package_signing
21
- packages
22
22
  post_install_hint
23
+ progress_utils
23
24
  publish_command
24
25
  remote_registry
25
26
  smart_search
cli_commands.py CHANGED
@@ -5,6 +5,7 @@ from installer import install_package, uninstall_package, create_package_from_di
5
5
  from package_registry import list_packages, get_manifest
6
6
  from dependency_resolver import get_dependency_report, get_system_dependency_report
7
7
  from manifest_validator import validate_manifest_file, get_validation_summary
8
+ from progress_utils import show_success_message, show_error_message, show_info_message, show_warning_message
8
9
 
9
10
  # Yeni komut modüllerini import et
10
11
  from publish_command import publish_app
@@ -51,30 +52,30 @@ def install_from_remote_legacy(app_name, force=False):
51
52
  if not download_url:
52
53
  return False, f"'{app_name}' için indirme URL'si bulunamadı"
53
54
 
54
- print(f"📦 {app_name} v{package_info.get('version', '0.0.0')}")
55
- print(f"📝 {package_info.get('description', 'Açıklama yok')}")
56
- print(f"💻 Dil: {package_info.get('language', 'Bilinmiyor')}")
55
+ show_info_message(f"📦 {app_name} v{package_info.get('version', '0.0.0')}")
56
+ show_info_message(f"📝 {package_info.get('description', 'Açıklama yok')}")
57
+ show_info_message(f"💻 Dil: {package_info.get('language', 'Bilinmiyor')}")
57
58
 
58
59
  # Bağımlılıkları göster
59
60
  dependencies = package_info.get('dependencies', [])
60
61
  if dependencies:
61
- print(f"🔗 Bağımlılıklar: {', '.join(dependencies)}")
62
+ show_info_message(f"🔗 Bağımlılıklar: {', '.join(dependencies)}")
62
63
 
63
- print(f"⬇️ İndiriliyor: {download_url}")
64
+ show_info_message(f"⬇️ İndiriliyor: {download_url}")
64
65
 
65
66
  # Paketi yükle
66
67
  success, message = install_package(download_url, force)
67
68
 
68
69
  if success:
69
- print(f"✅ {message}")
70
+ show_success_message(message)
70
71
 
71
72
  # Bağımlılık kontrolü
72
- print("\n🔍 Bağımlılıklar kontrol ediliyor...")
73
+ show_info_message("🔍 Bağımlılıklar kontrol ediliyor...")
73
74
  dep_report = get_dependency_report(app_name)
74
75
  print(dep_report)
75
76
 
76
77
  else:
77
- print(f"❌ {message}")
78
+ show_error_message(message)
78
79
 
79
80
  return success, message
80
81
 
@@ -152,15 +153,15 @@ def upgrade_package(app_name):
152
153
 
153
154
  remote_version = remote_package.get('version', '0.0.0')
154
155
 
155
- print(f"📦 {app_name}")
156
- print(f"📱 Yerel sürüm: {local_version}")
157
- print(f"🌐 Uzak sürüm: {remote_version}")
156
+ show_info_message(f"📦 {app_name}")
157
+ show_info_message(f"📱 Yerel sürüm: {local_version}")
158
+ show_info_message(f"🌐 Uzak sürüm: {remote_version}")
158
159
 
159
160
  # Sürüm karşılaştırması (basit string karşılaştırması)
160
161
  if local_version == remote_version:
161
162
  return True, f"'{app_name}' zaten güncel (v{local_version})"
162
163
 
163
- print(f"🔄 Güncelleme mevcut: {local_version} → {remote_version}")
164
+ show_info_message(f"🔄 Güncelleme mevcut: {local_version} → {remote_version}")
164
165
 
165
166
  # Güncelleme için yeniden yükle
166
167
  return install_from_remote(app_name, force=True)
@@ -181,13 +182,13 @@ def publish_package(app_path):
181
182
  if not os.path.isdir(app_path):
182
183
  return False, f"'{app_path}' bir dizin değil"
183
184
 
184
- print(f"📁 Paket hazırlanıyor: {app_path}")
185
+ show_info_message(f"📁 Paket hazırlanıyor: {app_path}")
185
186
 
186
187
  # Manifest doğrulama
187
188
  manifest_path = os.path.join(app_path, "manifest.json")
188
189
  is_valid, errors = validate_manifest_file(manifest_path)
189
190
 
190
- print("🔍 Manifest doğrulanıyor...")
191
+ show_info_message("🔍 Manifest doğrulanıyor...")
191
192
  print(get_validation_summary(errors))
192
193
 
193
194
  if not is_valid:
@@ -197,15 +198,15 @@ def publish_package(app_path):
197
198
  success, message, output_file = create_package_from_directory(app_path)
198
199
 
199
200
  if success:
200
- print(f"✅ {message}")
201
- print("\n📋 Yayınlama talimatları:")
201
+ show_success_message(message)
202
+ show_info_message("\n📋 Yayınlama talimatları:")
202
203
  print("1. Oluşturulan .clapp.zip dosyasını GitHub'a yükleyin")
203
204
  print("2. packages.json dosyasını güncelleyin")
204
205
  print("3. Pull request oluşturun")
205
206
  print(f"\n📁 Paket dosyası: {output_file}")
206
207
 
207
208
  else:
208
- print(f"❌ {message}")
209
+ show_error_message(message)
209
210
 
210
211
  return success, message
211
212
 
@@ -219,14 +220,14 @@ def search_remote_packages(query):
219
220
  Returns:
220
221
  tuple: (success: bool, message: str)
221
222
  """
222
- print(f"🔍 Arama yapılıyor: '{query}'")
223
+ show_info_message(f"🔍 Arama yapılıyor: '{query}'")
223
224
 
224
225
  results = search_packages(query)
225
226
 
226
227
  if not results:
227
228
  return False, f"'{query}' için sonuç bulunamadı"
228
229
 
229
- print(f"{len(results)} sonuç bulundu:\n")
230
+ show_success_message(f"{len(results)} sonuç bulundu:\n")
230
231
 
231
232
  for package in results:
232
233
  name = package.get('name', 'Bilinmiyor')
@@ -323,25 +324,25 @@ def check_system_health():
323
324
  Returns:
324
325
  tuple: (success: bool, message: str)
325
326
  """
326
- print("🏥 Sistem Sağlık Kontrolü")
327
+ show_info_message("🏥 Sistem Sağlık Kontrolü")
327
328
  print("=" * 40)
328
329
 
329
330
  # Bağımlılık kontrolü
330
- print("🔍 Bağımlılıklar kontrol ediliyor...")
331
+ show_info_message("🔍 Bağımlılıklar kontrol ediliyor...")
331
332
  dep_report = get_system_dependency_report()
332
333
  print(dep_report)
333
334
 
334
335
  # Uzak bağlantı kontrolü
335
- print("🌐 Uzak bağlantı kontrol ediliyor...")
336
+ show_info_message("🌐 Uzak bağlantı kontrol ediliyor...")
336
337
  from remote_registry import check_remote_connectivity
337
338
 
338
339
  if check_remote_connectivity():
339
- print("Uzak paket deposuna bağlantı başarılı")
340
+ show_success_message("Uzak paket deposuna bağlantı başarılı")
340
341
  else:
341
- print("Uzak paket deposuna bağlantı kurulamadı")
342
+ show_error_message("Uzak paket deposuna bağlantı kurulamadı")
342
343
 
343
344
  # Manifest doğrulama
344
- print("\n🔍 Tüm manifest'ler doğrulanıyor...")
345
+ show_info_message("\n🔍 Tüm manifest'ler doğrulanıyor...")
345
346
  local_packages = list_packages()
346
347
  invalid_count = 0
347
348
 
@@ -352,13 +353,13 @@ def check_system_health():
352
353
 
353
354
  is_valid, errors = validate_manifest_file(manifest_path)
354
355
  if not is_valid:
355
- print(f"{app_name}: Geçersiz manifest")
356
+ show_error_message(f"{app_name}: Geçersiz manifest")
356
357
  invalid_count += 1
357
358
 
358
359
  if invalid_count == 0:
359
- print("Tüm manifest'ler geçerli")
360
+ show_success_message("Tüm manifest'ler geçerli")
360
361
  else:
361
- print(f"{invalid_count} geçersiz manifest bulundu")
362
+ show_error_message(f"{invalid_count} geçersiz manifest bulundu")
362
363
 
363
364
  return True, "Sistem sağlık kontrolü tamamlandı"
364
365
 
install_command.py CHANGED
@@ -18,6 +18,7 @@ from pathlib import Path
18
18
  from typing import Tuple, Optional, Dict, Any
19
19
 
20
20
  from manifest_validator import validate_manifest_verbose
21
+ from progress_utils import download_with_progress, extract_with_progress, show_success_message, show_error_message
21
22
 
22
23
  def get_apps_directory() -> str:
23
24
  """Uygulamaların kurulacağı dizini döndürür"""
@@ -91,21 +92,18 @@ def download_app_from_github(app_info: Dict[str, Any], temp_dir: str) -> Tuple[b
91
92
  else:
92
93
  return False, f"Desteklenmeyen repo URL: {repo_url}"
93
94
 
94
- print(f"📥 İndiriliyor: {zip_url}")
95
+ # Progress bar ile indir
96
+ zip_path = os.path.join(temp_dir, "repo.zip")
97
+ success = download_with_progress(zip_url, zip_path, f"📦 {app_name} indiriliyor")
95
98
 
96
- # Zip dosyasını indir
97
- response = requests.get(zip_url, timeout=30)
98
- if response.status_code != 200:
99
- return False, f"İndirme hatası: {response.status_code}"
99
+ if not success:
100
+ return False, "İndirme başarısız"
100
101
 
101
- # Zip dosyasını geçici klasöre kaydet
102
- zip_path = os.path.join(temp_dir, "repo.zip")
103
- with open(zip_path, 'wb') as f:
104
- f.write(response.content)
102
+ # Progress bar ile çıkar
103
+ success = extract_with_progress(zip_path, temp_dir, f"📦 {app_name} çıkarılıyor")
105
104
 
106
- # Zip'i
107
- with zipfile.ZipFile(zip_path, 'r') as zip_ref:
108
- zip_ref.extractall(temp_dir)
105
+ if not success:
106
+ return False, "Çıkarma başarısız"
109
107
 
110
108
  # Çıkarılan klasörü bul (genellikle repo-main formatında)
111
109
  extracted_folders = [d for d in os.listdir(temp_dir) if os.path.isdir(os.path.join(temp_dir, d))]
@@ -156,6 +154,8 @@ def install_app_locally(app_name: str, source_path: str) -> Tuple[bool, str]:
156
154
  shutil.rmtree(target_path)
157
155
  return False, f"Manifest doğrulama hatası: {errors}"
158
156
 
157
+ show_success_message(f"'{app_name}' başarıyla yüklendi!")
158
+
159
159
  # Bağımlılık çözümleme entegrasyonu
160
160
  print("5️⃣ Bağımlılıklar kontrol ediliyor...")
161
161
  from dependency_resolver import check_and_install_python_dependencies, check_and_install_lua_dependencies, check_engine_availability
installer.py CHANGED
@@ -6,6 +6,7 @@ import shutil
6
6
  import json
7
7
  from manifest_validator import validate_manifest_verbose
8
8
  from package_registry import app_exists
9
+ from progress_utils import download_with_progress, extract_with_progress, copy_with_progress, show_success_message, show_error_message
9
10
 
10
11
  def find_app_folder(extract_path, app_name):
11
12
  """
@@ -81,6 +82,8 @@ def install_package(source, force=False):
81
82
  if os.path.exists(target_dir):
82
83
  shutil.rmtree(target_dir)
83
84
  shutil.copytree(app_real_folder, target_dir)
85
+
86
+ show_success_message(f"'{app_name}' başarıyla yüklendi!")
84
87
  return True, f"✅ '{app_name}' başarıyla yüklendi!"
85
88
  except Exception as e:
86
89
  return False, f"Yükleme hatası: {e}"
@@ -100,8 +103,6 @@ def download_package(url, temp_dir):
100
103
  str or None: İndirilen dosyanın yolu veya None
101
104
  """
102
105
  try:
103
- print(f"Paket indiriliyor: {url}")
104
-
105
106
  # Dosya adını URL'den çıkar
106
107
  filename = os.path.basename(url)
107
108
  if not filename.endswith('.zip'):
@@ -109,14 +110,16 @@ def download_package(url, temp_dir):
109
110
 
110
111
  zip_path = os.path.join(temp_dir, filename)
111
112
 
112
- # Dosyayı indir
113
- urllib.request.urlretrieve(url, zip_path)
113
+ # Progress bar ile indir
114
+ success = download_with_progress(url, zip_path, f"📦 {filename} indiriliyor")
114
115
 
115
- print(f"✅ İndirme tamamlandı: {filename}")
116
- return zip_path
116
+ if success:
117
+ return zip_path
118
+ else:
119
+ return None
117
120
 
118
121
  except Exception as e:
119
- print(f"İndirme hatası: {e}")
122
+ show_error_message(f"İndirme hatası: {e}")
120
123
  return None
121
124
 
122
125
  def extract_package(zip_path, extract_path):
@@ -134,12 +137,14 @@ def extract_package(zip_path, extract_path):
134
137
  # Çıkarma dizinini oluştur
135
138
  os.makedirs(extract_path, exist_ok=True)
136
139
 
137
- # Zip dosyasını ve çıkar
138
- with zipfile.ZipFile(zip_path, 'r') as zip_ref:
139
- zip_ref.extractall(extract_path)
140
+ # Progress bar ile çıkar
141
+ filename = os.path.basename(zip_path)
142
+ success = extract_with_progress(zip_path, extract_path, f"📦 {filename} çıkarılıyor")
140
143
 
141
- print(f"✅ Paket çıkarıldı: {extract_path}")
142
- return True, "Paket başarıyla çıkarıldı"
144
+ if success:
145
+ return True, "Paket başarıyla çıkarıldı"
146
+ else:
147
+ return False, "Çıkarma hatası"
143
148
 
144
149
  except zipfile.BadZipFile:
145
150
  return False, "Geçersiz zip dosyası"
@@ -259,6 +264,7 @@ def install_from_directory(source_dir, force=False):
259
264
  # Dosyaları kopyala
260
265
  shutil.copytree(source_dir, target_dir)
261
266
 
267
+ show_success_message(f"'{app_name}' başarıyla yüklendi!")
262
268
  return True, f"✅ '{app_name}' başarıyla yüklendi!"
263
269
 
264
270
  except Exception as e:
new_command.py ADDED
@@ -0,0 +1,181 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ new_command.py - Yeni Uygulama Oluşturma Komutu
4
+
5
+ Bu modül clapp için yeni uygulama şablonları oluşturur.
6
+ """
7
+
8
+ import os
9
+ import shutil
10
+ import json
11
+ from pathlib import Path
12
+ from package_runner import get_supported_languages
13
+
14
+ def create_new_app(language: str, app_name: str, target_dir: str | None = None) -> tuple[bool, str]:
15
+ """
16
+ Yeni bir clapp uygulaması oluşturur
17
+
18
+ Args:
19
+ language: Programlama dili
20
+ app_name: Uygulama adı
21
+ target_dir: Hedef dizin (opsiyonel)
22
+
23
+ Returns:
24
+ (success, message)
25
+ """
26
+ try:
27
+ # Dil kontrolü
28
+ if language.lower() not in get_supported_languages():
29
+ supported = ', '.join(get_supported_languages())
30
+ return False, f"Desteklenmeyen dil: {language}. Desteklenen diller: {supported}"
31
+
32
+ # Uygulama adı kontrolü
33
+ if not app_name or not app_name.strip():
34
+ return False, "Uygulama adı boş olamaz"
35
+
36
+ app_name = app_name.strip().lower()
37
+
38
+ # Geçersiz karakter kontrolü
39
+ invalid_chars = ['/', '\\', ':', '*', '?', '"', '<', '>', '|']
40
+ for char in invalid_chars:
41
+ if char in app_name:
42
+ return False, f"Uygulama adında geçersiz karakter: {char}"
43
+
44
+ # Hedef dizin belirleme
45
+ if target_dir:
46
+ target_path = Path(target_dir) / app_name
47
+ else:
48
+ target_path = Path.cwd() / app_name
49
+
50
+ # Dizin zaten var mı kontrol et
51
+ if target_path.exists():
52
+ return False, f"Dizin zaten mevcut: {target_path}"
53
+
54
+ # Şablon dizini
55
+ template_dir = Path(__file__).parent / "templates" / language.lower()
56
+
57
+ if not template_dir.exists():
58
+ return False, f"Şablon bulunamadı: {language}"
59
+
60
+ # Dizini oluştur
61
+ target_path.mkdir(parents=True, exist_ok=True)
62
+
63
+ # Şablon dosyalarını kopyala
64
+ for item in template_dir.iterdir():
65
+ if item.is_file():
66
+ # Dosya adını uygulama adına göre güncelle
67
+ if item.name == "manifest.json":
68
+ update_manifest(item, target_path / item.name, app_name, language)
69
+ else:
70
+ shutil.copy2(item, target_path / item.name)
71
+ elif item.is_dir():
72
+ # Alt dizinleri kopyala
73
+ shutil.copytree(item, target_path / item.name)
74
+
75
+ # Başarı mesajı
76
+ success_message = f"""
77
+ ✅ Yeni {language} uygulaması oluşturuldu!
78
+
79
+ 📁 Dizin: {target_path}
80
+ 🚀 Çalıştırmak için:
81
+ cd {app_name}
82
+ clapp validate .
83
+ clapp install .
84
+ clapp run {app_name}
85
+
86
+ 📖 Geliştirme için docs/developer_guide.md dosyasını inceleyin.
87
+ """.strip()
88
+
89
+ return True, success_message
90
+
91
+ except Exception as e:
92
+ return False, f"Uygulama oluşturma hatası: {str(e)}"
93
+
94
+ def update_manifest(template_path: Path, target_path: Path, app_name: str, language: str):
95
+ """
96
+ Manifest dosyasını uygulama adına göre günceller
97
+
98
+ Args:
99
+ template_path: Şablon manifest dosyası
100
+ target_path: Hedef manifest dosyası
101
+ app_name: Uygulama adı
102
+ language: Programlama dili
103
+ """
104
+ try:
105
+ # Şablon manifest'i oku
106
+ with open(template_path, 'r', encoding='utf-8') as f:
107
+ manifest = json.load(f)
108
+
109
+ # Uygulama adını güncelle
110
+ manifest['name'] = app_name
111
+
112
+ # Açıklamayı güncelle
113
+ if 'description' in manifest:
114
+ manifest['description'] = manifest['description'].replace(
115
+ 'hello-' + language.lower(), app_name
116
+ )
117
+
118
+ # Hedef dosyaya yaz
119
+ with open(target_path, 'w', encoding='utf-8') as f:
120
+ json.dump(manifest, f, indent=2, ensure_ascii=False)
121
+
122
+ except Exception as e:
123
+ print(f"⚠️ Manifest güncelleme hatası: {e}")
124
+
125
+ def list_available_templates() -> str:
126
+ """
127
+ Mevcut şablonları listeler
128
+
129
+ Returns:
130
+ Formatlanmış şablon listesi
131
+ """
132
+ templates_dir = Path(__file__).parent / "templates"
133
+
134
+ if not templates_dir.exists():
135
+ return "❌ Şablon dizini bulunamadı"
136
+
137
+ result = "📋 Mevcut Şablonlar:\n"
138
+ result += "=" * 30 + "\n\n"
139
+
140
+ for template in sorted(templates_dir.iterdir()):
141
+ if template.is_dir():
142
+ # Şablon bilgilerini oku
143
+ manifest_path = template / "manifest.json"
144
+ if manifest_path.exists():
145
+ try:
146
+ with open(manifest_path, 'r', encoding='utf-8') as f:
147
+ manifest = json.load(f)
148
+
149
+ name = manifest.get('name', template.name)
150
+ description = manifest.get('description', 'Açıklama yok')
151
+ language = manifest.get('language', 'unknown')
152
+
153
+ result += f"🌐 {language.upper()}\n"
154
+ result += f" 📝 {description}\n"
155
+ result += f" 📁 Şablon: {template.name}\n\n"
156
+
157
+ except Exception:
158
+ result += f"🌐 {template.name.upper()}\n"
159
+ result += f" 📁 Şablon: {template.name}\n\n"
160
+
161
+ result += "💡 Kullanım: clapp new <dil> <uygulama-adı>"
162
+
163
+ return result
164
+
165
+ def handle_new_command(args) -> tuple[bool, str]:
166
+ """
167
+ new komutunu işler
168
+
169
+ Args:
170
+ args: Argümanlar
171
+
172
+ Returns:
173
+ (success, message)
174
+ """
175
+ if args.list:
176
+ return True, list_available_templates()
177
+
178
+ if not args.language or not args.app_name:
179
+ return False, "Dil ve uygulama adı gerekli. Örnek: clapp new python my-app"
180
+
181
+ return create_new_app(args.language, args.app_name, args.target_dir)
progress_utils.py ADDED
@@ -0,0 +1,274 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ progress_utils.py - Progress Bar ve İndirme Hızı Göstergesi
4
+
5
+ Bu modül indirme ve yükleme işlemleri için progress bar ve hız göstergesi sağlar.
6
+ """
7
+
8
+ import sys
9
+ import time
10
+ import threading
11
+ from typing import Optional, Callable
12
+ from urllib.request import urlopen
13
+ from urllib.error import URLError
14
+
15
+ class ProgressBar:
16
+ """Progress bar sınıfı"""
17
+
18
+ def __init__(self, total: int, description: str = "İndiriliyor", width: int = 50):
19
+ self.total = total
20
+ self.description = description
21
+ self.width = width
22
+ self.current = 0
23
+ self.start_time = time.time()
24
+ self.last_update = 0
25
+ self.speed = 0
26
+ self.lock = threading.Lock()
27
+
28
+ def update(self, current: int, speed: Optional[float] = None):
29
+ """Progress bar'ı günceller"""
30
+ with self.lock:
31
+ self.current = current
32
+ if speed is not None:
33
+ self.speed = speed
34
+
35
+ # Hız hesaplama
36
+ if self.current > 0:
37
+ elapsed = time.time() - self.start_time
38
+ if elapsed > 0:
39
+ self.speed = self.current / elapsed
40
+
41
+ def display(self):
42
+ """Progress bar'ı ekranda gösterir"""
43
+ if self.total <= 0:
44
+ return
45
+
46
+ percentage = (self.current / self.total) * 100
47
+ filled_width = int(self.width * self.current // self.total)
48
+
49
+ # Progress bar oluştur
50
+ bar = '█' * filled_width + '░' * (self.width - filled_width)
51
+
52
+ # Hız formatı
53
+ speed_str = self._format_speed(self.speed)
54
+
55
+ # Yüzde ve boyut bilgisi
56
+ current_str = self._format_size(self.current)
57
+ total_str = self._format_size(self.total)
58
+
59
+ # Progress bar çıktısı
60
+ progress_line = f"\r{self.description}: [{bar}] {percentage:5.1f}% | {current_str}/{total_str} | {speed_str}"
61
+
62
+ # Satırı temizle ve yaz
63
+ sys.stdout.write('\r' + ' ' * (len(progress_line) + 10)) # Temizle
64
+ sys.stdout.write(progress_line)
65
+ sys.stdout.flush()
66
+
67
+ def finish(self, success: bool = True):
68
+ """Progress bar'ı tamamlar"""
69
+ if success:
70
+ # Tamamlandı mesajı
71
+ sys.stdout.write('\r' + ' ' * (self.width + 50)) # Temizle
72
+ sys.stdout.write(f"\r✅ {self.description} tamamlandı!\n")
73
+ else:
74
+ # Hata mesajı
75
+ sys.stdout.write('\r' + ' ' * (self.width + 50)) # Temizle
76
+ sys.stdout.write(f"\r❌ {self.description} başarısız!\n")
77
+ sys.stdout.flush()
78
+
79
+ def _format_speed(self, speed: float) -> str:
80
+ """Hızı formatlar (B/s, KB/s, MB/s)"""
81
+ if speed < 1024:
82
+ return f"{speed:.1f} B/s"
83
+ elif speed < 1024 * 1024:
84
+ return f"{speed/1024:.1f} KB/s"
85
+ else:
86
+ return f"{speed/(1024*1024):.1f} MB/s"
87
+
88
+ def _format_size(self, size: int) -> str:
89
+ """Boyutu formatlar (B, KB, MB, GB)"""
90
+ if size < 1024:
91
+ return f"{size} B"
92
+ elif size < 1024 * 1024:
93
+ return f"{size/1024:.1f} KB"
94
+ elif size < 1024 * 1024 * 1024:
95
+ return f"{size/(1024*1024):.1f} MB"
96
+ else:
97
+ return f"{size/(1024*1024*1024):.1f} GB"
98
+
99
+
100
+ def download_with_progress(url: str, filename: str, description: str = "İndiriliyor") -> bool:
101
+ """
102
+ Progress bar ile dosya indirir
103
+
104
+ Args:
105
+ url: İndirilecek URL
106
+ filename: Kaydedilecek dosya adı
107
+ description: Progress bar açıklaması
108
+
109
+ Returns:
110
+ Başarılı ise True
111
+ """
112
+ try:
113
+ # URL'den dosya boyutunu al
114
+ response = urlopen(url)
115
+ total_size = int(response.headers.get('content-length', 0))
116
+ response.close()
117
+
118
+ # Progress bar oluştur
119
+ progress = ProgressBar(total_size, description)
120
+
121
+ # İndirme işlemi
122
+ with urlopen(url) as response:
123
+ with open(filename, 'wb') as file:
124
+ downloaded = 0
125
+ chunk_size = 8192
126
+
127
+ while True:
128
+ chunk = response.read(chunk_size)
129
+ if not chunk:
130
+ break
131
+
132
+ file.write(chunk)
133
+ downloaded += len(chunk)
134
+
135
+ # Progress bar güncelle
136
+ progress.update(downloaded)
137
+ progress.display()
138
+
139
+ # Kısa bekleme (çok sık güncelleme önlemek için)
140
+ time.sleep(0.01)
141
+
142
+ # Tamamlandı
143
+ progress.finish(True)
144
+ return True
145
+
146
+ except Exception as e:
147
+ if 'progress' in locals():
148
+ progress.finish(False)
149
+ print(f"❌ İndirme hatası: {e}")
150
+ return False
151
+
152
+
153
+ def copy_with_progress(src: str, dst: str, description: str = "Kopyalanıyor") -> bool:
154
+ """
155
+ Progress bar ile dosya kopyalar
156
+
157
+ Args:
158
+ src: Kaynak dosya
159
+ dst: Hedef dosya
160
+ description: Progress bar açıklaması
161
+
162
+ Returns:
163
+ Başarılı ise True
164
+ """
165
+ import os
166
+ import shutil
167
+
168
+ try:
169
+ # Dosya boyutunu al
170
+ total_size = os.path.getsize(src)
171
+
172
+ # Progress bar oluştur
173
+ progress = ProgressBar(total_size, description)
174
+
175
+ # Kopyalama işlemi
176
+ with open(src, 'rb') as src_file:
177
+ with open(dst, 'wb') as dst_file:
178
+ copied = 0
179
+ chunk_size = 8192
180
+
181
+ while True:
182
+ chunk = src_file.read(chunk_size)
183
+ if not chunk:
184
+ break
185
+
186
+ dst_file.write(chunk)
187
+ copied += len(chunk)
188
+
189
+ # Progress bar güncelle
190
+ progress.update(copied)
191
+ progress.display()
192
+
193
+ # Kısa bekleme
194
+ time.sleep(0.001)
195
+
196
+ # Tamamlandı
197
+ progress.finish(True)
198
+ return True
199
+
200
+ except Exception as e:
201
+ if 'progress' in locals():
202
+ progress.finish(False)
203
+ print(f"❌ Kopyalama hatası: {e}")
204
+ return False
205
+
206
+
207
+ def extract_with_progress(zip_path: str, extract_path: str, description: str = "Çıkarılıyor") -> bool:
208
+ """
209
+ Progress bar ile ZIP dosyası çıkarır
210
+
211
+ Args:
212
+ zip_path: ZIP dosyası yolu
213
+ extract_path: Çıkarılacak dizin
214
+ description: Progress bar açıklaması
215
+
216
+ Returns:
217
+ Başarılı ise True
218
+ """
219
+ import zipfile
220
+ import os
221
+
222
+ try:
223
+ with zipfile.ZipFile(zip_path, 'r') as zip_ref:
224
+ # Toplam dosya sayısı
225
+ file_list = zip_ref.filelist
226
+ total_files = len(file_list)
227
+
228
+ if total_files == 0:
229
+ print(f"❌ ZIP dosyası boş: {zip_path}")
230
+ return False
231
+
232
+ # Progress bar oluştur
233
+ progress = ProgressBar(total_files, description)
234
+
235
+ # Çıkarma işlemi
236
+ for i, file_info in enumerate(file_list):
237
+ zip_ref.extract(file_info, extract_path)
238
+
239
+ # Progress bar güncelle
240
+ progress.update(i + 1)
241
+ progress.display()
242
+
243
+ # Kısa bekleme
244
+ time.sleep(0.01)
245
+
246
+ # Tamamlandı
247
+ progress.finish(True)
248
+ return True
249
+
250
+ except Exception as e:
251
+ if 'progress' in locals():
252
+ progress.finish(False)
253
+ print(f"❌ Çıkarma hatası: {e}")
254
+ return False
255
+
256
+
257
+ def show_success_message(message: str):
258
+ """Başarı mesajı gösterir"""
259
+ print(f"✅ {message}")
260
+
261
+
262
+ def show_error_message(message: str):
263
+ """Hata mesajı gösterir"""
264
+ print(f"❌ {message}")
265
+
266
+
267
+ def show_info_message(message: str):
268
+ """Bilgi mesajı gösterir"""
269
+ print(f"ℹ️ {message}")
270
+
271
+
272
+ def show_warning_message(message: str):
273
+ """Uyarı mesajı gösterir"""
274
+ print(f"⚠️ {message}")
version.py CHANGED
@@ -2,7 +2,7 @@
2
2
  Version information for clapp-pm package.
3
3
  """
4
4
 
5
- __version__ = "1.0.19"
5
+ __version__ = "1.0.21"
6
6
  __author__ = "Melih Burak Memiş"
7
7
  __email__ = "mburakmemiscy@gmail.com"
8
8
  __description__ = "Lightweight cross-language app manager for Python and Lua"
@@ -1,49 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Hello Python - Basit Python merhaba dünya uygulaması
4
- clapp paket yöneticisi için örnek uygulama
5
- """
6
-
7
- import sys
8
- import os
9
- from datetime import datetime
10
-
11
- def main():
12
- """Ana fonksiyon"""
13
- print("🐍 Merhaba Python Dünyası!")
14
- print("=" * 40)
15
-
16
- # Uygulama bilgileri
17
- print(f"📦 Uygulama: hello-python")
18
- print(f"🔢 Sürüm: 1.0.0")
19
- print(f"💻 Dil: Python {sys.version.split()[0]}")
20
- print(f"📅 Tarih: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
21
-
22
- # Sistem bilgileri
23
- print(f"\n🖥️ Sistem Bilgileri:")
24
- print(f" İşletim Sistemi: {os.name}")
25
- print(f" Python Sürümü: {sys.version}")
26
- print(f" Çalışma Dizini: {os.getcwd()}")
27
-
28
- # Basit hesaplama
29
- print(f"\n🧮 Basit Hesaplama:")
30
- a, b = 15, 25
31
- print(f" {a} + {b} = {a + b}")
32
- print(f" {a} * {b} = {a * b}")
33
-
34
- # Dosya listesi
35
- print(f"\n📁 Mevcut Dizin İçeriği:")
36
- try:
37
- files = os.listdir('.')
38
- for i, file in enumerate(files[:5], 1):
39
- print(f" {i}. {file}")
40
- if len(files) > 5:
41
- print(f" ... ve {len(files) - 5} dosya daha")
42
- except Exception as e:
43
- print(f" Dosya listesi alınamadı: {e}")
44
-
45
- print(f"\n✅ hello-python uygulaması başarıyla çalıştı!")
46
- print("🎉 clapp paket yöneticisine hoş geldiniz!")
47
-
48
- if __name__ == "__main__":
49
- main()
@@ -1,8 +0,0 @@
1
- {
2
- "name": "hello-python",
3
- "version": "1.0.0",
4
- "language": "python",
5
- "entry": "main.py",
6
- "description": "Basit Python merhaba dünya uygulaması",
7
- "dependencies": []
8
- }
packages/test-app/main.py DELETED
@@ -1 +0,0 @@
1
- print("Test app çalışıyor!")
@@ -1 +0,0 @@
1
- {"name": "test-app", "version": "1.0.0", "language": "python", "description": "Test uygulaması", "entry": "main.py"}
@@ -1 +0,0 @@
1
- print("Test app 2 çalışıyor!")
@@ -1 +0,0 @@
1
- {"name": "test-app2", "version": "1.0.0", "language": "python", "description": "Test uygulaması 2", "entry": "main.py"}