From 09f39d4e64be9ad1176b60c41d29aa0662cc67c3 Mon Sep 17 00:00:00 2001 From: Nick Zatkovich Date: Mon, 31 Jul 2017 14:23:33 -0700 Subject: [PATCH] BUILD: code cleanup, VERSION fix Performed code cleanup, made changes to version number Make gets from Git to make it consistent across git versions --- Makefile | 2 +- graphics/text/Makefile | 26 +++++++++++------------ graphics/text/create_caption.py | 10 ++++----- graphics/text/image_dimensions.py | 1 + graphics/text/rotate.py | 0 graphics/text/{smtextgen.py => smtextgen} | 0 graphics/text/{textgen.py => textgen} | 0 graphics/text/tint.py | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) mode change 100644 => 100755 graphics/text/create_caption.py mode change 100644 => 100755 graphics/text/image_dimensions.py mode change 100644 => 100755 graphics/text/rotate.py rename graphics/text/{smtextgen.py => smtextgen} (100%) rename graphics/text/{textgen.py => textgen} (100%) mode change 100644 => 100755 graphics/text/tint.py diff --git a/Makefile b/Makefile index 4508f4ff..60437501 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause -VERSION=$(shell git describe --dirty 2>/dev/null || cat VERSION) +VERSION=$(shell git describe --abbrev=8 --dirty 2>/dev/null || cat VERSION) WADS=wads CPP=scripts/simplecpp DEUTEX=deutex diff --git a/graphics/text/Makefile b/graphics/text/Makefile index 262ba020..692db89e 100644 --- a/graphics/text/Makefile +++ b/graphics/text/Makefile @@ -56,7 +56,7 @@ all: text_strings help.png credit.png wikilrs.png wivctms.png titlepic # Generate the menu and level strings text_strings: config.py fontchars ../../lumps/dehacked.lmp - python textgen.py + python textgen cp $(TEXTGEN_GRAPHIC_LUMPS) ../ # Background for the help screen is a color shifted version of INTERPIC: @@ -65,8 +65,8 @@ helpbg.png: ../interpic.png # Generate transparent image containing text for the HELP screen: help.png: text_strings helpbg.png - python smtextgen.py help.png 320x200 \ - -background "helpbg.png" \ + python smtextgen help.png 320x200 \ + -background "helpbg.png" \ 150,5 "file:helpttl.png" \ 10,25 "Weapons" \ 80,25 "file:../../sprites/shota0.png" \ @@ -123,14 +123,14 @@ help.png: text_strings helpbg.png credit.png: text_strings helpbg.png credit.txt - python smtextgen.py credit.png 320x200 \ - -background "helpbg.png" \ - 120,5 "file:freettl.png" \ + python smtextgen credit.png 320x200 \ + -background "helpbg.png" \ + 120,5 "file:freettl.png" \ 10,30 "include:credit.txt" cp $@ ../ wikilrs_horiz.png: - python smtextgen.py $@ 49x7 \ + python smtextgen $@ 49x7 \ 0,0 killers wikilrs.png: wikilrs_horiz.png @@ -138,7 +138,7 @@ wikilrs.png: wikilrs_horiz.png cp $@ ../ wivctms.png: - python smtextgen.py $@ 54x7 \ + python smtextgen $@ 54x7 \ 0,0 victims cp $@ ../ @@ -157,12 +157,12 @@ fdmtitle.png: ../titlepic/freedm_titlepic.png cp $@ ../ clean: - rm -f $(TEXTGEN_GRAPHICS) helpbg.png help.png \ - graphics.stamp *.pyc credtext.png \ - credtext.png credit.png dmwilv*.png wikilrs.png \ + rm -f $(TEXTGEN_GRAPHICS) helpbg.png help.png \ + graphics.stamp *.pyc credtext.png \ + credtext.png credit.png dmwilv*.png wikilrs.png \ wivctms.png wikilrs_horiz.png ../credit.png ../help.png \ - ../wikilrs.png ../wivctms.png \ - fd1title.png fd2title.png fdmtitle.png \ + ../wikilrs.png ../wivctms.png \ + fd1title.png fd2title.png fdmtitle.png \ ../fd1title.png ../fd2title.png ../fdmtitle.png for graphic in $(TEXTGEN_GRAPHICS); do rm -f ../$$graphic; done rm -fr __pycache__ diff --git a/graphics/text/create_caption.py b/graphics/text/create_caption.py old mode 100644 new mode 100755 index bb687fa0..1d1eac36 --- a/graphics/text/create_caption.py +++ b/graphics/text/create_caption.py @@ -1,18 +1,18 @@ #!/usr/bin/env python -# coding=utf-8 +# encoding: utf-8 +# SPDX-License-Identifier: BSD-3-Clause + +from __future__ import unicode_literals from PIL import Image, ImageFont, ImageDraw import sys import os #create_caption.py -#try: -# font = ImageFont.truetype("DejaVuSansCondensed-Bold.ttf", 11) -#except IOError: font = ImageFont.load_default() -txt1= u"© 2001-2017" +txt1= "© 2001-2017" txt2= os.environ['VERSION'] background_image = Image.open(sys.argv[1]) background_image.load() diff --git a/graphics/text/image_dimensions.py b/graphics/text/image_dimensions.py old mode 100644 new mode 100755 index 98d1807e..4e9f78f7 --- a/graphics/text/image_dimensions.py +++ b/graphics/text/image_dimensions.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # SPDX-License-Identifier: BSD-3-Clause import re diff --git a/graphics/text/rotate.py b/graphics/text/rotate.py old mode 100644 new mode 100755 diff --git a/graphics/text/smtextgen.py b/graphics/text/smtextgen similarity index 100% rename from graphics/text/smtextgen.py rename to graphics/text/smtextgen diff --git a/graphics/text/textgen.py b/graphics/text/textgen similarity index 100% rename from graphics/text/textgen.py rename to graphics/text/textgen diff --git a/graphics/text/tint.py b/graphics/text/tint.py old mode 100644 new mode 100755 index a766b674..5e940687 --- a/graphics/text/tint.py +++ b/graphics/text/tint.py @@ -50,4 +50,4 @@ if __name__ == '__main__': import os import sys - main(sys.argv[1], sys.argv[2], sys.argv[3]) \ No newline at end of file + main(sys.argv[1], sys.argv[2], sys.argv[3])