def handle_noargs(self, **options): up = os.path.dirname appDir = up(up(up(os.path.abspath(__file__)))) print 'appDir:', appDir builder = Builder() # render svg to png if settings.GEOCAM_LENS_RENDER_SVG_ICONS: svgGlob = '%s/media_src/icons/*.svg' % appDir svgOutput = '%s/build/media/geocamLens/icons/map/' % appDir logging.debug('svgIcons %s %s' % (svgGlob, svgOutput)) for imPath in glob(svgGlob): svg.buildIcon(builder, imPath, outputDir=svgOutput) # link static stuff into build/media inst = Installer(builder) inst.installRecurseGlob('%s/static/*' % appDir, '%s/build/media' % appDir) # rotate pngs rotGlob = '%s/build/media/geocamLens/icons/map/*Point.png' % appDir rotOutput = '%s/build/media/geocamLens/icons/mapr' % appDir logging.debug('rotateIcons %s %s' % (rotGlob, rotOutput)) for imPath in glob(rotGlob): rotate.buildAllDirections(builder, imPath, outputDir=rotOutput)
def handle(self, *args, **options): up = os.path.dirname appDir = up(up(up(os.path.abspath(__file__)))) print 'appDir:', appDir builder = Builder() # render svg to png svgOutput = '%s/build/static/geocamLens/icons/map/' % appDir if settings.GEOCAM_LENS_RENDER_SVG_ICONS: svgGlob = '%s/media_src/icons/*.svg' % appDir logging.debug('svgIcons %s %s', svgGlob, svgOutput) for imPath in glob(svgGlob): svg.buildIcon(builder, imPath, outputDir=svgOutput) # link static stuff into build/media inst = Installer(builder) inst.installRecurseGlob('%s/static/*' % appDir, '%s/build/static' % appDir) # make highlighted versions of icons dstGlob = svgOutput + '*.png' logging.debug('highlightIcons %s', dstGlob) for dst in glob(dstGlob): if 'Highlighted' in dst: continue dstHighlighted = os.path.splitext(dst)[0] + 'Highlighted.png' halo.addHalo(builder, dst, dstHighlighted) # rotate pngs rotGlob = '%s/build/static/geocamLens/icons/map/*Point*.png' % appDir rotOutput = '%s/build/static/geocamLens/icons/mapr' % appDir logging.debug('rotateIcons %s %s', rotGlob, rotOutput) for imPath in glob(rotGlob): rotate.buildAllDirections(builder, imPath, outputDir=rotOutput)
def test_buildAllDirections(self): thisDir = os.path.dirname(os.path.abspath(__file__)) srcImage = '%s/media_src/icons/example.png' % os.path.dirname(thisDir) builder = Builder() logging.debug('buildAllDirections srcImage=%s outDir=%s' % (srcImage, self.outDir)) rotate.buildAllDirections(builder, srcImage, self.outDir) self.assertExists('%sexample000.png' % self.outDir) self.assertExists('%sexample180.png' % self.outDir) self.assertExists('%sexample350.png' % self.outDir)