gibson-cli 0.7.1__tar.gz → 0.7.3__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 (143) hide show
  1. {gibson_cli-0.7.1/gibson_cli.egg-info → gibson_cli-0.7.3}/PKG-INFO +1 -1
  2. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/code/Entity.py +22 -18
  3. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/code/Model.py +4 -3
  4. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/code/Schema.py +4 -3
  5. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/code/Test.py +4 -3
  6. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/core/Colors.py +29 -2
  7. gibson_cli-0.7.3/gibson/display/Header.py +10 -0
  8. gibson_cli-0.7.3/gibson/display/WorkspaceFooter.py +12 -0
  9. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/display/WorkspaceHeader.py +4 -1
  10. gibson_cli-0.7.3/gibson/display/tests/test_display_Header.py +10 -0
  11. gibson_cli-0.7.3/gibson/display/tests/test_display_WorkspaceFooter.py +11 -0
  12. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/display/tests/test_display_WorkspaceHeader.py +2 -1
  13. {gibson_cli-0.7.1 → gibson_cli-0.7.3/gibson_cli.egg-info}/PKG-INFO +1 -1
  14. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson_cli.egg-info/top_level.txt +1 -0
  15. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/pyproject.toml +1 -1
  16. gibson_cli-0.7.1/gibson/display/Header.py +0 -6
  17. gibson_cli-0.7.1/gibson/display/WorkspaceFooter.py +0 -10
  18. gibson_cli-0.7.1/gibson/display/tests/test_display_Header.py +0 -9
  19. gibson_cli-0.7.1/gibson/display/tests/test_display_WorkspaceFooter.py +0 -9
  20. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/.gitignore +0 -0
  21. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/.pre-commit-config.yaml +0 -0
  22. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/README.md +0 -0
  23. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/bin/build.sh +0 -0
  24. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/bin/clean.sh +0 -0
  25. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/bin/release.sh +0 -0
  26. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/api/BaseApi.py +0 -0
  27. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/api/Cli.py +0 -0
  28. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/api/ProjectApi.py +0 -0
  29. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/bin/gibson.py +0 -0
  30. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/BaseCommand.py +0 -0
  31. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Build.py +0 -0
  32. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Conf.py +0 -0
  33. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Count.py +0 -0
  34. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Dev.py +0 -0
  35. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Forget.py +0 -0
  36. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Help.py +0 -0
  37. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Merge.py +0 -0
  38. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Modify.py +0 -0
  39. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Question.py +0 -0
  40. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Remove.py +0 -0
  41. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Show.py +0 -0
  42. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Tree.py +0 -0
  43. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/Version.py +0 -0
  44. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/WarGames.py +0 -0
  45. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/auth/Auth.py +0 -0
  46. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/auth/Login.py +0 -0
  47. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/auth/Logout.py +0 -0
  48. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/code/Api.py +0 -0
  49. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/code/Base.py +0 -0
  50. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/code/Code.py +0 -0
  51. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/code/Models.py +0 -0
  52. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/code/Schemas.py +0 -0
  53. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/code/Tests.py +0 -0
  54. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/importer/Import.py +0 -0
  55. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/importer/OpenApi.py +0 -0
  56. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/list/Entities.py +0 -0
  57. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/list/List.py +0 -0
  58. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/list/Projects.py +0 -0
  59. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/new/Module.py +0 -0
  60. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/new/New.py +0 -0
  61. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/new/Project.py +0 -0
  62. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/rename/Entity.py +0 -0
  63. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/rename/Rename.py +0 -0
  64. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/rewrite/Rewrite.py +0 -0
  65. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/tests/test_command_BaseCommand.py +0 -0
  66. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/command/tests/test_command_Conf.py +0 -0
  67. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/Api.py +0 -0
  68. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/Code.py +0 -0
  69. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/Custom.py +0 -0
  70. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/Datastore.py +0 -0
  71. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/Dependencies.py +0 -0
  72. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/Dev.py +0 -0
  73. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/Frameworks.py +0 -0
  74. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/Modeler.py +0 -0
  75. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/Paths.py +0 -0
  76. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/Platform.py +0 -0
  77. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/Project.py +0 -0
  78. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/Version.py +0 -0
  79. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/dev/Api.py +0 -0
  80. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/dev/Base.py +0 -0
  81. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/dev/Model.py +0 -0
  82. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/dev/Schema.py +0 -0
  83. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/tests/test_conf_Dependencies.py +0 -0
  84. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/conf/tests/test_conf_Platform.py +0 -0
  85. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/core/CommandRouter.py +0 -0
  86. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/core/Completions.py +0 -0
  87. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/core/Configuration.py +0 -0
  88. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/core/Conversation.py +0 -0
  89. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/core/Env.py +0 -0
  90. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/core/Memory.py +0 -0
  91. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/core/PythonPath.py +0 -0
  92. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/core/TimeKeeper.py +0 -0
  93. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/core/utils.py +0 -0
  94. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/data/bash-completion.tmpl +0 -0
  95. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/data/mysql/default-ref-table.tmpl +0 -0
  96. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/data/mysql/default-table.tmpl +0 -0
  97. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/data/postgresql/default-ref-table.tmpl +0 -0
  98. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/data/postgresql/default-table.tmpl +0 -0
  99. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/db/TableExceptions.py +0 -0
  100. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/db/tests/test_db_TableExceptions.py +0 -0
  101. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/dev/Dev.py +0 -0
  102. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/lang/Python.py +0 -0
  103. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/lang/tests/test_lang_Python.py +0 -0
  104. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/auth/Server.py +0 -0
  105. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/code/context/schema/DataDictionary.py +0 -0
  106. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/code/context/schema/EntityKeys.py +0 -0
  107. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/code/context/schema/Manager.py +0 -0
  108. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/code/context/schema/tests/test_code_context_schema_DataDictionary.py +0 -0
  109. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/code/context/schema/tests/test_code_context_schema_EntityKeys.py +0 -0
  110. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/code/context/schema/tests/test_code_context_schema_Manager.py +0 -0
  111. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/code/customization/Authenticator.py +0 -0
  112. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/code/customization/BaseCustomization.py +0 -0
  113. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/code/customization/CustomizationManager.py +0 -0
  114. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/code/customization/Index.py +0 -0
  115. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/code/customization/tests/test_code_customization_Authenticator.py +0 -0
  116. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/services/code/customization/tests/test_code_customization_BaseCustomization.py +0 -0
  117. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/Entity.py +0 -0
  118. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/mysql/Entity.py +0 -0
  119. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/mysql/constraints/ReferenceConstraint.py +0 -0
  120. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/mysql/keys/ForeignKey.py +0 -0
  121. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/mysql/keys/Index.py +0 -0
  122. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/mysql/keys/IndexAttribute.py +0 -0
  123. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/mysql/keys/tests/test_structure_mysql_keys_ForeignKey.py +0 -0
  124. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/mysql/keys/tests/test_structure_mysql_keys_Index.py +0 -0
  125. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/mysql/keys/tests/test_structure_mysql_keys_IndexAttribute.py +0 -0
  126. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/mysql/testing.py +0 -0
  127. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/mysql/tests/test_structure_mysql_Entity.py +0 -0
  128. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/postgresql/Entity.py +0 -0
  129. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/postgresql/References.py +0 -0
  130. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/postgresql/table/ForeignKey.py +0 -0
  131. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/postgresql/table/tests/test_structure_postgresql_table_ForeignKey.py +0 -0
  132. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/postgresql/testing.py +0 -0
  133. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/postgresql/tests/test_structure_postgresql_Entity.py +0 -0
  134. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/structure/tests/test_structure_Entity.py +0 -0
  135. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/tests/test_Env.py +0 -0
  136. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/tests/test_Memory.py +0 -0
  137. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson/tests/test_utils.py +0 -0
  138. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson_cli.egg-info/SOURCES.txt +0 -0
  139. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson_cli.egg-info/dependency_links.txt +0 -0
  140. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson_cli.egg-info/entry_points.txt +0 -0
  141. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/gibson_cli.egg-info/requires.txt +0 -0
  142. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/requirements.txt +0 -0
  143. {gibson_cli-0.7.1 → gibson_cli-0.7.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gibson-cli
3
- Version: 0.7.1
3
+ Version: 0.7.3
4
4
  Summary: Gibson Command Line Interface
5
5
  Author-email: GibsonAI <noc@gibsonai.com>
6
6
  Project-URL: Homepage, https://gibsonai.com/
@@ -5,8 +5,10 @@ from string import Template
5
5
  import gibson.core.Colors as Colors
6
6
  from gibson.api.Cli import Cli
7
7
  from gibson.command.BaseCommand import BaseCommand
8
+ from gibson.command.code.Model import Model
9
+ from gibson.command.code.Schema import Schema
10
+ from gibson.command.code.Test import Test
8
11
  from gibson.command.Merge import Merge
9
- from gibson.command.rewrite.Rewrite import Rewrite
10
12
  from gibson.core.Configuration import Configuration
11
13
  from gibson.display.Header import Header
12
14
  from gibson.display.WorkspaceFooter import WorkspaceFooter
@@ -106,29 +108,32 @@ class Entity(BaseCommand):
106
108
  self.__render_workspace(entity, data["code"][0]["definition"])
107
109
 
108
110
  input_ = input("> ")
109
- if input_ in [".", ":q", ":w"]:
111
+ if input_ in [":q", ":q!", ":wq"]:
110
112
  self.conversation.newline()
111
113
 
112
114
  if input_ == ":q":
115
+ self.conversation.type("Exiting without saving.\n")
116
+
117
+ if input_ in [":q", ":q!"]:
113
118
  exit(1)
114
119
 
115
120
  self.memory.remember_last({"entities": [data["entity"]]})
121
+ self.conversation.mute()
122
+ Merge(self.configuration).execute()
123
+ self.conversation.unmute()
116
124
 
117
- if input_ == ".":
118
- self.conversation.type(
119
- "Damn we write good code. I stored this in last memory. "
120
- + "Your move.\n"
121
- )
122
- else:
123
- self.conversation.mute()
124
- Merge(self.configuration).execute()
125
- self.conversation.unmute()
125
+ self.conversation.type("Entity saved! ✅\n\n")
126
+ self.conversation.type("Gibson is writing the code...\n\n")
126
127
 
127
- Rewrite(self.configuration, wipe=False).write()
128
+ Model(self.configuration).execute(entity.name)
129
+ Schema(self.configuration).execute(entity.name)
130
+ Test(self.configuration).execute(entity.name)
128
131
 
129
- self.conversation.newline()
132
+ self.conversation.type(
133
+ f"All code for the {Colors.violet(entity.name)} entity has been written 🎉\n\n"
134
+ )
130
135
 
131
- exit(1)
136
+ exit()
132
137
  elif input_ == "":
133
138
  continue
134
139
 
@@ -180,14 +185,13 @@ class Entity(BaseCommand):
180
185
  print(WorkspaceHeader().render(self.configuration.project.name))
181
186
 
182
187
  print("")
183
- print(Header().render("SQL"))
188
+ print(Header().render("SQL", Colors.Color.CYAN))
184
189
  print("")
185
190
  print(Colors.table(entity.create_statement(), entity.name))
186
191
 
187
192
  print("")
188
- print(Header().render("Model"))
193
+ print(Header().render("Model", Colors.Color.YELLOW))
189
194
  print("")
190
- print(model)
195
+ print(Colors.model(model, entity.name))
191
196
 
192
- print("")
193
197
  print(WorkspaceFooter().render())
@@ -8,12 +8,13 @@ from gibson.dev.Dev import Dev
8
8
 
9
9
 
10
10
  class Model(BaseCommand):
11
- def execute(self):
11
+ def execute(self, entity_name=None):
12
+ entity_name = entity_name or sys.argv[3]
12
13
  self.configuration.require_project()
13
- entity = self.memory.recall_stored_entity(sys.argv[3])
14
+ entity = self.memory.recall_stored_entity(entity_name)
14
15
  if entity is None:
15
16
  self.conversation.not_sure_no_entity(
16
- self.configuration.project.name, sys.argv[3]
17
+ self.configuration.project.name, entity_name
17
18
  )
18
19
  exit(1)
19
20
 
@@ -8,12 +8,13 @@ from gibson.dev.Dev import Dev
8
8
 
9
9
 
10
10
  class Schema(BaseCommand):
11
- def execute(self):
11
+ def execute(self, entity_name=None):
12
+ entity_name = entity_name or sys.argv[3]
12
13
  self.configuration.require_project()
13
- entity = self.memory.recall_stored_entity(sys.argv[3])
14
+ entity = self.memory.recall_stored_entity(entity_name)
14
15
  if entity is None:
15
16
  self.conversation.not_sure_no_entity(
16
- self.configuration.project.name, sys.argv[3]
17
+ self.configuration.project.name, entity_name
17
18
  )
18
19
  exit(1)
19
20
 
@@ -8,12 +8,13 @@ from gibson.dev.Dev import Dev
8
8
 
9
9
 
10
10
  class Test(BaseCommand):
11
- def execute(self):
11
+ def execute(self, entity_name=None):
12
+ entity_name = entity_name or sys.argv[3]
12
13
  self.configuration.require_project()
13
- entity = self.memory.recall_stored_entity(sys.argv[3])
14
+ entity = self.memory.recall_stored_entity(entity_name)
14
15
  if entity is None:
15
16
  self.conversation.not_sure_no_entity(
16
- self.configuration.project.name, sys.argv[3]
17
+ self.configuration.project.name, entity_name
17
18
  )
18
19
  exit(1)
19
20
 
@@ -57,7 +57,7 @@ def subcommand(text):
57
57
 
58
58
  # Colorize an argument
59
59
  def argument(text):
60
- return colorize(text, Color.VIOLET)
60
+ return violet(text)
61
61
 
62
62
 
63
63
  # Colorize a list of arguments
@@ -92,9 +92,36 @@ def link(text):
92
92
 
93
93
  # Colorize the table name in a SQL statement
94
94
  def table(sql, name):
95
- return sql.replace(name, colorize(name, Color.VIOLET))
95
+ return sql.replace(name, violet(name))
96
+
97
+
98
+ # Colorize the table name in model code
99
+ def model(code, name):
100
+ return code.replace(
101
+ f'__tablename__ = "{name}"', f'__tablename__ = "{violet(name)}"'
102
+ )
96
103
 
97
104
 
98
105
  # Colorize a time/duration output
99
106
  def time(text):
100
107
  return colorize(text, Color.GREEN)
108
+
109
+
110
+ def cyan(text):
111
+ return colorize(text, Color.CYAN)
112
+
113
+
114
+ def green(text):
115
+ return colorize(text, Color.GREEN)
116
+
117
+
118
+ def red(text):
119
+ return colorize(text, Color.RED)
120
+
121
+
122
+ def violet(text):
123
+ return colorize(text, Color.VIOLET)
124
+
125
+
126
+ def yellow(text):
127
+ return colorize(text, Color.YELLOW)
@@ -0,0 +1,10 @@
1
+ import gibson.core.Colors as Colors
2
+
3
+
4
+ class Header:
5
+ def render(self, text, color=None):
6
+ output = text if color is None else Colors.colorize(text, color)
7
+ header = "+-----------------------------------------------------------------------------+\n"
8
+ header += "| " + output + " " * (76 - len(text)) + "|\n"
9
+ header += "+-----------------------------------------------------------------------------+"
10
+ return header
@@ -0,0 +1,12 @@
1
+ import gibson.core.Colors as Colors
2
+
3
+
4
+ class WorkspaceFooter:
5
+ def render(self):
6
+ return (
7
+ "=" * 79
8
+ + "\n"
9
+ + f"[{Colors.red(':q')} + enter = {Colors.red('discard')} changes] "
10
+ + f"[{Colors.green(':wq')} + enter = {Colors.green('save')} changes + write code]\n\n"
11
+ + "Using natural language, tell me how I can modify this entity."
12
+ )
@@ -1,3 +1,6 @@
1
+ import gibson.core.Colors as Colors
2
+
3
+
1
4
  class WorkspaceHeader:
2
5
  def render(self, project_name):
3
6
  return (
@@ -5,4 +8,4 @@ class WorkspaceHeader:
5
8
  + " " * 12
6
9
  + "[PAIR PROGRAMMER]\n"
7
10
  + "=" * 79
8
- )
11
+ ).replace(project_name, Colors.project(project_name))
@@ -0,0 +1,10 @@
1
+ import gibson.core.Colors as Colors
2
+ from gibson.display.Header import Header
3
+
4
+
5
+ def test_render():
6
+ assert Header().render("abc def ghi") == (
7
+ """+-----------------------------------------------------------------------------+
8
+ | abc def ghi |
9
+ +-----------------------------------------------------------------------------+"""
10
+ )
@@ -0,0 +1,11 @@
1
+ import gibson.core.Colors as Colors
2
+ from gibson.display.WorkspaceFooter import WorkspaceFooter
3
+
4
+
5
+ def test_render():
6
+ assert WorkspaceFooter().render() == (
7
+ f"""===============================================================================
8
+ [{Colors.red(':q')} + enter = {Colors.red('discard')} changes] [{Colors.green(':wq')} + enter = {Colors.green('save')} changes + write code]
9
+
10
+ Using natural language, tell me how I can modify this entity."""
11
+ )
@@ -1,8 +1,9 @@
1
+ import gibson.core.Colors as Colors
1
2
  from gibson.display.WorkspaceHeader import WorkspaceHeader
2
3
 
3
4
 
4
5
  def test_render():
5
6
  assert WorkspaceHeader().render("abc def ghi") == (
6
- """Project abc def ghi [PAIR PROGRAMMER]
7
+ f"""Project {Colors.project("abc def ghi")} [PAIR PROGRAMMER]
7
8
  ==============================================================================="""
8
9
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gibson-cli
3
- Version: 0.7.1
3
+ Version: 0.7.3
4
4
  Summary: Gibson Command Line Interface
5
5
  Author-email: GibsonAI <noc@gibsonai.com>
6
6
  Project-URL: Homepage, https://gibsonai.com/
@@ -1,4 +1,5 @@
1
1
  bin
2
+ build
2
3
  dist
3
4
  gibson
4
5
  venv
@@ -15,7 +15,7 @@ classifiers = [
15
15
  "Intended Audience :: Developers",
16
16
  "Programming Language :: Python :: 3.9",
17
17
  ]
18
- version = "0.7.1"
18
+ version = "0.7.3"
19
19
 
20
20
  [tool.setuptools.packages.find]
21
21
  where = ["."]
@@ -1,6 +0,0 @@
1
- class Header:
2
- def render(self, text):
3
- header = "+--------------------------------------------------------------+\n"
4
- header += "| " + text + " " * (61 - len(text)) + "|\n"
5
- header += "+--------------------------------------------------------------+"
6
- return header
@@ -1,10 +0,0 @@
1
- class WorkspaceFooter:
2
- def render(self):
3
- return (
4
- "=" * 79
5
- + "\n"
6
- + "[. + enter = exit] "
7
- + "[:q + enter = abort] "
8
- + "[:w + enter = merge + write code]\n"
9
- + "Using natural language, tell me how I can modify this entity."
10
- )
@@ -1,9 +0,0 @@
1
- from gibson.display.Header import Header
2
-
3
-
4
- def test_render():
5
- assert Header().render("abc def ghi") == (
6
- """+--------------------------------------------------------------+
7
- | abc def ghi |
8
- +--------------------------------------------------------------+"""
9
- )
@@ -1,9 +0,0 @@
1
- from gibson.display.WorkspaceFooter import WorkspaceFooter
2
-
3
-
4
- def test_render():
5
- assert WorkspaceFooter().render() == (
6
- """===============================================================================
7
- [. + enter = exit] [:q + enter = abort] [:w + enter = merge + write code]
8
- Using natural language, tell me how I can modify this entity."""
9
- )
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