gibson-cli 0.1.6__tar.gz → 0.2.0__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.
- {gibson_cli-0.1.6/gibson_cli.egg-info → gibson_cli-0.2.0}/PKG-INFO +1 -1
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/api/BaseApi.py +9 -26
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/api/Cli.py +2 -2
- gibson_cli-0.2.0/gibson/command/auth/Login.py +15 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/core/Configuration.py +43 -3
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/core/Conversation.py +22 -3
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/data/bash-completion.tmpl +11 -8
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/lang/Python.py +5 -3
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/lang/tests/test_lang_Python.py +2 -7
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/customization/Authenticator.py +1 -1
- {gibson_cli-0.1.6 → gibson_cli-0.2.0/gibson_cli.egg-info}/PKG-INFO +1 -1
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/pyproject.toml +1 -1
- gibson_cli-0.1.6/gibson/command/auth/Login.py +0 -20
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/.gitignore +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/.pre-commit-config.yaml +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/README.md +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/bin/build.sh +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/bin/release.sh +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/bin/gibson.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Api.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Base.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/BaseCommand.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Build.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Code.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Conf.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Count.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Dev.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Forget.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Import.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/List.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Merge.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Model.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Models.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Modify.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Module.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/New.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/OpenApi.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Question.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Remove.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Rename.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Rewrite.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Schema.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Schemas.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Show.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Test.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Tests.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Tree.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/Version.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/WarGames.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/auth/Auth.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/auth/Logout.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/tests/test_command_BaseCommand.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/command/tests/test_command_Conf.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/Api.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/Code.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/Custom.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/Datastore.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/Dependencies.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/Dev.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/Frameworks.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/Modeler.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/Paths.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/Platform.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/Project.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/Version.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/dev/Api.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/dev/Base.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/dev/Model.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/dev/Schema.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/tests/test_conf_Dependencies.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/conf/tests/test_conf_Platform.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/core/CommandRouter.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/core/Completions.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/core/Env.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/core/Memory.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/core/TimeKeeper.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/core/utils.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/data/default-ref-table.tmpl +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/data/default-table.tmpl +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/db/TableExceptions.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/db/tests/test_db_TableExceptions.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/dev/Dev.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/display/Header.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/display/WorkspaceFooter.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/display/WorkspaceHeader.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/display/tests/test_display_Header.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/display/tests/test_display_WorkspaceFooter.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/display/tests/test_display_WorkspaceHeader.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/auth/Server.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/context/schema/DataDictionary.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/context/schema/EntityKeys.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/context/schema/Manager.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/context/schema/tests/test_code_context_schema_DataDictionary.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/context/schema/tests/test_code_context_schema_EntityKeys.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/context/schema/tests/test_code_context_schema_Manager.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/customization/BaseCustomization.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/customization/CustomizationManager.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/customization/tests/test_code_customization_Authenticator.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/customization/tests/test_code_customization_BaseCustomization.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/structure/Entity.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/structure/constraints/ReferenceConstraint.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/structure/keys/ForeignKey.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/structure/keys/Index.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/structure/keys/IndexAttribute.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/structure/keys/tests/test_ForeignKey.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/structure/keys/tests/test_Index.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/structure/keys/tests/test_IndexAttribute.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/structure/testing.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/structure/tests/test_Entity.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/tests/test_Env.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/tests/test_Memory.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/tests/test_utils.py +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson_cli.egg-info/SOURCES.txt +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson_cli.egg-info/dependency_links.txt +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson_cli.egg-info/entry_points.txt +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson_cli.egg-info/top_level.txt +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/requirements.txt +0 -0
- {gibson_cli-0.1.6 → gibson_cli-0.2.0}/setup.cfg +0 -0
@@ -1,41 +1,18 @@
|
|
1
1
|
import os
|
2
|
+
|
2
3
|
import requests
|
3
4
|
|
4
5
|
from gibson.core.Configuration import Configuration
|
5
6
|
|
6
7
|
|
7
8
|
class BaseApi:
|
8
|
-
API_ENV = os.environ.get("GIBSONAI_API_ENV", "staging")
|
9
9
|
VERSION = "v1"
|
10
10
|
|
11
11
|
def __init__(self, configuration: Configuration):
|
12
12
|
self.configuration = configuration
|
13
13
|
|
14
|
-
def api_domain(self):
|
15
|
-
domains = {
|
16
|
-
"local": "http://localhost:8000",
|
17
|
-
"staging": "https://staging-api.gibsonai.com",
|
18
|
-
"production": "https://api.gibsonai.com",
|
19
|
-
}
|
20
|
-
return domains[self.API_ENV]
|
21
|
-
|
22
|
-
def app_domain(self):
|
23
|
-
domains = {
|
24
|
-
"local": "http://localhost:5173",
|
25
|
-
"staging": "https://staging-app.gibsonai.com",
|
26
|
-
"production": "https://app.gibsonai.com",
|
27
|
-
}
|
28
|
-
return domains[self.API_ENV]
|
29
|
-
|
30
14
|
def base_url(self):
|
31
|
-
return f"{self.api_domain()}/{self.VERSION}"
|
32
|
-
|
33
|
-
def client_id(self):
|
34
|
-
return {
|
35
|
-
"local": "9b0cbebd-3eb4-47be-89ac-4aa589316ff4",
|
36
|
-
"staging": "02459e16-f356-4c01-b689-59847ed04b0a",
|
37
|
-
"production": "da287371-240b-4b53-bfde-4b1581cca62a",
|
38
|
-
}[self.API_ENV]
|
15
|
+
return f"{self.configuration.api_domain()}/{self.VERSION}"
|
39
16
|
|
40
17
|
def get(self, endpoint):
|
41
18
|
r = requests.get(self.url(endpoint), headers=self.headers())
|
@@ -82,6 +59,7 @@ class BaseApi:
|
|
82
59
|
)
|
83
60
|
|
84
61
|
if r.status_code != 200:
|
62
|
+
self.configuration.set_auth_tokens(None, None)
|
85
63
|
return False
|
86
64
|
|
87
65
|
parsed = r.json()
|
@@ -96,12 +74,17 @@ class BaseApi:
|
|
96
74
|
return f"{self.base_url()}/{endpoint}"
|
97
75
|
|
98
76
|
def __raise_for_status(self, r):
|
77
|
+
if r.status_code == 401:
|
78
|
+
print("\n\nYou need to log in to continue. Please run:\n")
|
79
|
+
print(" gibson auth login\n\n")
|
80
|
+
print("and then try again.\n")
|
81
|
+
exit(1)
|
82
|
+
|
99
83
|
try:
|
100
84
|
r.raise_for_status()
|
101
85
|
except:
|
102
86
|
try:
|
103
87
|
message = r.json()
|
104
|
-
|
105
88
|
print("=" * 78)
|
106
89
|
print("Raw Response:\n")
|
107
90
|
print(message)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from gibson.core.Configuration import Configuration
|
2
|
-
from gibson.lang.Python import Python
|
3
2
|
from gibson.core.Memory import Memory
|
3
|
+
from gibson.lang.Python import Python
|
4
4
|
|
5
5
|
from .BaseApi import BaseApi
|
6
6
|
|
@@ -61,7 +61,7 @@ class Cli(BaseApi):
|
|
61
61
|
|
62
62
|
def headers(self):
|
63
63
|
headers = {
|
64
|
-
"X-Gibson-Client-ID": self.client_id(),
|
64
|
+
"X-Gibson-Client-ID": self.configuration.client_id(),
|
65
65
|
"X-Gibson-API-Key": self.configuration.project.api.key,
|
66
66
|
}
|
67
67
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
from gibson.api.BaseApi import BaseApi
|
2
|
+
from gibson.command.BaseCommand import BaseCommand
|
3
|
+
from gibson.services.auth.Server import Server as AuthServer
|
4
|
+
|
5
|
+
|
6
|
+
class Login(BaseCommand):
|
7
|
+
def execute(self):
|
8
|
+
authenticated = self.configuration.login()
|
9
|
+
|
10
|
+
if authenticated:
|
11
|
+
self.conversation.message_login_success()
|
12
|
+
else:
|
13
|
+
self.conversation.message_login_failure()
|
14
|
+
|
15
|
+
self.conversation.newline()
|
@@ -6,11 +6,12 @@ import sys
|
|
6
6
|
import time
|
7
7
|
|
8
8
|
from gibson.conf.Dependencies import Dependencies
|
9
|
+
from gibson.conf.Paths import ConfigPaths
|
9
10
|
from gibson.conf.Platform import Platform
|
10
11
|
from gibson.conf.Project import Project
|
11
|
-
from gibson.conf.Paths import ConfigPaths
|
12
12
|
from gibson.core.Completions import Completions
|
13
13
|
from gibson.core.Conversation import Conversation
|
14
|
+
from gibson.services.auth.Server import Server as AuthServer
|
14
15
|
|
15
16
|
|
16
17
|
class Configuration:
|
@@ -37,6 +38,29 @@ class Configuration:
|
|
37
38
|
|
38
39
|
Completions().write().install()
|
39
40
|
|
41
|
+
def api_domain(self):
|
42
|
+
domains = {
|
43
|
+
"local": "http://localhost:8000",
|
44
|
+
"staging": "https://staging-api.gibsonai.com",
|
45
|
+
"production": "https://api.gibsonai.com",
|
46
|
+
}
|
47
|
+
return domains[self.API_ENV]
|
48
|
+
|
49
|
+
def app_domain(self):
|
50
|
+
domains = {
|
51
|
+
"local": "http://localhost:5173",
|
52
|
+
"staging": "https://staging-app.gibsonai.com",
|
53
|
+
"production": "https://app.gibsonai.com",
|
54
|
+
}
|
55
|
+
return domains[self.API_ENV]
|
56
|
+
|
57
|
+
def client_id(self):
|
58
|
+
return {
|
59
|
+
"local": "9b0cbebd-3eb4-47be-89ac-4aa589316ff4",
|
60
|
+
"staging": "02459e16-f356-4c01-b689-59847ed04b0a",
|
61
|
+
"production": "da287371-240b-4b53-bfde-4b1581cca62a",
|
62
|
+
}[self.API_ENV]
|
63
|
+
|
40
64
|
def append_project_to_conf(self, project_name, project_description):
|
41
65
|
self.project.api.key = "FIXME"
|
42
66
|
self.project.name = project_name
|
@@ -269,7 +293,7 @@ class Configuration:
|
|
269
293
|
|
270
294
|
def get_my_settings(self):
|
271
295
|
return self.settings[self.project.name]
|
272
|
-
|
296
|
+
|
273
297
|
def get_refresh_token(self):
|
274
298
|
try:
|
275
299
|
with open(f"{self.paths.auth}/{self.API_ENV}", "r") as f:
|
@@ -282,7 +306,15 @@ class Configuration:
|
|
282
306
|
|
283
307
|
def initialize(self):
|
284
308
|
self.conversation.message_welcome()
|
285
|
-
|
309
|
+
|
310
|
+
authenticated = self.login()
|
311
|
+
if authenticated is False:
|
312
|
+
self.conversation.message_login_failure()
|
313
|
+
exit(1)
|
314
|
+
else:
|
315
|
+
self.conversation.message_login_success()
|
316
|
+
|
317
|
+
self.conversation.message_project_setup()
|
286
318
|
project_name = self.conversation.prompt_project()
|
287
319
|
project_description = self.conversation.prompt_description(project_name)
|
288
320
|
|
@@ -308,6 +340,14 @@ class Configuration:
|
|
308
340
|
|
309
341
|
return self
|
310
342
|
|
343
|
+
def login(self):
|
344
|
+
access_token, refresh_token = AuthServer(self.app_domain()).get_tokens()
|
345
|
+
if access_token is None or refresh_token is None:
|
346
|
+
return False
|
347
|
+
|
348
|
+
self.set_auth_tokens(access_token, refresh_token)
|
349
|
+
return True
|
350
|
+
|
311
351
|
def read_config(self):
|
312
352
|
try:
|
313
353
|
with open(self.project.paths.config, "r") as f:
|
@@ -123,6 +123,16 @@ class Conversation:
|
|
123
123
|
self.type('Last item of business, if you need help just type "gibson help".\n')
|
124
124
|
return self
|
125
125
|
|
126
|
+
def message_login_failure(self):
|
127
|
+
self.newline()
|
128
|
+
self.type("Login failed, please try again.\n")
|
129
|
+
return self
|
130
|
+
|
131
|
+
def message_login_success(self):
|
132
|
+
self.newline()
|
133
|
+
self.type("Nice! You're now logged in.\n")
|
134
|
+
return self
|
135
|
+
|
126
136
|
def message_new_project(self, project_name):
|
127
137
|
self.type(
|
128
138
|
f"\n{project_name} is going to be huge! Congratulations on the new project.\n\n"
|
@@ -134,11 +144,20 @@ class Conversation:
|
|
134
144
|
print(pyfiglet.figlet_format("GibsonAI", font="big").rstrip(), end="")
|
135
145
|
print(f" ...CLI v{Version.num}...")
|
136
146
|
self.newline()
|
147
|
+
self.type("Welcome to Gibson!\n")
|
137
148
|
self.pause()
|
138
|
-
self.
|
149
|
+
self.newline()
|
150
|
+
self.type("First, let's get you logged in.\n")
|
139
151
|
self.pause()
|
152
|
+
self.newline()
|
153
|
+
self.type("We're opening your web browser to the login page.\n")
|
154
|
+
self.type("Please log in and then return to this window.\n")
|
155
|
+
return self
|
156
|
+
|
157
|
+
def message_project_setup(self):
|
158
|
+
self.newline()
|
140
159
|
self.type(
|
141
|
-
"
|
160
|
+
"Now let's set up your first project. Give me the name of the project you're working on.\n"
|
142
161
|
)
|
143
162
|
self.type(
|
144
163
|
"Don't worry, once we get to know each other you'll be able to modify this\n"
|
@@ -182,7 +201,7 @@ class Conversation:
|
|
182
201
|
self.newline()
|
183
202
|
|
184
203
|
def pause(self):
|
185
|
-
time.sleep(
|
204
|
+
time.sleep(1)
|
186
205
|
|
187
206
|
def project_already_exists(self, project_name):
|
188
207
|
self.type(f'\nA project called "{project_name}" already exists.\n')
|
@@ -47,18 +47,16 @@ __gibson_commands_and_options() {
|
|
47
47
|
tree
|
48
48
|
q
|
49
49
|
'
|
50
|
+
SHORT_OPTIONS='-v'
|
51
|
+
LONG_OPTIONS='--version'
|
52
|
+
OPTIONS="${SHORT_OPTIONS} ${LONG_OPTIONS}"
|
50
53
|
|
51
54
|
case "${current_word}" in
|
52
|
-
-*)
|
55
|
+
-*) __gibson_generate_completion "${OPTIONS}" ;;
|
53
56
|
*) __gibson_generate_completion "${COMMANDS}" ;;
|
54
57
|
esac
|
55
58
|
}
|
56
59
|
|
57
|
-
__gibson_options() {
|
58
|
-
OPTIONS='--version -v'
|
59
|
-
__gibson_generate_completion "${OPTIONS}"
|
60
|
-
}
|
61
|
-
|
62
60
|
__gibson_completions() {
|
63
61
|
declare previous_word
|
64
62
|
previous_word="${COMP_WORDS[COMP_CWORD - 1]}"
|
@@ -66,9 +64,14 @@ __gibson_completions() {
|
|
66
64
|
case "${previous_word}" in
|
67
65
|
gibson) __gibson_commands_and_options ;;
|
68
66
|
auth) __gibson_generate_completion "login logout" ;;
|
69
|
-
|
67
|
+
code) __gibson_generate_completion "entity" ;;
|
68
|
+
conf) __gibson_generate_completion "api::key code::custom::model::class code::custom::path datastore::uri" ;;
|
69
|
+
dev) __gibson_generate_completion "on off" ;;
|
70
|
+
forget) __gibson_generate_completion "stored last all" ;;
|
71
|
+
import) __gibson_generate_completion "api datastore" ;;
|
72
|
+
list) __gibson_generate_completion "entities" ;;
|
73
|
+
new) __gibson_generate_completion "project" ;;
|
70
74
|
# create) __gibson_generate_completion "project module entity" ;;
|
71
|
-
# new) __gibson_generate_completion "project module entity" ;;
|
72
75
|
# project) __gibson_generate_completion "create delete list" ;;
|
73
76
|
# rename) __gibson_generate_completion "entity" ;;
|
74
77
|
# rewrite) __gibson_generate_completion "api base models schemas tests" ;;
|
@@ -43,10 +43,12 @@ class Python:
|
|
43
43
|
|
44
44
|
return path
|
45
45
|
|
46
|
-
|
47
|
-
"
|
48
|
-
+ f" export PYTHONPATH=$PYTHONPATH:{os_path}\n"
|
46
|
+
print(
|
47
|
+
"Cannot make import path. Please execute the following command in your terminal:\n\n"
|
49
48
|
)
|
49
|
+
print(f" export PYTHONPATH=$PYTHONPATH:{os_path}\n\n")
|
50
|
+
print("and then try again.\n")
|
51
|
+
exit(1)
|
50
52
|
|
51
53
|
def make_python_path(self, path):
|
52
54
|
pythonpath = os.environ["PYTHONPATH"].split(":")
|
@@ -32,15 +32,10 @@ def test_define_python_path():
|
|
32
32
|
|
33
33
|
|
34
34
|
def test_make_import_path_exceptions():
|
35
|
-
with pytest.raises(
|
35
|
+
with pytest.raises(SystemExit) as e:
|
36
36
|
Python().make_import_path("/a/b/c")
|
37
37
|
|
38
|
-
assert
|
39
|
-
"""cannot make import path; please execute:
|
40
|
-
|
41
|
-
export PYTHONPATH=$PYTHONPATH:/a/b/c
|
42
|
-
"""
|
43
|
-
)
|
38
|
+
assert e.value.code == 1
|
44
39
|
|
45
40
|
|
46
41
|
def test_make_import_path():
|
@@ -1,20 +0,0 @@
|
|
1
|
-
from gibson.api.BaseApi import BaseApi
|
2
|
-
from gibson.command.BaseCommand import BaseCommand
|
3
|
-
from gibson.services.auth.Server import Server as AuthServer
|
4
|
-
|
5
|
-
|
6
|
-
class Login(BaseCommand):
|
7
|
-
def execute(self):
|
8
|
-
api = BaseApi(self.configuration)
|
9
|
-
access_token, refresh_token = AuthServer(api.app_domain()).get_tokens()
|
10
|
-
|
11
|
-
if access_token is None or refresh_token is None:
|
12
|
-
self.conversation.newline()
|
13
|
-
self.conversation.type(
|
14
|
-
"Login failed, please try again with `gibson auth login`."
|
15
|
-
)
|
16
|
-
else:
|
17
|
-
self.configuration.set_auth_tokens(access_token, refresh_token)
|
18
|
-
self.conversation.type(f"Welcome! You are now logged in.")
|
19
|
-
|
20
|
-
self.conversation.newline()
|
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
|
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
|
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
|
{gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/customization/BaseCustomization.py
RENAMED
File without changes
|
{gibson_cli-0.1.6 → gibson_cli-0.2.0}/gibson/services/code/customization/CustomizationManager.py
RENAMED
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
|