def all_names(self): """Generates all Static Ids""" for fullname in self.all_files(): (_, _, fileBaseName, fileExtension) = getFileTuple(fullname) if self._allowedextensions and fileExtension not in self._allowedextensions: continue yield fileBaseName.split(".")[0]
def __init__(self, fullpath): Memory.__init__(self) self._content = {} from pydsl.Memory.Search.Searcher import MemorySearcher self._searcher = MemorySearcher(self) from pydsl.Memory.File.Python import getFileTuple (_, _, fileBaseName, _) = getFileTuple(fullpath) import imp myobj = imp.load_source(fileBaseName, fullpath) self._content.update(myobj.mydict)
def __init__(self, fullpath): Memory.__init__(self) self._content = {} from pydsl.Memory.Search.Searcher import MemorySearcher self._searcher = MemorySearcher(self) from pydsl.Memory.File.Python import getFileTuple (_, _, fileBaseName, _) = getFileTuple(fullpath) import imp myobj = imp.load_source(fileBaseName, fullpath) for element in myobj.mylist: self._content[self._generatekey(element)] = element
def summary_from_filename(self, modulepath): (_, _, fileBaseName, ext) = getFileTuple(modulepath) if _isRELFileName(modulepath): result = {"iclass":"re","identifier":fileBaseName, "filepath":modulepath} elif _isGDLFileName(modulepath): result = {"iclass":"BNFGrammar","identifier":fileBaseName, "filepath":modulepath} elif _isBoardFileName(modulepath): result = {"iclass":"Board", "identifier":fileBaseName, "filepath":modulepath} else: from pydsl.Memory.File.Python import summary_python_file result = summary_python_file(modulepath) return InmutableDict(result)