clapp-pm 1.0.21__py3-none-any.whl → 1.0.22__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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "app_name": "clapp",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
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.21
3
+ Version: 1.0.22
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ş
@@ -17,13 +17,13 @@ package_registry.py,sha256=Rco15cvz-6lpCEDdCzwGZNCKtvVhlFIsEPy-WFAESMM,4233
17
17
  package_runner.py,sha256=GqLPlQRxh7g3bDgGDSVpmHdeRXaP5f6s8kp8QVnw5LM,5783
18
18
  package_signing.py,sha256=ModMAzLk08rkI6zd8QKhyCH5BFbB-7dy8pwqKYatFQo,4579
19
19
  post_install_hint.py,sha256=wjMPCgRurZiGu6hv_se-XA36KqBCdeYdRCD1q7FrJzQ,4918
20
- progress_utils.py,sha256=yiQ2e-jrU8UVt36iOC_pdKx6cuv1YPNCTZNIItbEPPU,8263
20
+ progress_utils.py,sha256=ZH73QNLd5mI4h-JU0hSFR2OU8lesr2XteSZdmFD0bFA,5995
21
21
  publish_command.py,sha256=P05AFbu_mxcc1yAiwShN5Yi9PX1o_7TFXD1mowJcqJE,8589
22
22
  remote_registry.py,sha256=rPBIM_ESXUt0br5cARQ4YbzUoTda0G4e1KGzfyYMbpQ,8235
23
23
  smart_search.py,sha256=R5O5CDXqlQc-N-6R6D5k36_-arCB-wnKfmWr5zMYWUI,15741
24
24
  uninstall_command.py,sha256=rQYbZ-XMw8Xxw1fmgGdDaBQmgBGqyJ_rTBZkvEV5HV0,7066
25
25
  validate_command.py,sha256=idaujErzrwuZNT6DYCVTVwZqBDEEi1GTxIXAGBgKMKM,7623
26
- version.py,sha256=H9_enMWKOmwY_YpwVRxCb26vBaOVq9GK3iQUblkJn68,224
26
+ version.py,sha256=eieXzRht0Gi6TgXgx-HNBh7q-2wbwT9FgWwXK-Ph6Yk,224
27
27
  version_command.py,sha256=DZuYWtohSeM5PJNYCflBy36_k0vex3tYV2C8ixEA9ho,4259
28
28
  version_manager.py,sha256=fpC7jxhIW1wZhJ9IkVwyqkgJN4mhBjUUbaLefXLDMiM,11423
29
29
  where_command.py,sha256=TcLoXLGmrPSHQuvlceVuuKBsfeadIwz-E0G_5okH14g,6420
@@ -62,8 +62,8 @@ clapp-packages-repo/packages/test-app/main.py,sha256=rN4Zo9u53bIVjcUlul059knx6v-
62
62
  clapp-packages-repo/packages/test-app/manifest.json,sha256=kJe4sjYdPRNZD5hEeca80jj3lxeEWBMJoZ59RW7tiKI,118
63
63
  clapp-packages-repo/packages/test-app2/main.py,sha256=lHkbjTmehFY4VuYYF2dYiVBH7W0oqHHeY0I5W85iPTY,35
64
64
  clapp-packages-repo/packages/test-app2/manifest.json,sha256=vshXJrtRxBc_ISM6E8KT5BSmveMbjWszenlgxgSN86w,121
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
+ clapp_pm-1.0.22.data/data/version.json,sha256=Rzn1cwLuEJd-nwrMAw5onWyppNZsXZtMsnndzyYQaPg,239
66
+ clapp_pm-1.0.22.dist-info/licenses/LICENSE,sha256=_hryv9pKR6udRexceUYuoYCJGmYBz7e-vRuFWmm38UY,1075
67
67
  docs/developer_guide.md,sha256=B-S141TSNy7e8T9KaV6Fr-ZAFhYqqgcwqWijjX0C2Xc,7336
68
68
  templates/dart/manifest.json,sha256=ycVKZxrArzcSoRZ5LKKe8aOerwk5Z-7VX0td86aim0M,267
69
69
  templates/lua/manifest.json,sha256=CRIy0dP6Pr3vH6IV4dObGs4KqqJ_sURsY0wAgK2av7E,262
@@ -73,8 +73,8 @@ templates/python/manifest.json,sha256=hjmKqsEkWEBTwxFgm35MkvuwWZ2CQWq9Zo8uHodqHr
73
73
  test-app/README.md,sha256=AqVgCZ-cwXBuDHFoJdYkAHAuB6SjSjqXQrjhLu0q7cc,964
74
74
  test-app/main.py,sha256=24IEuyHSuPWJp2-xYhInUNEWqeueGxAO3NBgHkEgLdQ,1562
75
75
  test-app/manifest.json,sha256=MM1nl5Bljrnsik3fwsrgFBchfgwIb2REoBwwzNpFHQU,284
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,,
76
+ clapp_pm-1.0.22.dist-info/METADATA,sha256=6RDt7lHkh-BGtTBEWX-XeSZURL5D7DENBYi-qgJP_W4,3980
77
+ clapp_pm-1.0.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
78
+ clapp_pm-1.0.22.dist-info/entry_points.txt,sha256=7j-3pQVpQfnaVzUV83g7zlCA30ePlnXkhHLAGGz9xrQ,36
79
+ clapp_pm-1.0.22.dist-info/top_level.txt,sha256=2FeS-lC1OV3lBqLAHahLU8vcWxlxSDLNJSk-4MmymKk,475
80
+ clapp_pm-1.0.22.dist-info/RECORD,,
progress_utils.py CHANGED
@@ -11,6 +11,8 @@ import threading
11
11
  from typing import Optional, Callable
12
12
  from urllib.request import urlopen
13
13
  from urllib.error import URLError
14
+ from tqdm import tqdm
15
+
14
16
 
15
17
  class ProgressBar:
16
18
  """Progress bar sınıfı"""
@@ -24,6 +26,7 @@ class ProgressBar:
24
26
  self.last_update = 0
25
27
  self.speed = 0
26
28
  self.lock = threading.Lock()
29
+ self.last_line_length = 0 # Son satır uzunluğunu takip et
27
30
 
28
31
  def update(self, current: int, speed: Optional[float] = None):
29
32
  """Progress bar'ı günceller"""
@@ -39,41 +42,30 @@ class ProgressBar:
39
42
  self.speed = self.current / elapsed
40
43
 
41
44
  def display(self):
42
- """Progress bar'ı ekranda gösterir"""
43
45
  if self.total <= 0:
44
46
  return
45
-
47
+
46
48
  percentage = (self.current / self.total) * 100
47
49
  filled_width = int(self.width * self.current // self.total)
48
-
49
- # Progress bar oluştur
50
50
  bar = '█' * filled_width + '░' * (self.width - filled_width)
51
-
52
- # Hız formatı
53
51
  speed_str = self._format_speed(self.speed)
54
-
55
- # Yüzde ve boyut bilgisi
56
52
  current_str = self._format_size(self.current)
57
53
  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)
54
+ progress_line = f"{self.description}: [{bar}] {percentage:5.1f}% | {current_str}/{total_str} | {speed_str}"
55
+
56
+ # Satır başına dön, progress barı yaz, kalan karakterleri temizle
57
+ pad = getattr(self, 'last_line_length', 0) - len(progress_line)
58
+ sys.stdout.write('\r' + progress_line + (' ' * pad if pad > 0 else ''))
65
59
  sys.stdout.flush()
66
-
60
+ self.last_line_length = len(progress_line)
61
+
67
62
  def finish(self, success: bool = True):
68
- """Progress bar'ı tamamlar"""
63
+ # Satırı temizle
64
+ sys.stdout.write('\r' + ' ' * getattr(self, 'last_line_length', 80) + '\r')
69
65
  if success:
70
- # Tamamlandı mesajı
71
- sys.stdout.write('\r' + ' ' * (self.width + 50)) # Temizle
72
- sys.stdout.write(f"\r✅ {self.description} tamamlandı!\n")
66
+ print(f"✅ {self.description} tamamlandı!")
73
67
  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")
68
+ print(f"❌ {self.description} başarısız!")
77
69
  sys.stdout.flush()
78
70
 
79
71
  def _format_speed(self, speed: float) -> str:
@@ -99,176 +91,83 @@ class ProgressBar:
99
91
 
100
92
  def download_with_progress(url: str, filename: str, description: str = "İndiriliyor") -> bool:
101
93
  """
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
94
+ tqdm ile dosya indirir
111
95
  """
112
96
  try:
113
- # URL'den dosya boyutunu al
114
97
  response = urlopen(url)
115
98
  total_size = int(response.headers.get('content-length', 0))
116
99
  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)
100
+ with urlopen(url) as response, open(filename, 'wb') as file, tqdm(
101
+ total=total_size, unit='B', unit_scale=True, desc=description, ncols=80
102
+ ) as bar:
103
+ downloaded = 0
104
+ chunk_size = 8192
105
+ while True:
106
+ chunk = response.read(chunk_size)
107
+ if not chunk:
108
+ break
109
+ file.write(chunk)
110
+ downloaded += len(chunk)
111
+ bar.update(len(chunk))
112
+ print(f"✅ {description} tamamlandı!")
144
113
  return True
145
-
146
114
  except Exception as e:
147
- if 'progress' in locals():
148
- progress.finish(False)
149
115
  print(f"❌ İndirme hatası: {e}")
150
116
  return False
151
117
 
152
-
153
118
  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
119
  import os
166
- import shutil
167
-
168
120
  try:
169
- # Dosya boyutunu al
170
121
  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)
122
+ with open(src, 'rb') as src_file, open(dst, 'wb') as dst_file, tqdm(
123
+ total=total_size, unit='B', unit_scale=True, desc=description, ncols=80
124
+ ) as bar:
125
+ copied = 0
126
+ chunk_size = 8192
127
+ while True:
128
+ chunk = src_file.read(chunk_size)
129
+ if not chunk:
130
+ break
131
+ dst_file.write(chunk)
132
+ copied += len(chunk)
133
+ bar.update(len(chunk))
134
+ print(f"✅ {description} tamamlandı!")
198
135
  return True
199
-
200
136
  except Exception as e:
201
- if 'progress' in locals():
202
- progress.finish(False)
203
137
  print(f"❌ Kopyalama hatası: {e}")
204
138
  return False
205
139
 
206
-
207
140
  def extract_with_progress(zip_path: str, extract_path: str, description: str = "Çıkarılıyor") -> bool:
208
141
  """
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
142
+ tqdm ile ZIP dosyası çıkarır
218
143
  """
219
144
  import zipfile
220
145
  import os
221
-
222
146
  try:
223
147
  with zipfile.ZipFile(zip_path, 'r') as zip_ref:
224
- # Toplam dosya sayısı
225
148
  file_list = zip_ref.filelist
226
149
  total_files = len(file_list)
227
-
228
150
  if total_files == 0:
229
151
  print(f"❌ ZIP dosyası boş: {zip_path}")
230
152
  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)
153
+ with tqdm(total=total_files, desc=description, ncols=80, unit='dosya') as bar:
154
+ for file_info in file_list:
155
+ zip_ref.extract(file_info, extract_path)
156
+ bar.update(1)
157
+ print(f"✅ {description} tamamlandı!")
248
158
  return True
249
-
250
159
  except Exception as e:
251
- if 'progress' in locals():
252
- progress.finish(False)
253
160
  print(f"❌ Çıkarma hatası: {e}")
254
161
  return False
255
162
 
256
-
257
163
  def show_success_message(message: str):
258
- """Başarı mesajı gösterir"""
259
164
  print(f"✅ {message}")
260
165
 
261
-
262
166
  def show_error_message(message: str):
263
- """Hata mesajı gösterir"""
264
167
  print(f"❌ {message}")
265
168
 
266
-
267
169
  def show_info_message(message: str):
268
- """Bilgi mesajı gösterir"""
269
170
  print(f"ℹ️ {message}")
270
171
 
271
-
272
172
  def show_warning_message(message: str):
273
- """Uyarı mesajı gösterir"""
274
173
  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.21"
5
+ __version__ = "1.0.22"
6
6
  __author__ = "Melih Burak Memiş"
7
7
  __email__ = "mburakmemiscy@gmail.com"
8
8
  __description__ = "Lightweight cross-language app manager for Python and Lua"