コード例 #1
0
ファイル: Class.py プロジェクト: zhangming0305/jasy
    def getApi(self):
        field = "api[%s]" % self.__id
        apidata = self.__cache.read(field, self.__mtime)
        if apidata is None:
            apidata = ApiData(self.__name)
            
            apidata.scanTree(self.getTree(cleanup=False))
            
            metaData = self.getMetaData()
            apidata.addAssets(metaData.assets)
            for require in metaData.requires:
                apidata.addUses(require)
            for optional in metaData.optionals:
                apidata.removeUses(optional)
                
            apidata.addSize(self.getSize())
            apidata.addPermutations(self.getPermutationKeys())
            
            self.__cache.store(field, apidata, self.__mtime)

        return apidata
コード例 #2
0
ファイル: Class.py プロジェクト: dadicool/jasy
    def getApi(self, highlight=True):
        field = "api[%s]-%s" % (self.id, highlight)
        apidata = self.project.getCache().read(field, self.mtime)
        if apidata is None:
            apidata = ApiData(self.id, highlight)
            
            tree = self.__getTree(context="api")
            indent()
            apidata.scanTree(tree)
            outdent()
            
            metaData = self.getMetaData()
            apidata.addAssets(metaData.assets)
            for require in metaData.requires:
                apidata.addUses(require)
            for optional in metaData.optionals:
                apidata.removeUses(optional)
                
            apidata.addSize(self.getSize())
            apidata.addFields(self.getFields())
            
            self.project.getCache().store(field, apidata, self.mtime)

        return apidata