def create_importlet(self, path, script): path = codepath(path) if not path.startswith('/'): path = '/'.join([self.code_group.name, path]) ds = self.store_python_code(path, script) stamp(ds, "importlet", {}) return Importlet(self, ds)
def __getitem__(self, path_or_ref): if isstring(path_or_ref): path = codepath(path_or_ref) else: path = self._node[path_or_ref].name assert path.startswith('/code') node = self._node[path] if isinstance(node, h5py.Group): return CodeGroup(self._paper, node) else: return CodeFile(self._paper, node)
def get_local_module(self, name): path = codepath('/'.join(['', 'python-packages'] + name.split('.'))) return APNode(self.code_group).get(path, None)
def add_module(self, name, module_code): path = codepath('/'.join(['', 'python-packages'] + name.split('.'))) ds = self.store_python_code(path, module_code) stamp(ds, "module", {})