accli 2.0.1__tar.gz → 2.0.2__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.
- {accli-2.0.1 → accli-2.0.2}/PKG-INFO +1 -1
- {accli-2.0.1 → accli-2.0.2}/accli/_version.py +1 -1
- {accli-2.0.1 → accli-2.0.2}/accli/token.py +28 -13
- {accli-2.0.1 → accli-2.0.2}/accli.egg-info/PKG-INFO +1 -1
- {accli-2.0.1 → accli-2.0.2}/LICENSE +0 -0
- {accli-2.0.1 → accli-2.0.2}/README.md +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli/AcceleratorJobProjectService.py +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli/AcceleratorTaskDispatcher.py +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli/AcceleratorTerminalCliProjectService.py +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli/CsvRegionalTimeseriesValidator.py +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli/__init__.py +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli/__main__.py +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli/cleanup-nfs.ps1 +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli/cli.py +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli/common.py +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli/gui.py +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli/mount_downloader.py +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli/setup-nfs.ps1 +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli.egg-info/SOURCES.txt +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli.egg-info/dependency_links.txt +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli.egg-info/entry_points.txt +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli.egg-info/requires.txt +0 -0
- {accli-2.0.1 → accli-2.0.2}/accli.egg-info/top_level.txt +0 -0
- {accli-2.0.1 → accli-2.0.2}/pyproject.toml +0 -0
- {accli-2.0.1 → accli-2.0.2}/setup.cfg +0 -0
|
@@ -39,18 +39,25 @@ def get_db_path():
|
|
|
39
39
|
|
|
40
40
|
def save_token_details(token, server_url, webcli_url):
|
|
41
41
|
db_path = get_db_path()
|
|
42
|
-
|
|
43
|
-
try:
|
|
44
|
-
os.remove(db_path)
|
|
45
|
-
except OSError:
|
|
46
|
-
pass
|
|
47
|
-
|
|
48
42
|
db = TinyDB(db_path)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
43
|
+
|
|
44
|
+
if len(db) > 0:
|
|
45
|
+
doc = next(iter(db))
|
|
46
|
+
doc_id = doc.doc_id
|
|
47
|
+
db.update({
|
|
48
|
+
'token': token,
|
|
49
|
+
'server_url': server_url,
|
|
50
|
+
'webcli_url': webcli_url
|
|
51
|
+
}, doc_ids=[doc_id])
|
|
52
|
+
for extra in list(db):
|
|
53
|
+
if extra.doc_id != doc_id:
|
|
54
|
+
db.remove(doc_ids=[extra.doc_id])
|
|
55
|
+
else:
|
|
56
|
+
db.insert({
|
|
57
|
+
'token': token,
|
|
58
|
+
'server_url': server_url,
|
|
59
|
+
'webcli_url': webcli_url
|
|
60
|
+
})
|
|
54
61
|
|
|
55
62
|
|
|
56
63
|
def get_token():
|
|
@@ -154,13 +161,21 @@ def get_github_app_token():
|
|
|
154
161
|
def set_github_app_token(github_app_token):
|
|
155
162
|
db_path = get_db_path()
|
|
156
163
|
db = TinyDB(db_path)
|
|
157
|
-
db
|
|
164
|
+
if len(db) > 0:
|
|
165
|
+
doc = next(iter(db))
|
|
166
|
+
db.update({'github_app_token': github_app_token}, doc_ids=[doc.doc_id])
|
|
167
|
+
else:
|
|
168
|
+
db.insert({'github_app_token': github_app_token})
|
|
158
169
|
|
|
159
170
|
|
|
160
171
|
def set_project_slug(project_slug):
|
|
161
172
|
db_path = get_db_path()
|
|
162
173
|
db = TinyDB(db_path)
|
|
163
|
-
db
|
|
174
|
+
if len(db) > 0:
|
|
175
|
+
doc = next(iter(db))
|
|
176
|
+
db.update({'project_slug': project_slug}, doc_ids=[doc.doc_id])
|
|
177
|
+
else:
|
|
178
|
+
db.insert({'project_slug': project_slug})
|
|
164
179
|
|
|
165
180
|
|
|
166
181
|
def get_project_slug():
|
|
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
|