示例#1
0
    def _handleGetImageList(self, payload):
        out      = []
        rootPath = AlloyEnvironment.getRootIconPath()
        folder   = payload['imageCategoryID']

        for image in os.listdir(os.path.join(rootPath, folder)):
            if image.split(u'.')[-1] not in [u'jpg', u'png']:
                continue
            out.append(folder + os.sep + image)

        return out
示例#2
0
    def _handleGetImageCategories(self, payload):
        out      = []
        rootPath = AlloyEnvironment.getRootIconPath()
        for p in os.listdir(rootPath):
            path = os.path.join(rootPath, p)
            if not os.path.isdir(path):
                continue

            items = os.listdir(path)
            if not items:
                continue

            out.append({'label':p[0].upper() + p[1:], 'id':p})

        return out