clapp-pm 1.0.19__tar.gz → 1.0.21__tar.gz

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.
Files changed (105) hide show
  1. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/PKG-INFO +1 -1
  2. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp_pm.egg-info/SOURCES.txt +2 -12
  3. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp_pm.egg-info/top_level.txt +2 -1
  4. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/cli_commands.py +29 -28
  5. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/install_command.py +12 -12
  6. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/installer.py +18 -12
  7. clapp_pm-1.0.21/progress_utils.py +274 -0
  8. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/setup.py +2 -0
  9. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/version.json +1 -1
  10. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/version.py +1 -1
  11. clapp_pm-1.0.19/clapp-packages-repo/packages/hello-python/main.py +0 -0
  12. clapp_pm-1.0.19/clapp-packages-repo/packages/hello-python/manifest.json +0 -0
  13. clapp_pm-1.0.19/packages/test-app/main.py +0 -1
  14. clapp_pm-1.0.19/packages/test-app/manifest.json +0 -1
  15. clapp_pm-1.0.19/packages/test-app2/main.py +0 -1
  16. clapp_pm-1.0.19/packages/test-app2/manifest.json +0 -1
  17. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/CHANGELOG.md +0 -0
  18. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/GITHUB_SETUP.md +0 -0
  19. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/LICENSE +0 -0
  20. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/MANIFEST.in +0 -0
  21. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/PYPI_UPLOAD.md +0 -0
  22. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/README.md +0 -0
  23. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/advanced_test.py +0 -0
  24. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/apps/test-app/README.md +0 -0
  25. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/apps/test-app/main.py +0 -0
  26. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/apps/test-app/manifest.json +0 -0
  27. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/build_index.py +0 -0
  28. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/check_env.py +0 -0
  29. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/clapp_core.py +0 -0
  30. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/clean_command.py +0 -0
  31. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/cli_commands.py +0 -0
  32. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/dependency_resolver.py +0 -0
  33. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/doctor_command.py +0 -0
  34. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/info_command.py +0 -0
  35. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/install_command.py +0 -0
  36. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/installer.py +0 -0
  37. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/list_command.py +0 -0
  38. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/main.py +0 -0
  39. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/manifest_schema.py +0 -0
  40. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/manifest_validator.py +0 -0
  41. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/package_registry.py +0 -0
  42. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/package_runner.py +0 -0
  43. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/post_install_hint.py +0 -0
  44. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/publish_command.py +0 -0
  45. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/remote_registry.py +0 -0
  46. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/setup.py +0 -0
  47. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/system_test.py +0 -0
  48. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/uninstall_command.py +0 -0
  49. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/validate_command.py +0 -0
  50. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/version.py +0 -0
  51. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/version_command.py +0 -0
  52. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/backup_current/where_command.py +0 -0
  53. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/build_index.py +0 -0
  54. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/cache_manager.py +0 -0
  55. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/check_env.py +0 -0
  56. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp-packages-repo/README.md +0 -0
  57. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp-packages-repo/index.json +0 -0
  58. {clapp_pm-1.0.19 → clapp_pm-1.0.21/clapp-packages-repo}/packages/hello-python/main.py +0 -0
  59. {clapp_pm-1.0.19 → clapp_pm-1.0.21/clapp-packages-repo}/packages/hello-python/manifest.json +0 -0
  60. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp-packages-repo/packages/test-app/main.py +0 -0
  61. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp-packages-repo/packages/test-app/manifest.json +0 -0
  62. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp-packages-repo/packages/test-app2/main.py +0 -0
  63. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp-packages-repo/packages/test-app2/manifest.json +0 -0
  64. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp-packages-repo/packages.json +0 -0
  65. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp_app_structure.md +0 -0
  66. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp_core.py +0 -0
  67. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp_pm.egg-info/dependency_links.txt +0 -0
  68. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp_pm.egg-info/entry_points.txt +0 -0
  69. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clapp_pm.egg-info/requires.txt +0 -0
  70. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/clean_command.py +0 -0
  71. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/dependency_resolver.py +0 -0
  72. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/deploy.py +0 -0
  73. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/docs/developer_guide.md +0 -0
  74. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/doctor_command.py +0 -0
  75. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/index.json +0 -0
  76. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/info_command.py +0 -0
  77. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/list_command.py +0 -0
  78. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/main.py +0 -0
  79. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/manifest_schema.py +0 -0
  80. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/manifest_validator.py +0 -0
  81. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/new_command.py +0 -0
  82. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/package_registry.py +0 -0
  83. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/package_runner.py +0 -0
  84. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/package_signing.py +0 -0
  85. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/post_install_hint.py +0 -0
  86. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/publish_command.py +0 -0
  87. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/pyproject.toml +0 -0
  88. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/remote_registry.py +0 -0
  89. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/requirements.txt +0 -0
  90. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/setup.cfg +0 -0
  91. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/smart_search.py +0 -0
  92. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/system_test.py +0 -0
  93. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/templates/dart/manifest.json +0 -0
  94. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/templates/lua/manifest.json +0 -0
  95. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/templates/python/README.md +0 -0
  96. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/templates/python/main.py +0 -0
  97. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/templates/python/manifest.json +0 -0
  98. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/test-app/README.md +0 -0
  99. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/test-app/main.py +0 -0
  100. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/test-app/manifest.json +0 -0
  101. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/uninstall_command.py +0 -0
  102. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/validate_command.py +0 -0
  103. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/version_command.py +0 -0
  104. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/version_manager.py +0 -0
  105. {clapp_pm-1.0.19 → clapp_pm-1.0.21}/where_command.py +0 -0
@@ -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ş
@@ -27,6 +27,7 @@ package_registry.py
27
27
  package_runner.py
28
28
  package_signing.py
29
29
  post_install_hint.py
30
+ progress_utils.py
30
31
  publish_command.py
31
32
  pyproject.toml
32
33
  remote_registry.py
@@ -69,6 +70,7 @@ where_command.py
69
70
  ./package_runner.py
70
71
  ./package_signing.py
71
72
  ./post_install_hint.py
73
+ ./progress_utils.py
72
74
  ./publish_command.py
73
75
  ./remote_registry.py
74
76
  ./requirements.txt
@@ -126,12 +128,6 @@ where_command.py
126
128
  ./clapp_pm.egg-info/requires.txt
127
129
  ./clapp_pm.egg-info/top_level.txt
128
130
  ./docs/developer_guide.md
129
- ./packages/hello-python/main.py
130
- ./packages/hello-python/manifest.json
131
- ./packages/test-app/main.py
132
- ./packages/test-app/manifest.json
133
- ./packages/test-app2/main.py
134
- ./packages/test-app2/manifest.json
135
131
  ./templates/dart/manifest.json
136
132
  ./templates/lua/manifest.json
137
133
  ./templates/python/README.md
@@ -176,12 +172,6 @@ clapp-packages-repo/packages/test-app/manifest.json
176
172
  clapp-packages-repo/packages/test-app2/main.py
177
173
  clapp-packages-repo/packages/test-app2/manifest.json
178
174
  docs/developer_guide.md
179
- packages/hello-python/main.py
180
- packages/hello-python/manifest.json
181
- packages/test-app/main.py
182
- packages/test-app/manifest.json
183
- packages/test-app2/main.py
184
- packages/test-app2/manifest.json
185
175
  templates/dart/manifest.json
186
176
  templates/lua/manifest.json
187
177
  templates/python/README.md
@@ -16,11 +16,12 @@ list_command
16
16
  main
17
17
  manifest_schema
18
18
  manifest_validator
19
+ new_command
19
20
  package_registry
20
21
  package_runner
21
22
  package_signing
22
- packages
23
23
  post_install_hint
24
+ progress_utils
24
25
  publish_command
25
26
  remote_registry
26
27
  smart_search
@@ -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
 
@@ -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
@@ -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:
@@ -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}")
@@ -76,6 +76,8 @@ setup(
76
76
  "version_manager",
77
77
  "cache_manager",
78
78
  "smart_search",
79
+ "progress_utils",
80
+ "new_command",
79
81
  ],
80
82
 
81
83
  # Paket verileri
@@ -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",
@@ -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 +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"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes