gibson-cli 0.3.4__tar.gz → 0.4.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.
Files changed (122) hide show
  1. {gibson_cli-0.3.4/gibson_cli.egg-info → gibson_cli-0.4.0}/PKG-INFO +3 -3
  2. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/README.md +2 -2
  3. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/auth/Auth.py +1 -0
  4. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/core/Colors.py +4 -0
  5. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/core/Completions.py +3 -2
  6. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/core/Configuration.py +3 -1
  7. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/core/Conversation.py +2 -1
  8. gibson_cli-0.4.0/gibson/core/PythonPath.py +52 -0
  9. gibson_cli-0.4.0/gibson/services/code/customization/Authenticator.py +13 -0
  10. gibson_cli-0.4.0/gibson/services/code/customization/BaseCustomization.py +45 -0
  11. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/services/code/customization/CustomizationManager.py +5 -1
  12. gibson_cli-0.4.0/gibson/services/code/customization/Index.py +13 -0
  13. {gibson_cli-0.3.4 → gibson_cli-0.4.0/gibson_cli.egg-info}/PKG-INFO +3 -3
  14. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson_cli.egg-info/SOURCES.txt +2 -0
  15. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/pyproject.toml +1 -1
  16. gibson_cli-0.3.4/gibson/services/code/customization/Authenticator.py +0 -51
  17. gibson_cli-0.3.4/gibson/services/code/customization/BaseCustomization.py +0 -12
  18. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/.gitignore +0 -0
  19. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/.pre-commit-config.yaml +0 -0
  20. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/bin/build.sh +0 -0
  21. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/bin/release.sh +0 -0
  22. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/api/BaseApi.py +0 -0
  23. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/api/Cli.py +0 -0
  24. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/bin/gibson.py +0 -0
  25. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/BaseCommand.py +0 -0
  26. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Build.py +0 -0
  27. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Code.py +0 -0
  28. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Conf.py +0 -0
  29. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Count.py +0 -0
  30. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Dev.py +0 -0
  31. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Forget.py +0 -0
  32. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Import.py +0 -0
  33. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/List.py +0 -0
  34. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Merge.py +0 -0
  35. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Model.py +0 -0
  36. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Modify.py +0 -0
  37. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Module.py +0 -0
  38. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/New.py +0 -0
  39. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/OpenApi.py +0 -0
  40. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Question.py +0 -0
  41. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Remove.py +0 -0
  42. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Rename.py +0 -0
  43. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Schema.py +0 -0
  44. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Show.py +0 -0
  45. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Test.py +0 -0
  46. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Tree.py +0 -0
  47. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/Version.py +0 -0
  48. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/WarGames.py +0 -0
  49. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/auth/Login.py +0 -0
  50. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/auth/Logout.py +0 -0
  51. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/rewrite/Api.py +0 -0
  52. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/rewrite/Base.py +0 -0
  53. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/rewrite/Models.py +0 -0
  54. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/rewrite/Rewrite.py +0 -0
  55. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/rewrite/Schemas.py +0 -0
  56. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/rewrite/Tests.py +0 -0
  57. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/tests/test_command_BaseCommand.py +0 -0
  58. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/command/tests/test_command_Conf.py +0 -0
  59. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/Api.py +0 -0
  60. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/Code.py +0 -0
  61. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/Custom.py +0 -0
  62. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/Datastore.py +0 -0
  63. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/Dependencies.py +0 -0
  64. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/Dev.py +0 -0
  65. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/Frameworks.py +0 -0
  66. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/Modeler.py +0 -0
  67. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/Paths.py +0 -0
  68. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/Platform.py +0 -0
  69. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/Project.py +0 -0
  70. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/Version.py +0 -0
  71. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/dev/Api.py +0 -0
  72. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/dev/Base.py +0 -0
  73. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/dev/Model.py +0 -0
  74. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/dev/Schema.py +0 -0
  75. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/tests/test_conf_Dependencies.py +0 -0
  76. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/conf/tests/test_conf_Platform.py +0 -0
  77. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/core/CommandRouter.py +0 -0
  78. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/core/Env.py +0 -0
  79. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/core/Memory.py +0 -0
  80. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/core/TimeKeeper.py +0 -0
  81. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/core/utils.py +0 -0
  82. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/data/bash-completion.tmpl +0 -0
  83. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/data/default-ref-table.tmpl +0 -0
  84. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/data/default-table.tmpl +0 -0
  85. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/db/TableExceptions.py +0 -0
  86. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/db/tests/test_db_TableExceptions.py +0 -0
  87. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/dev/Dev.py +0 -0
  88. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/display/Header.py +0 -0
  89. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/display/WorkspaceFooter.py +0 -0
  90. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/display/WorkspaceHeader.py +0 -0
  91. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/display/tests/test_display_Header.py +0 -0
  92. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/display/tests/test_display_WorkspaceFooter.py +0 -0
  93. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/display/tests/test_display_WorkspaceHeader.py +0 -0
  94. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/lang/Python.py +0 -0
  95. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/lang/tests/test_lang_Python.py +0 -0
  96. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/services/auth/Server.py +0 -0
  97. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/services/code/context/schema/DataDictionary.py +0 -0
  98. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/services/code/context/schema/EntityKeys.py +0 -0
  99. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/services/code/context/schema/Manager.py +0 -0
  100. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/services/code/context/schema/tests/test_code_context_schema_DataDictionary.py +0 -0
  101. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/services/code/context/schema/tests/test_code_context_schema_EntityKeys.py +0 -0
  102. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/services/code/context/schema/tests/test_code_context_schema_Manager.py +0 -0
  103. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/services/code/customization/tests/test_code_customization_Authenticator.py +0 -0
  104. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/services/code/customization/tests/test_code_customization_BaseCustomization.py +0 -0
  105. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/structure/Entity.py +0 -0
  106. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/structure/constraints/ReferenceConstraint.py +0 -0
  107. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/structure/keys/ForeignKey.py +0 -0
  108. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/structure/keys/Index.py +0 -0
  109. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/structure/keys/IndexAttribute.py +0 -0
  110. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/structure/keys/tests/test_ForeignKey.py +0 -0
  111. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/structure/keys/tests/test_Index.py +0 -0
  112. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/structure/keys/tests/test_IndexAttribute.py +0 -0
  113. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/structure/testing.py +0 -0
  114. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/structure/tests/test_Entity.py +0 -0
  115. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/tests/test_Env.py +0 -0
  116. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/tests/test_Memory.py +0 -0
  117. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson/tests/test_utils.py +0 -0
  118. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson_cli.egg-info/dependency_links.txt +0 -0
  119. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson_cli.egg-info/entry_points.txt +0 -0
  120. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/gibson_cli.egg-info/top_level.txt +0 -0
  121. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/requirements.txt +0 -0
  122. {gibson_cli-0.3.4 → gibson_cli-0.4.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gibson-cli
3
- Version: 0.3.4
3
+ Version: 0.4.0
4
4
  Summary: Gibson Command Line Interface
5
5
  Author-email: GibsonAI <noc@gibsonai.com>
6
6
  Project-URL: Homepage, https://gibsonai.com/
@@ -93,7 +93,7 @@ Run `gibson auth login` to login to Gibson with your Google account.
93
93
 
94
94
  While in beta, you have to acquire an API manually:
95
95
 
96
- - Go to <https://staging.gibsonai.com/>.
96
+ - Go to <https://app.gibsonai.com/>.
97
97
  - Chat with Gibson and create a new project.
98
98
  - When your project is complete Gibson will email you the API key.
99
99
  - gibson conf api::key [API key]
@@ -256,7 +256,7 @@ For example, you might provide class name = `MyBaseModel` and import path = `pro
256
256
 
257
257
  ### Building a Project End-to-End Using AI
258
258
 
259
- - Go to <https://staging.gibsonai.com/>.
259
+ - Go to <https://app.gibsonai.com/>.
260
260
  - Chat with Gibson and create a new project.
261
261
  - When your project is complete Gibson will email you the API key.
262
262
  - `gibson conf api::key [API key]`
@@ -76,7 +76,7 @@ Run `gibson auth login` to login to Gibson with your Google account.
76
76
 
77
77
  While in beta, you have to acquire an API manually:
78
78
 
79
- - Go to <https://staging.gibsonai.com/>.
79
+ - Go to <https://app.gibsonai.com/>.
80
80
  - Chat with Gibson and create a new project.
81
81
  - When your project is complete Gibson will email you the API key.
82
82
  - gibson conf api::key [API key]
@@ -239,7 +239,7 @@ For example, you might provide class name = `MyBaseModel` and import path = `pro
239
239
 
240
240
  ### Building a Project End-to-End Using AI
241
241
 
242
- - Go to <https://staging.gibsonai.com/>.
242
+ - Go to <https://app.gibsonai.com/>.
243
243
  - Chat with Gibson and create a new project.
244
244
  - When your project is complete Gibson will email you the API key.
245
245
  - `gibson conf api::key [API key]`
@@ -18,6 +18,7 @@ class Auth(BaseCommand):
18
18
  self.usage()
19
19
 
20
20
  def usage(self):
21
+ self.conversation.display_project(self.configuration.project.name)
21
22
  self.conversation.type(
22
23
  f"usage: {command(self.configuration.command)} {subcommand('auth')} {argument('login')} {hint('login to Gibson')} \n"
23
24
  )
@@ -66,3 +66,7 @@ def option(text):
66
66
 
67
67
  def hint(text):
68
68
  return colorize(text, Color.GREY)
69
+
70
+
71
+ def project(text):
72
+ return colorize(text, Color.BOLD)
@@ -5,9 +5,10 @@ class Completions:
5
5
  def __init__(self):
6
6
  self.user_home = os.environ.get("HOME")
7
7
  self.gibson_config = ".gibsonai"
8
+ self.file_name = "bash_completion"
8
9
 
9
10
  def install(self):
10
- completions_location = f"$HOME/{self.gibson_config}/bash_completion"
11
+ completions_location = f"$HOME/{self.gibson_config}/{self.file_name}"
11
12
  installation = f"""\n[ -s "{completions_location}" ] && \\. "{completions_location}" # Load gibson auto completion\n"""
12
13
 
13
14
  for file in [f"{self.user_home}/.bashrc", f"{self.user_home}/.zshrc"]:
@@ -31,7 +32,7 @@ class Completions:
31
32
  except FileExistsError:
32
33
  pass
33
34
 
34
- with open(f"{self.user_home}/{self.gibson_config}/bash_completion", "w") as f:
35
+ with open(f"{self.user_home}/{self.gibson_config}/{self.file_name}", "w") as f:
35
36
  f.write(contents)
36
37
 
37
38
  return self
@@ -11,12 +11,13 @@ from gibson.conf.Platform import Platform
11
11
  from gibson.conf.Project import Project
12
12
  from gibson.core.Completions import Completions
13
13
  from gibson.core.Conversation import Conversation
14
+ from gibson.core.PythonPath import PythonPath
14
15
  from gibson.services.auth.Server import Server as AuthServer
15
16
 
16
17
 
17
18
  class Configuration:
18
19
  VERSION = 2
19
- API_ENV = os.environ.get("GIBSONAI_API_ENV", "staging")
20
+ API_ENV = os.environ.get("GIBSONAI_API_ENV", "production")
20
21
 
21
22
  def __init__(self):
22
23
  self.command = None
@@ -37,6 +38,7 @@ class Configuration:
37
38
  self.read_config()
38
39
 
39
40
  Completions().write().install()
41
+ PythonPath().write().install()
40
42
 
41
43
  def api_domain(self):
42
44
  domains = {
@@ -6,6 +6,7 @@ import time
6
6
  import pyfiglet
7
7
 
8
8
  from gibson.conf.Version import Version
9
+ from gibson.core.Colors import project
9
10
 
10
11
 
11
12
  class Conversation:
@@ -72,7 +73,7 @@ class Conversation:
72
73
  self.newline()
73
74
 
74
75
  def display_project(self, project_name):
75
- self.type(f"<> Project {project_name}\n\n")
76
+ self.type(f"<> Project {project(project_name)}\n\n")
76
77
 
77
78
  def entities_hijacked(self):
78
79
  self.type(
@@ -0,0 +1,52 @@
1
+ import json
2
+ import os
3
+
4
+
5
+ class PythonPath:
6
+ def __init__(self):
7
+ self.user_home = os.environ.get("HOME")
8
+ self.gibson_config = ".gibsonai"
9
+ self.file_name = "python_path"
10
+
11
+ def install(self):
12
+ python_path_location = f"$HOME/{self.gibson_config}/{self.file_name}"
13
+ installation = f"""\n[ -s "{python_path_location}" ] && \\. "{python_path_location}" # Setup pythonpath for gibson projects\n"""
14
+
15
+ for file in [f"{self.user_home}/.bashrc", f"{self.user_home}/.zshrc"]:
16
+ with open(file, "a+") as f:
17
+ f.seek(0)
18
+ if python_path_location not in f.read():
19
+ f.write(installation)
20
+
21
+ return self
22
+
23
+ def write(self):
24
+ try:
25
+ with open(f"{self.user_home}/{self.gibson_config}/config", "r") as f:
26
+ config = json.loads(f.read())
27
+ except:
28
+ return self
29
+
30
+ project_paths = filter(
31
+ lambda x: x is not None,
32
+ [
33
+ config.get(project).get("dev", {}).get("base", {}).get("path")
34
+ for project in config
35
+ ],
36
+ )
37
+
38
+ if not project_paths:
39
+ return self
40
+
41
+ try:
42
+ os.mkdir(f"{self.user_home}/{self.gibson_config}")
43
+ except FileExistsError:
44
+ pass
45
+
46
+ contents = "\n".join(
47
+ f"export PYTHONPATH=$PYTHONPATH:{path}" for path in project_paths
48
+ )
49
+ with open(f"{self.user_home}/{self.gibson_config}/{self.file_name}", "w") as f:
50
+ f.write(contents)
51
+
52
+ return self
@@ -0,0 +1,13 @@
1
+ import os
2
+
3
+ from gibson.services.code.customization.BaseCustomization import BaseCustomization
4
+
5
+
6
+ class Authenticator(BaseCustomization):
7
+ def _get_file_name(self):
8
+ return os.path.expandvars(
9
+ self.configuration.project.dev.api.path
10
+ + "/"
11
+ + self.configuration.project.dev.api.version
12
+ + "/Authenticator.py"
13
+ )
@@ -0,0 +1,45 @@
1
+ import os
2
+
3
+ from gibson.core.Configuration import Configuration
4
+
5
+
6
+ class BaseCustomization:
7
+ def __init__(self, configuration: Configuration):
8
+ self.__link_target = None
9
+ self.__file_contents = None
10
+ self.configuration = configuration
11
+
12
+ def _get_file_name(self):
13
+ raise NotImplementedError
14
+
15
+ def preserve(self):
16
+ file_name = self._get_file_name()
17
+
18
+ if os.path.islink(file_name):
19
+ self.__link_target = os.readlink(file_name)
20
+ elif os.path.isfile(file_name):
21
+ with open(file_name, "r") as f:
22
+ self.__file_contents = f.read()
23
+
24
+ return self
25
+
26
+ def restore(self):
27
+ file_name = self._get_file_name()
28
+
29
+ if self.__link_target is not None:
30
+ try:
31
+ os.unlink(file_name)
32
+ except FileNotFoundError:
33
+ pass
34
+
35
+ os.symlink(self.__link_target, file_name)
36
+ elif self.__file_contents is not None:
37
+ try:
38
+ os.unlink(file_name)
39
+ except FileNotFoundError:
40
+ pass
41
+
42
+ with open(file_name, "w") as f:
43
+ f.write(self.__file_contents)
44
+
45
+ return self
@@ -1,11 +1,15 @@
1
1
  from gibson.core.Configuration import Configuration
2
2
  from gibson.services.code.customization.Authenticator import Authenticator
3
+ from gibson.services.code.customization.Index import Index
3
4
 
4
5
 
5
6
  class CustomizationManager:
6
7
  def __init__(self, configuration: Configuration):
7
8
  self.configuration = configuration
8
- self.customizations = [Authenticator(self.configuration)]
9
+ self.customizations = [
10
+ Authenticator(self.configuration),
11
+ Index(self.configuration),
12
+ ]
9
13
 
10
14
  def preserve(self):
11
15
  for customization in self.customizations:
@@ -0,0 +1,13 @@
1
+ import os
2
+
3
+ from gibson.services.code.customization.BaseCustomization import BaseCustomization
4
+
5
+
6
+ class Index(BaseCustomization):
7
+ def _get_file_name(self):
8
+ return os.path.expandvars(
9
+ self.configuration.project.dev.api.path
10
+ + "/"
11
+ + self.configuration.project.dev.api.version
12
+ + "/routers/index.py"
13
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gibson-cli
3
- Version: 0.3.4
3
+ Version: 0.4.0
4
4
  Summary: Gibson Command Line Interface
5
5
  Author-email: GibsonAI <noc@gibsonai.com>
6
6
  Project-URL: Homepage, https://gibsonai.com/
@@ -93,7 +93,7 @@ Run `gibson auth login` to login to Gibson with your Google account.
93
93
 
94
94
  While in beta, you have to acquire an API manually:
95
95
 
96
- - Go to <https://staging.gibsonai.com/>.
96
+ - Go to <https://app.gibsonai.com/>.
97
97
  - Chat with Gibson and create a new project.
98
98
  - When your project is complete Gibson will email you the API key.
99
99
  - gibson conf api::key [API key]
@@ -256,7 +256,7 @@ For example, you might provide class name = `MyBaseModel` and import path = `pro
256
256
 
257
257
  ### Building a Project End-to-End Using AI
258
258
 
259
- - Go to <https://staging.gibsonai.com/>.
259
+ - Go to <https://app.gibsonai.com/>.
260
260
  - Chat with Gibson and create a new project.
261
261
  - When your project is complete Gibson will email you the API key.
262
262
  - `gibson conf api::key [API key]`
@@ -68,6 +68,7 @@ gibson/core/Configuration.py
68
68
  gibson/core/Conversation.py
69
69
  gibson/core/Env.py
70
70
  gibson/core/Memory.py
71
+ gibson/core/PythonPath.py
71
72
  gibson/core/TimeKeeper.py
72
73
  gibson/core/utils.py
73
74
  gibson/data/bash-completion.tmpl
@@ -94,6 +95,7 @@ gibson/services/code/context/schema/tests/test_code_context_schema_Manager.py
94
95
  gibson/services/code/customization/Authenticator.py
95
96
  gibson/services/code/customization/BaseCustomization.py
96
97
  gibson/services/code/customization/CustomizationManager.py
98
+ gibson/services/code/customization/Index.py
97
99
  gibson/services/code/customization/tests/test_code_customization_Authenticator.py
98
100
  gibson/services/code/customization/tests/test_code_customization_BaseCustomization.py
99
101
  gibson/structure/Entity.py
@@ -14,7 +14,7 @@ classifiers = [
14
14
  "Intended Audience :: Developers",
15
15
  "Programming Language :: Python :: 3.9",
16
16
  ]
17
- version = "0.3.4"
17
+ version = "0.4.0"
18
18
 
19
19
  [tool.setuptools.packages.find]
20
20
  where = ["."]
@@ -1,51 +0,0 @@
1
- import os
2
-
3
- from gibson.core.Configuration import Configuration
4
- from gibson.services.code.customization.BaseCustomization import BaseCustomization
5
-
6
-
7
- class Authenticator(BaseCustomization):
8
- def __init__(self, configuration: Configuration):
9
- super().__init__(configuration)
10
- self.__link_target = None
11
- self.__file_contents = None
12
-
13
- def __get_file_name(self):
14
- return os.path.expandvars(
15
- self.configuration.project.dev.api.path
16
- + "/"
17
- + self.configuration.project.dev.api.version
18
- + "/Authenticator.py"
19
- )
20
-
21
- def preserve(self):
22
- authenticator_file_name = self.__get_file_name()
23
-
24
- if os.path.islink(authenticator_file_name):
25
- self.__link_target = os.readlink(authenticator_file_name)
26
- elif os.path.isfile(authenticator_file_name):
27
- with open(authenticator_file_name, "r") as f:
28
- self.__file_contents = f.read()
29
-
30
- return self
31
-
32
- def restore(self):
33
- authenticator_file_name = self.__get_file_name()
34
-
35
- if self.__link_target is not None:
36
- try:
37
- os.unlink(authenticator_file_name)
38
- except FileNotFoundError:
39
- pass
40
-
41
- os.symlink(self.__link_target, authenticator_file_name)
42
- elif self.__file_contents is not None:
43
- try:
44
- os.unlink(authenticator_file_name)
45
- except FileNotFoundError:
46
- pass
47
-
48
- with open(authenticator_file_name, "w") as f:
49
- f.write(self.__file_contents)
50
-
51
- return self
@@ -1,12 +0,0 @@
1
- from gibson.core.Configuration import Configuration
2
-
3
-
4
- class BaseCustomization:
5
- def __init__(self, configuration: Configuration):
6
- self.configuration = configuration
7
-
8
- def preserve(self):
9
- raise NotImplementedError
10
-
11
- def restore(self):
12
- raise NotImplementedError
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes