clapp-pm 1.0.46__py3-none-any.whl → 1.0.47__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {clapp_pm-1.0.46.data → clapp_pm-1.0.47.data}/data/version.json +1 -1
- {clapp_pm-1.0.46.dist-info → clapp_pm-1.0.47.dist-info}/METADATA +1 -1
- {clapp_pm-1.0.46.dist-info → clapp_pm-1.0.47.dist-info}/RECORD +10 -9
- {clapp_pm-1.0.46.dist-info → clapp_pm-1.0.47.dist-info}/top_level.txt +1 -0
- main.py +13 -0
- update_command.py +260 -0
- version.py +1 -1
- {clapp_pm-1.0.46.dist-info → clapp_pm-1.0.47.dist-info}/WHEEL +0 -0
- {clapp_pm-1.0.46.dist-info → clapp_pm-1.0.47.dist-info}/entry_points.txt +0 -0
- {clapp_pm-1.0.46.dist-info → clapp_pm-1.0.47.dist-info}/licenses/LICENSE +0 -0
@@ -9,7 +9,7 @@ info_command.py,sha256=b74Pl1-x_PSezALx-lS3FkEcVNTF7a9McTKk5XTDhjM,5629
|
|
9
9
|
install_command.py,sha256=SiYxrmzZGi46dOfi8iOX4SUm7HbU06xIExZpeoHHnio,9928
|
10
10
|
installer.py,sha256=dmhPZ63IZGY2-LHCIOSKi6gI8lpbB-t6tgwWbXv0vf4,12470
|
11
11
|
list_command.py,sha256=qbeocvrg2eXRklxbYS3audQhYHGXTlMBk_tNh1cMxd0,8391
|
12
|
-
main.py,sha256=
|
12
|
+
main.py,sha256=LBqvtg4dx8qx-n6yNhXrluRBVzIuY80sHGbtE4WXDpA,24681
|
13
13
|
manifest_schema.py,sha256=QrNbj3m_jwf9Q2qhWV7o_Mx4b-duH4T8wxEtSnL8ESA,2811
|
14
14
|
manifest_validator.py,sha256=xuSWkvuXsf6l2LuO635D0eMuqwhsjf5mbwTjR--HaTI,8102
|
15
15
|
new_command.py,sha256=gz1w8zMf-gFITtRQAc9G2WES2akuCwdH7dtuDu9TacU,5926
|
@@ -22,8 +22,9 @@ publish_command.py,sha256=_gzB-c7MyHBC-UpZAzJMzi04q4MZQbrADiqeGukyqZI,15117
|
|
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
|
+
update_command.py,sha256=AVMRhU3DngCvFU5_xrBCnFZMWRvX4flJfColy6R-Tk0,8527
|
25
26
|
validate_command.py,sha256=idaujErzrwuZNT6DYCVTVwZqBDEEi1GTxIXAGBgKMKM,7623
|
26
|
-
version.py,sha256=
|
27
|
+
version.py,sha256=F8r5934qW2z6TCHCxl5ZwnT6I0JVIKncb4rxBFktME4,224
|
27
28
|
version_command.py,sha256=DZuYWtohSeM5PJNYCflBy36_k0vex3tYV2C8ixEA9ho,4259
|
28
29
|
version_manager.py,sha256=fpC7jxhIW1wZhJ9IkVwyqkgJN4mhBjUUbaLefXLDMiM,11423
|
29
30
|
where_command.py,sha256=TcLoXLGmrPSHQuvlceVuuKBsfeadIwz-E0G_5okH14g,6420
|
@@ -67,8 +68,8 @@ clapp-packages-repo/packages/cloud-web-browser/requirements.txt,sha256=fJMjUewTq
|
|
67
68
|
clapp-packages-repo/packages/test-app-2/README.md,sha256=AqVgCZ-cwXBuDHFoJdYkAHAuB6SjSjqXQrjhLu0q7cc,964
|
68
69
|
clapp-packages-repo/packages/test-app-2/main.py,sha256=24IEuyHSuPWJp2-xYhInUNEWqeueGxAO3NBgHkEgLdQ,1562
|
69
70
|
clapp-packages-repo/packages/test-app-2/manifest.json,sha256=dzxPwC-GebvxX9DodLAtdRB0WsZBm204uGGsHbpGhyY,286
|
70
|
-
clapp_pm-1.0.
|
71
|
-
clapp_pm-1.0.
|
71
|
+
clapp_pm-1.0.47.data/data/version.json,sha256=f2ZM03RdSeUygmxtCFmIKE8KkFjr-FL7E2jjI_IAFWo,239
|
72
|
+
clapp_pm-1.0.47.dist-info/licenses/LICENSE,sha256=_hryv9pKR6udRexceUYuoYCJGmYBz7e-vRuFWmm38UY,1075
|
72
73
|
docs/developer_guide.md,sha256=B-S141TSNy7e8T9KaV6Fr-ZAFhYqqgcwqWijjX0C2Xc,7336
|
73
74
|
packages/cloud-calc/README.md,sha256=PBxWn01QykaHeezWf2AsD8P8cj66KKVpyuqvGadeUJo,2162
|
74
75
|
packages/cloud-calc/main.py,sha256=9m0igRXqIZHa3KTM37pqg02HxU_tY-2j-GMJWfUauvk,14764
|
@@ -124,8 +125,8 @@ test-app/packages/test-app/manifest.json,sha256=_oJaNcbc7RINIQZ8ivzp3I75hUU2pth1
|
|
124
125
|
test-app-2/README.md,sha256=AqVgCZ-cwXBuDHFoJdYkAHAuB6SjSjqXQrjhLu0q7cc,964
|
125
126
|
test-app-2/main.py,sha256=24IEuyHSuPWJp2-xYhInUNEWqeueGxAO3NBgHkEgLdQ,1562
|
126
127
|
test-app-2/manifest.json,sha256=dzxPwC-GebvxX9DodLAtdRB0WsZBm204uGGsHbpGhyY,286
|
127
|
-
clapp_pm-1.0.
|
128
|
-
clapp_pm-1.0.
|
129
|
-
clapp_pm-1.0.
|
130
|
-
clapp_pm-1.0.
|
131
|
-
clapp_pm-1.0.
|
128
|
+
clapp_pm-1.0.47.dist-info/METADATA,sha256=TpDhwDSaRD_GWs-lKP8Ppvf5njp1cTD-zy2KwbsV8eM,3983
|
129
|
+
clapp_pm-1.0.47.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
130
|
+
clapp_pm-1.0.47.dist-info/entry_points.txt,sha256=7j-3pQVpQfnaVzUV83g7zlCA30ePlnXkhHLAGGz9xrQ,36
|
131
|
+
clapp_pm-1.0.47.dist-info/top_level.txt,sha256=cVN510LQVgc3ukU2fLtozzlDJs2JBGiMlzSEp57H6B4,510
|
132
|
+
clapp_pm-1.0.47.dist-info/RECORD,,
|
main.py
CHANGED
@@ -55,6 +55,9 @@ from dependency_resolver import (
|
|
55
55
|
# Yeni uygulama oluşturma komutu
|
56
56
|
from new_command import handle_new_command
|
57
57
|
|
58
|
+
# Update komutu
|
59
|
+
from update_command import handle_update_command
|
60
|
+
|
58
61
|
def main():
|
59
62
|
"""Ana CLI fonksiyonu"""
|
60
63
|
|
@@ -78,6 +81,7 @@ def main():
|
|
78
81
|
clapp install app.zip # ZIP dosyasından uygulama yükle
|
79
82
|
clapp uninstall hello-python # Uygulamayı kaldır
|
80
83
|
clapp upgrade hello-python # Uygulamayı güncelle
|
84
|
+
clapp update-apps [app-name] # Uygulamaları güncelle (tümü veya belirli)
|
81
85
|
clapp validate ./my-app # Uygulama klasörünü doğrula
|
82
86
|
clapp publish "./my app" # Uygulama yayınla (boşluk için tırnak kullanın)
|
83
87
|
|
@@ -134,6 +138,10 @@ def main():
|
|
134
138
|
upgrade_parser = subparsers.add_parser('upgrade', help='Uygulamayı güncelle')
|
135
139
|
upgrade_parser.add_argument('app_name', help='Güncellenecek uygulamanın adı')
|
136
140
|
|
141
|
+
# update-apps komutu (yeni)
|
142
|
+
update_apps_parser = subparsers.add_parser('update-apps', help='Uygulamaları güncelle')
|
143
|
+
update_apps_parser.add_argument('app', nargs='?', help='Güncellenecek uygulama adı (belirtilmezse tümü güncellenir)')
|
144
|
+
|
137
145
|
# search komutu
|
138
146
|
search_parser = subparsers.add_parser('search', help='Paket ara')
|
139
147
|
search_parser.add_argument('query', help='Arama terimi')
|
@@ -292,6 +300,11 @@ def main():
|
|
292
300
|
print(f"❌ {message}")
|
293
301
|
sys.exit(1)
|
294
302
|
|
303
|
+
elif args.command == 'update-apps':
|
304
|
+
# Yeni update-apps komutu
|
305
|
+
success = handle_update_command(args)
|
306
|
+
sys.exit(0 if success else 1)
|
307
|
+
|
295
308
|
elif args.command == 'search':
|
296
309
|
success, message = search_remote_packages(args.query)
|
297
310
|
if not success:
|
update_command.py
ADDED
@@ -0,0 +1,260 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
update_command.py - clapp Update Command
|
4
|
+
|
5
|
+
Bu modül kullanıcıların yüklü uygulamalarını güncellemelerini sağlar.
|
6
|
+
"""
|
7
|
+
|
8
|
+
import os
|
9
|
+
import json
|
10
|
+
import shutil
|
11
|
+
import tempfile
|
12
|
+
import urllib.request
|
13
|
+
import zipfile
|
14
|
+
from typing import Tuple, Optional, Dict, Any
|
15
|
+
from progress_utils import download_with_progress, extract_with_progress, show_success_message, show_error_message, show_info_message, show_warning_message
|
16
|
+
|
17
|
+
def load_index() -> Tuple[bool, Dict[str, Any], str]:
|
18
|
+
"""
|
19
|
+
GitHub'dan index.json'u yükler
|
20
|
+
|
21
|
+
Returns:
|
22
|
+
(success, index_data, error_message)
|
23
|
+
"""
|
24
|
+
try:
|
25
|
+
index_url = "https://raw.githubusercontent.com/mburakmmm/clapp-packages/main/index.json"
|
26
|
+
show_info_message("🔄 GitHub'dan index.json indiriliyor...")
|
27
|
+
|
28
|
+
with urllib.request.urlopen(index_url) as response:
|
29
|
+
index_data = json.loads(response.read().decode('utf-8'))
|
30
|
+
|
31
|
+
return True, index_data, ""
|
32
|
+
except Exception as e:
|
33
|
+
return False, {}, f"Index yükleme hatası: {e}"
|
34
|
+
|
35
|
+
def get_installed_apps() -> Dict[str, Dict[str, Any]]:
|
36
|
+
"""
|
37
|
+
Yerel olarak yüklü uygulamaları listeler
|
38
|
+
|
39
|
+
Returns:
|
40
|
+
Dict[app_name, app_info]
|
41
|
+
"""
|
42
|
+
installed_apps = {}
|
43
|
+
apps_dir = os.path.expanduser("~/.clapp/apps")
|
44
|
+
|
45
|
+
if not os.path.exists(apps_dir):
|
46
|
+
return installed_apps
|
47
|
+
|
48
|
+
for app_name in os.listdir(apps_dir):
|
49
|
+
app_path = os.path.join(apps_dir, app_name)
|
50
|
+
if os.path.isdir(app_path):
|
51
|
+
manifest_path = os.path.join(app_path, "manifest.json")
|
52
|
+
if os.path.exists(manifest_path):
|
53
|
+
try:
|
54
|
+
with open(manifest_path, 'r', encoding='utf-8') as f:
|
55
|
+
manifest = json.load(f)
|
56
|
+
installed_apps[app_name] = {
|
57
|
+
'version': manifest.get('version', 'unknown'),
|
58
|
+
'path': app_path,
|
59
|
+
'manifest': manifest
|
60
|
+
}
|
61
|
+
except:
|
62
|
+
continue
|
63
|
+
|
64
|
+
return installed_apps
|
65
|
+
|
66
|
+
def check_for_updates(app_name: str, current_version: str, index_data: Dict[str, Any]) -> Optional[str]:
|
67
|
+
"""
|
68
|
+
Uygulama için güncelleme kontrol eder
|
69
|
+
|
70
|
+
Args:
|
71
|
+
app_name: Uygulama adı
|
72
|
+
current_version: Mevcut sürüm
|
73
|
+
index_data: Index verisi
|
74
|
+
|
75
|
+
Returns:
|
76
|
+
En son sürüm (güncelleme varsa) veya None
|
77
|
+
"""
|
78
|
+
if app_name not in index_data:
|
79
|
+
return None
|
80
|
+
|
81
|
+
app_versions = index_data[app_name]
|
82
|
+
|
83
|
+
# En son sürümü bul
|
84
|
+
latest_version = None
|
85
|
+
for version in app_versions.keys():
|
86
|
+
if latest_version is None or version > latest_version:
|
87
|
+
latest_version = version
|
88
|
+
|
89
|
+
if latest_version and latest_version > current_version:
|
90
|
+
return latest_version
|
91
|
+
|
92
|
+
return None
|
93
|
+
|
94
|
+
def download_and_install_update(app_name: str, version: str, index_data: Dict[str, Any]) -> Tuple[bool, str]:
|
95
|
+
"""
|
96
|
+
Uygulama güncellemesini indirir ve yükler
|
97
|
+
|
98
|
+
Args:
|
99
|
+
app_name: Uygulama adı
|
100
|
+
version: Yüklenecek sürüm
|
101
|
+
index_data: Index verisi
|
102
|
+
|
103
|
+
Returns:
|
104
|
+
(success, message)
|
105
|
+
"""
|
106
|
+
try:
|
107
|
+
app_info = index_data[app_name][version]
|
108
|
+
repo_url = app_info['repo_url']
|
109
|
+
subdir = app_info['subdir']
|
110
|
+
|
111
|
+
# GitHub'dan zip dosyasını indir
|
112
|
+
zip_url = f"{repo_url}/archive/refs/heads/main.zip"
|
113
|
+
show_info_message(f"📦 {app_name} v{version} indiriliyor...")
|
114
|
+
|
115
|
+
with tempfile.NamedTemporaryFile(suffix='.zip', delete=False) as temp_file:
|
116
|
+
temp_zip_path = temp_file.name
|
117
|
+
|
118
|
+
# İndirme işlemi
|
119
|
+
download_with_progress(zip_url, temp_zip_path, f"📦 {app_name} indiriliyor")
|
120
|
+
|
121
|
+
# Geçici dizin oluştur
|
122
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
123
|
+
# Zip dosyasını çıkar
|
124
|
+
extract_with_progress(temp_zip_path, temp_dir, f"📦 {app_name} çıkarılıyor")
|
125
|
+
|
126
|
+
# Uygulama dizinini bul
|
127
|
+
extracted_dir = os.path.join(temp_dir, "clapp-packages-main", subdir)
|
128
|
+
if not os.path.exists(extracted_dir):
|
129
|
+
return False, f"Uygulama dizini bulunamadı: {subdir}"
|
130
|
+
|
131
|
+
# Yüklü uygulamayı yedekle
|
132
|
+
apps_dir = os.path.expanduser("~/.clapp/apps")
|
133
|
+
app_path = os.path.join(apps_dir, app_name)
|
134
|
+
backup_path = os.path.join(apps_dir, f"{app_name}_backup")
|
135
|
+
|
136
|
+
if os.path.exists(app_path):
|
137
|
+
if os.path.exists(backup_path):
|
138
|
+
shutil.rmtree(backup_path)
|
139
|
+
shutil.move(app_path, backup_path)
|
140
|
+
|
141
|
+
# Yeni sürümü yükle
|
142
|
+
shutil.copytree(extracted_dir, app_path)
|
143
|
+
|
144
|
+
# Eski yedekleri temizle
|
145
|
+
if os.path.exists(backup_path):
|
146
|
+
shutil.rmtree(backup_path)
|
147
|
+
|
148
|
+
# Geçici zip dosyasını sil
|
149
|
+
os.unlink(temp_zip_path)
|
150
|
+
|
151
|
+
return True, f"{app_name} v{version} başarıyla güncellendi!"
|
152
|
+
|
153
|
+
except Exception as e:
|
154
|
+
return False, f"Güncelleme hatası: {e}"
|
155
|
+
|
156
|
+
def update_app(app_name: str) -> Tuple[bool, str]:
|
157
|
+
"""
|
158
|
+
Belirtilen uygulamayı günceller
|
159
|
+
|
160
|
+
Args:
|
161
|
+
app_name: Güncellenecek uygulama adı
|
162
|
+
|
163
|
+
Returns:
|
164
|
+
(success, message)
|
165
|
+
"""
|
166
|
+
# Yüklü uygulamaları kontrol et
|
167
|
+
installed_apps = get_installed_apps()
|
168
|
+
if app_name not in installed_apps:
|
169
|
+
return False, f"'{app_name}' yüklü değil"
|
170
|
+
|
171
|
+
current_version = installed_apps[app_name]['version']
|
172
|
+
show_info_message(f"🔍 {app_name} (v{current_version}) güncellemeleri kontrol ediliyor...")
|
173
|
+
|
174
|
+
# Index'i yükle
|
175
|
+
success, index_data, error = load_index()
|
176
|
+
if not success:
|
177
|
+
return False, error
|
178
|
+
|
179
|
+
# Güncelleme kontrol et
|
180
|
+
latest_version = check_for_updates(app_name, current_version, index_data)
|
181
|
+
if not latest_version:
|
182
|
+
return True, f"{app_name} zaten en son sürümde (v{current_version})"
|
183
|
+
|
184
|
+
show_info_message(f"🔄 {app_name} v{current_version} → v{latest_version} güncelleniyor...")
|
185
|
+
|
186
|
+
# Güncellemeyi indir ve yükle
|
187
|
+
success, message = download_and_install_update(app_name, latest_version, index_data)
|
188
|
+
if success:
|
189
|
+
show_success_message(message)
|
190
|
+
else:
|
191
|
+
show_error_message(message)
|
192
|
+
|
193
|
+
return success, message
|
194
|
+
|
195
|
+
def update_all_apps() -> Tuple[bool, str]:
|
196
|
+
"""
|
197
|
+
Tüm yüklü uygulamaları günceller
|
198
|
+
|
199
|
+
Returns:
|
200
|
+
(success, message)
|
201
|
+
"""
|
202
|
+
installed_apps = get_installed_apps()
|
203
|
+
if not installed_apps:
|
204
|
+
return True, "Yüklü uygulama bulunamadı"
|
205
|
+
|
206
|
+
show_info_message(f"🔍 {len(installed_apps)} uygulama için güncellemeler kontrol ediliyor...")
|
207
|
+
|
208
|
+
# Index'i yükle
|
209
|
+
success, index_data, error = load_index()
|
210
|
+
if not success:
|
211
|
+
return False, error
|
212
|
+
|
213
|
+
updated_count = 0
|
214
|
+
errors = []
|
215
|
+
|
216
|
+
for app_name in installed_apps.keys():
|
217
|
+
current_version = installed_apps[app_name]['version']
|
218
|
+
latest_version = check_for_updates(app_name, current_version, index_data)
|
219
|
+
|
220
|
+
if latest_version:
|
221
|
+
show_info_message(f"🔄 {app_name} v{current_version} → v{latest_version} güncelleniyor...")
|
222
|
+
success, message = download_and_install_update(app_name, latest_version, index_data)
|
223
|
+
if success:
|
224
|
+
updated_count += 1
|
225
|
+
show_success_message(f"✅ {app_name} güncellendi")
|
226
|
+
else:
|
227
|
+
errors.append(f"{app_name}: {message}")
|
228
|
+
else:
|
229
|
+
show_info_message(f"✅ {app_name} zaten güncel (v{current_version})")
|
230
|
+
|
231
|
+
# Sonuç raporu
|
232
|
+
if updated_count > 0:
|
233
|
+
message = f"✅ {updated_count} uygulama güncellendi"
|
234
|
+
if errors:
|
235
|
+
message += f"\n❌ Hatalar: {', '.join(errors)}"
|
236
|
+
return True, message
|
237
|
+
else:
|
238
|
+
return True, "Tüm uygulamalar zaten güncel"
|
239
|
+
|
240
|
+
def handle_update_command(args):
|
241
|
+
"""
|
242
|
+
Update komutunu işler
|
243
|
+
|
244
|
+
Args:
|
245
|
+
args: Argparse arguments
|
246
|
+
"""
|
247
|
+
if args.app:
|
248
|
+
# Belirli uygulamayı güncelle
|
249
|
+
success, message = update_app(args.app)
|
250
|
+
if not success:
|
251
|
+
show_error_message(message)
|
252
|
+
return False
|
253
|
+
else:
|
254
|
+
# Tüm uygulamaları güncelle
|
255
|
+
success, message = update_all_apps()
|
256
|
+
if not success:
|
257
|
+
show_error_message(message)
|
258
|
+
return False
|
259
|
+
|
260
|
+
return True
|
version.py
CHANGED
File without changes
|
File without changes
|
File without changes
|