Beispiel #1
0
    def make_asset(self, asset_name):
        r'''Makes asset.

        Returns none.
        '''
        assert stringtools.is_snake_case_string(asset_name)
        asset_filesystem_path = os.path.join(
            self._current_storehouse_filesystem_path, asset_name)
        asset_manager = self._initialize_asset_manager(asset_filesystem_path)
        asset_manager._write_stub()
Beispiel #2
0
 def _make_asset(self, asset_name):
     if os.path.sep in asset_name:
         asset_name = os.path.basename(asset_name)
     assert stringtools.is_snake_case_string(asset_name)
     path = os.path.join(
         self._current_storehouse_path, 
         asset_name,
         )
     manager = self._initialize_asset_manager(path)
     if hasattr(manager, '_write_stub'):
         manager._write_stub()
     elif hasattr(manager, 'fix'):
         manager.fix(prompt=False)
Beispiel #3
0
 def is_nonempty_snake_case_string(expr):
     if stringtools.is_snake_case_string(expr):
         return bool(expr)
     return False
Beispiel #4
0
 def _add_metadata(self, metadatum_name, metadatum_value):
     assert stringtools.is_snake_case_string(metadatum_name)
     metadata = self._get_metadata()
     metadata[metadatum_name] = metadatum_value
     self.interactively_rewrite_metadata_module(metadata)
Beispiel #5
0
 def _add_metadatum(self, metadatum_name, metadatum_value):
     assert stringtools.is_snake_case_string(metadatum_name)
     metadata = self._get_metadata()
     metadata[metadatum_name] = metadatum_value
     self.rewrite_metadata_module(metadata, prompt=False)