clapp-pm 1.0.21__py3-none-any.whl → 1.0.23__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.23",
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.23
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ş
@@ -66,7 +66,7 @@ clapp, Python ve Lua uygulamalarını kolayca yükleyip çalıştırmanızı sa
66
66
  ## Kurulum
67
67
 
68
68
  ```bash
69
- pip install clapp
69
+ pip install clapp-pm
70
70
  ```
71
71
 
72
72
  ## Temel Kullanım
@@ -7,7 +7,7 @@ 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
9
  install_command.py,sha256=9m7C7dVvRop5-4TUy5V2aGb59jSPRp4NAx8QJIOC2tA,9556
10
- installer.py,sha256=IElGtgQl1GvakiWGOiewLPIepdf00K_uek_KZcsC85A,10976
10
+ installer.py,sha256=iGfD3_oDX8XC0MhA-I7RA3hoPRXMxJ5XjFwNWddng6U,12407
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
@@ -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=VLi-2QtTfVvubawUl3IlW3uVUtzZQpcej0E3tKygsIo,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.23.data/data/version.json,sha256=et5RxvhekUmHrrnjUfnJ2lsIHdoW0YqewWnLubVFlJg,239
66
+ clapp_pm-1.0.23.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.23.dist-info/METADATA,sha256=ifeiV5X7i3rFFRfXU0NF1l1rPxTabHu21ND8jha_UBQ,3983
77
+ clapp_pm-1.0.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
78
+ clapp_pm-1.0.23.dist-info/entry_points.txt,sha256=7j-3pQVpQfnaVzUV83g7zlCA30ePlnXkhHLAGGz9xrQ,36
79
+ clapp_pm-1.0.23.dist-info/top_level.txt,sha256=2FeS-lC1OV3lBqLAHahLU8vcWxlxSDLNJSk-4MmymKk,475
80
+ clapp_pm-1.0.23.dist-info/RECORD,,
installer.py CHANGED
@@ -205,11 +205,44 @@ def create_package_from_directory(source_dir, output_path=None):
205
205
  if not output_path:
206
206
  output_path = f"{app_name}.clapp.zip"
207
207
 
208
+ # Hariç tutulacak dosya ve klasörler
209
+ exclude_patterns = [
210
+ '.venv', '__pycache__', '.git', '.gitignore', '.DS_Store',
211
+ '*.pyc', '*.pyo', '*.pyd', '*.so', '*.dll', '*.dylib',
212
+ 'node_modules', '.npm', '.yarn', 'yarn.lock', 'package-lock.json',
213
+ '*.log', '*.tmp', '*.temp', '.vscode', '.idea', '*.swp', '*.swo',
214
+ 'Thumbs.db', 'desktop.ini', '.Trashes', '.Spotlight-V100'
215
+ ]
216
+
217
+ def should_exclude(path):
218
+ """Dosya/klasörün hariç tutulup tutulmayacağını kontrol eder"""
219
+ basename = os.path.basename(path)
220
+ rel_path = os.path.relpath(path, source_dir)
221
+
222
+ for pattern in exclude_patterns:
223
+ if pattern.startswith('*'):
224
+ # *.ext formatındaki pattern'ler
225
+ if basename.endswith(pattern[1:]):
226
+ return True
227
+ else:
228
+ # Tam eşleşme
229
+ if basename == pattern or rel_path == pattern:
230
+ return True
231
+ return False
232
+
208
233
  # Zip dosyasını oluştur
209
234
  with zipfile.ZipFile(output_path, 'w', zipfile.ZIP_DEFLATED) as zip_ref:
210
235
  for root, dirs, files in os.walk(source_dir):
236
+ # Dizinleri filtrele
237
+ dirs[:] = [d for d in dirs if not should_exclude(os.path.join(root, d))]
238
+
211
239
  for file in files:
212
240
  file_path = os.path.join(root, file)
241
+
242
+ # Dosyayı hariç tut
243
+ if should_exclude(file_path):
244
+ continue
245
+
213
246
  arc_path = os.path.relpath(file_path, source_dir)
214
247
  zip_ref.write(file_path, arc_path)
215
248
 
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.23"
6
6
  __author__ = "Melih Burak Memiş"
7
7
  __email__ = "mburakmemiscy@gmail.com"
8
8
  __description__ = "Lightweight cross-language app manager for Python and Lua"