gibson-cli 0.3.3__py3-none-any.whl → 0.3.5__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.
@@ -47,7 +47,7 @@ class Rewrite(BaseCommand):
47
47
  customization_manager = CustomizationManager(self.configuration).preserve()
48
48
 
49
49
  try:
50
- if self.wipe is True:
50
+ if argument is None and self.wipe is True:
51
51
  for root, dirs, files in os.walk(
52
52
  os.path.expandvars(self.configuration.project.dev.base.path)
53
53
  ):
@@ -1,51 +1,13 @@
1
1
  import os
2
2
 
3
- from gibson.core.Configuration import Configuration
4
3
  from gibson.services.code.customization.BaseCustomization import BaseCustomization
5
4
 
6
5
 
7
6
  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):
7
+ def _get_file_name(self):
14
8
  return os.path.expandvars(
15
9
  self.configuration.project.dev.api.path
16
10
  + "/"
17
11
  + self.configuration.project.dev.api.version
18
12
  + "/Authenticator.py"
19
13
  )
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 +1,45 @@
1
+ import os
2
+
1
3
  from gibson.core.Configuration import Configuration
2
4
 
3
5
 
4
6
  class BaseCustomization:
5
7
  def __init__(self, configuration: Configuration):
8
+ self.__link_target = None
9
+ self.__file_contents = None
6
10
  self.configuration = configuration
7
11
 
12
+ def _get_file_name(self):
13
+ return NotImplementedError
14
+
8
15
  def preserve(self):
9
- raise NotImplementedError
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
10
25
 
11
26
  def restore(self):
12
- raise NotImplementedError
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.3
3
+ Version: 0.3.5
4
4
  Summary: Gibson Command Line Interface
5
5
  Author-email: GibsonAI <noc@gibsonai.com>
6
6
  Project-URL: Homepage, https://gibsonai.com/
@@ -33,7 +33,7 @@ gibson/command/auth/Logout.py,sha256=V01q4TdbiBqCnIrM6IA4T25fO6ws0UpXp42I3pwHZVM
33
33
  gibson/command/rewrite/Api.py,sha256=sSvAqEJXdgQjYcu0uiM6ndHE3GnfkfVL6eqP2Otkbww,1002
34
34
  gibson/command/rewrite/Base.py,sha256=YJ2a5Hl0f9NXHUBBPvlt-dUIqEPWQz5vH6-1EHmbFbA,640
35
35
  gibson/command/rewrite/Models.py,sha256=eoUpZHpR0qwNgX60EWfcNz49GHmBw_FGfBuHH2ueZqY,799
36
- gibson/command/rewrite/Rewrite.py,sha256=1B6xRhWWXqZvwZND-pUtPeSW1AD_sWiec_jwAlFWdcg,4661
36
+ gibson/command/rewrite/Rewrite.py,sha256=AK2CcE2sJ0naUmox17BxqN0Usq-oSzjJXfRrKKsGY_k,4682
37
37
  gibson/command/rewrite/Schemas.py,sha256=zZ1gjmOJg77gh70t5y2WkzHWSAvEKx5-gqRN9OcsCXA,802
38
38
  gibson/command/rewrite/Tests.py,sha256=HO1WM6pSToVKsuJn7nUA_I5qrfBN0cgKgBzjlm2Qxt8,799
39
39
  gibson/command/tests/test_command_BaseCommand.py,sha256=hSbBfLFI3RTp_DdEHtm5oOLWoN6drI6ucFJypi7xxV8,364
@@ -86,9 +86,10 @@ gibson/services/code/context/schema/Manager.py,sha256=I_xcPrcE2nFJmBEXcIoJQ9lxKf
86
86
  gibson/services/code/context/schema/tests/test_code_context_schema_DataDictionary.py,sha256=YkWrE1lzpR0amIeQC7lTUCSp54FRMGJrkfmu1FeOI7M,364
87
87
  gibson/services/code/context/schema/tests/test_code_context_schema_EntityKeys.py,sha256=i--xVPHNw7Ks8kkuv9GmSbpp0BuMMKTGtPBY1HwT-60,2114
88
88
  gibson/services/code/context/schema/tests/test_code_context_schema_Manager.py,sha256=FiQFpFmJjv9g46QjmBjGVF3yz1GF0Q42j0fvZm5ZOYw,1230
89
- gibson/services/code/customization/Authenticator.py,sha256=wSXKYyJQW129ImNe_ll_ecQct3Ql8tgvkbcCyoyNlBs,1597
90
- gibson/services/code/customization/BaseCustomization.py,sha256=9a3S6KQEVXevqIv7q9BrPTP-luB2FsM0ULkSxEkYVrs,293
91
- gibson/services/code/customization/CustomizationManager.py,sha256=wCwmN1S5lVQVsZyg2_Rwb7NW5kq-loWoJ466bUw6UVw,584
89
+ gibson/services/code/customization/Authenticator.py,sha256=3VvxZsxelPPhxapHnsYhfMaFgdQ523dai9wxCNMa9Eg,372
90
+ gibson/services/code/customization/BaseCustomization.py,sha256=E925XQ9KvSnSy2rE91er58mD7AJ8I1t-I8L2UAFrS0g,1188
91
+ gibson/services/code/customization/CustomizationManager.py,sha256=M2gz98Yo2WTnnhs1lx_ma63aK1hTfbU6C9RbItaYeDY,705
92
+ gibson/services/code/customization/Index.py,sha256=4Thf0gZM6VErZJS97w748PRNmHi8QvsyblOLCw1Y_XE,364
92
93
  gibson/services/code/customization/tests/test_code_customization_Authenticator.py,sha256=kKExkLfKPpRA2NQH3fvRCuBEMhCGhR-IvNJqXuyBz3c,1949
93
94
  gibson/services/code/customization/tests/test_code_customization_BaseCustomization.py,sha256=jaEwxxoU7d9ziOtfF21NPmZX2qSRpa-kz_8Ju9BKGts,412
94
95
  gibson/structure/Entity.py,sha256=_WBrxgQ2wE6Q6XNS8tFMS0pNEpr09TC3aEn4Q8jG41o,3532
@@ -104,8 +105,8 @@ gibson/structure/tests/test_Entity.py,sha256=Gl9f1NcEKdpWCx4W3takFFzp18mLhCYWKrd
104
105
  gibson/tests/test_Env.py,sha256=DPWmP0-aEelducq9bAwv7rKoY2NjWXUeCrzfJDQkn2M,369
105
106
  gibson/tests/test_Memory.py,sha256=YP7owToABAk_-s7fD5UG0HTc4lamDjdA39JUlLnk3Fg,2574
106
107
  gibson/tests/test_utils.py,sha256=r_y-EG05YTCNtL8MWiAK1KmPsmeoMgypKsQC_lVgOtM,559
107
- gibson_cli-0.3.3.dist-info/METADATA,sha256=cEHb81npKkrkAkFp0D_I5khRP6aufroDOTpfObaaFeg,11505
108
- gibson_cli-0.3.3.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
109
- gibson_cli-0.3.3.dist-info/entry_points.txt,sha256=j5VUvq3AzL21xPvVC24zMoXFt-I5lUWulr66nL3OAPM,50
110
- gibson_cli-0.3.3.dist-info/top_level.txt,sha256=RFaUY7VXGiqkMwo1Rj7pM4kGvxkhhnfo-2LmPpuL_fs,11
111
- gibson_cli-0.3.3.dist-info/RECORD,,
108
+ gibson_cli-0.3.5.dist-info/METADATA,sha256=LR-E9ieuglR8EAGiLDCWAWaclUF6ZpvHYZtsd5mFjcA,11505
109
+ gibson_cli-0.3.5.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
110
+ gibson_cli-0.3.5.dist-info/entry_points.txt,sha256=j5VUvq3AzL21xPvVC24zMoXFt-I5lUWulr66nL3OAPM,50
111
+ gibson_cli-0.3.5.dist-info/top_level.txt,sha256=RFaUY7VXGiqkMwo1Rj7pM4kGvxkhhnfo-2LmPpuL_fs,11
112
+ gibson_cli-0.3.5.dist-info/RECORD,,