1111from .example import Example
1212
1313def parseUri (uri : str ) -> Tuple [ParseResult , str , str ]:
14- logging .debug ("ENTERING: component.py:parseUri:17 " )
14+ logging .debug ("ENTERING: " )
1515 _uri = urlparse (uri )
1616 dirname = os .path .dirname (uri )
1717 _ , name = os .path .split (_uri .path )
1818 _ , ext = os .path .splitext (name )
19- logging .debug ("EXITING: component.py:parseUri:22 " )
19+ logging .debug ("EXITING: " )
2020 return _uri , dirname , name , ext
2121
2222
2323class Component (dict ):
2424 def __init__ (self , filepath : str = None , root : dict = None , args : dict = None ):
25- logging .debug ("ENTERING: component.py:Component.__init__:27 " )
25+ logging .debug ("ENTERING: " )
2626 super ().__init__ ()
2727 self ._root = root
2828 self ._args = args
@@ -36,10 +36,10 @@ def __init__(self, filepath: str = None, root: dict = None, args: dict = None):
3636 self ._desc = self .get ('description' , '' )
3737 self ._stack_path = self .get ('stack_path' , '' )
3838 self ._repository = self .get ('repository' , None )
39- logging .debug ("EXITING: component.py:Component.__init__:41 " )
39+ logging .debug ("EXITING: " )
4040
4141 def _git_clone (self , repo ) -> str :
42- logging .debug ("ENTERING: component.py:Component._git_clone:104" )
42+ logging .debug ("ENTERING: " )
4343 git_uri = repo .get ('git_uri' )
4444 private = repo .get ('private' , False )
4545 uri , _ , name , ext = parseUri (git_uri )
@@ -60,50 +60,50 @@ def _git_clone(self, repo) -> str:
6060 run (f'git fetch --all --tags' , cwd = to )
6161 else :
6262 logging .debug (f'Skipping clone { git_uri } ' )
63- logging .debug ("EXITING: component.py:Component._git_clone:122 " )
63+ logging .debug ("EXITING: " )
6464 return to
6565 elif self ._repo_uri () == git_uri :
66- logging .debug ("EXITING: component.py:Component._git_clone:125 " )
66+ logging .debug ("EXITING: " )
6767 return self ._repo_env_dir ()
6868 elif (uri .scheme == 'file' or uri .scheme == '' ) and ext == '' :
69- logging .debug ("EXITING: component.py:Component._git_clone:128 " )
69+ logging .debug ("EXITING: " )
7070 return uri .path
7171 else :
7272 die ('Cannot determine git repo - aborting.' )
7373
7474 def _repo_env_dir (self ) -> str :
75- logging .debug ("ENTERING: component.py:Component._repo_env_dir:233 " )
75+ logging .debug ("ENTERING: " )
7676 if os .getenv (f'REPO_DIR' ):
77- logging .debug ("EXITING: component.py:Component._repo_env_dir:235 " )
77+ logging .debug ("EXITING: " )
7878 return os .getenv (f'REPO_DIR' )
79- logging .debug ("EXITING: component.py:Component._repo_env_dir:237 " )
79+ logging .debug ("EXITING: " )
8080 return ''
8181
8282 def _repo_uri (self ) -> str :
83- logging .debug ("ENTERING: component.py:Component._repo_uri:240 " )
83+ logging .debug ("ENTERING: " )
8484 if (os .getenv ('REPOSITORY_URL' )):
85- logging .debug ("EXITING: component.py:Component._repo_uri:242 " )
85+ logging .debug ("EXITING: " )
8686 return os .getenv ('REPOSITORY_URL' )
87- logging .debug ("EXITING: component.py:Component._repo_uri:244 " )
87+ logging .debug ("EXITING: " )
8888 return ''
8989
9090 def _skip_checkout (self , obj ) -> bool :
91- logging .debug ("ENTERING: component.py:Component._skip_checkout:254 " )
91+ logging .debug ("ENTERING: " )
9292 if obj .get ('git_uri' ) == self ._repo_uri () and self ._preview_mode ():
93- logging .debug ("EXITING: component.py:Component._skip_checkout:256 " )
93+ logging .debug ("EXITING: " )
9494 return True
95- logging .debug ("EXITING: component.py:Component._skip_checkout:258 " )
95+ logging .debug ("EXITING: " )
9696 return False
9797
9898 def _checkout (self , ref , dest , obj ):
99- logging .debug ("ENTERING: component.py:Component._checkout:261 " )
99+ logging .debug ("ENTERING: " )
100100 if not self ._skip_checkout (obj ):
101101 run (f'git checkout { ref } ' , cwd = dest )
102- logging .debug ("EXITING: component.py:Component._checkout:264 " )
102+ logging .debug ("EXITING: " )
103103
104104class All (Component ):
105105 def __init__ (self , filepath : str , root : dict = None , args : dict = None ):
106- logging .debug ("ENTERING: component.py:All.__init__:271 " )
106+ logging .debug ("ENTERING: " )
107107 super ().__init__ (filepath , root , args )
108108 self ._groups = {}
109109 self ._commands = {}
@@ -116,17 +116,17 @@ def __init__(self, filepath: str, root: dict = None, args: dict = None):
116116 self ._content = f'{ self ._website .get ("path" )} /{ self ._website .get ("content" )} '
117117 self ._examples = {}
118118 mkdir_p (self ._content )
119- logging .debug ("EXITING: component.py:All.__init__:284 " )
119+ logging .debug ("EXITING: " )
120120
121121 def _persist_examples (self ) -> None :
122- logging .debug ("ENTERING: component.py:All._persist_examples:302 " )
122+ logging .debug ("ENTERING: " )
123123 filepath = f'{ self ._website .get ("path" )} /{ self ._website .get ("examples" )} '
124124 logging .info (f'Persisting { self ._id } examples: { filepath } ' )
125125 dump_dict (filepath , self ._examples )
126- logging .debug ("EXITING: component.py:All._persist_examples:306 " )
126+ logging .debug ("EXITING: " )
127127
128128 def apply (self ) -> None :
129- logging .debug ("ENTERING: component.py:All.apply:373 " )
129+ logging .debug ("ENTERING: " )
130130 for kind in ['clients' ,'core' , 'docs' , 'modules' , 'assets' ]:
131131 for component in self .get (kind ):
132132 if type (component ) == str :
@@ -151,50 +151,30 @@ def apply(self) -> None:
151151 die (f'Unknown component definition for { component } ' )
152152 c .apply ()
153153 self ._persist_examples ()
154- logging .debug ("EXITING: component.py:All.apply:402" )
155-
156-
157- class Core (Component ):
158- def __init__ (self , filepath : str , root : dict = None ):
159- logging .debug ("ENTERING: component.py:Core.__init__:408" )
160- super ().__init__ (filepath , root )
161- self ._content = f'{ self ._root ._content } /{ self ._stack_path } '
162- logging .debug ("EXITING: component.py:Core.__init__:411" )
163-
164- def apply (self ) -> None :
165- logging .debug ("ENTERING: component.py:Core.apply:477" )
166- logging .info (f'Applying core { self ._id } ' )
167- files = self ._get_docs ()
168- files += self ._get_commands ()
169- self ._get_misc ()
170- self ._get_groups ()
171- self ._get_data ()
172- self ._get_conf_file ()
173- logging .debug ("EXITING: component.py:Core.apply:485" )
174- return files
154+ logging .debug ("EXITING: " )
175155
176156
177157class Client (Component ):
178158 def __init__ (self , filepath : str , root : dict = None ):
179- logging .debug ("ENTERING: component.py:Client.__init__:558 " )
159+ logging .debug ("ENTERING: " )
180160 print (str ("file_path = {}" .format (filepath )))
181161 super ().__init__ (filepath , root )
182- logging .debug ("EXITING: component.py:Client.__init__:561 " )
162+ logging .debug ("EXITING: " )
183163
184164 def _get_example_id_from_file (self , path ):
185- logging .debug ("ENTERING: component.py:Client._get_example_id_from_file:564 " )
165+ logging .debug ("ENTERING: " )
186166 with open (path ) as cf :
187167 fline = cf .readline ()
188168
189169 if 'EXAMPLE:' in fline :
190- logging .debug ("EXITING: component.py:Client._get_example_id_from_file:569 " )
170+ logging .debug ("EXITING: " )
191171 return fline .split (':' )[1 ].strip ()
192172
193- logging .debug ("EXITING: component.py:Client._get_example_id_from_file:572 " )
173+ logging .debug ("EXITING: " )
194174 return None
195175
196176 def _copy_examples (self ):
197- logging .debug ("ENTERING: component.py:Client._copy_examples:577 " )
177+ logging .debug ("ENTERING: " )
198178 if ex := self .get ('examples' ):
199179 repo = self ._git_clone (ex )
200180 dev_branch = ex .get ('dev_branch' )
@@ -238,10 +218,10 @@ def _copy_examples(self):
238218
239219 logging .info (f'Example { example_id } processed successfully.' )
240220 examples [example_id ][self .get ('label' )] = example_metadata
241- logging .debug ("EXITING: component.py:Client._copy_examples:615 " )
221+ logging .debug ("EXITING: " )
242222
243223 def apply (self ) -> None :
244- logging .debug ("ENTERING: component.py:Client.apply:618 " )
224+ logging .debug ("ENTERING: " )
245225 logging .info (f'Applying client { self ._id } ' )
246226 self ._copy_examples ()
247- logging .debug ("EXITING: component.py:Client.apply:621 " )
227+ logging .debug ("EXITING: " )
0 commit comments