aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSan Jacobs2020-08-25 10:59:52 +0200
committerSan Jacobs2020-08-25 10:59:52 +0200
commitbe2c3b8512ce4c055d8fd6f36b2e6419f56ea6aa (patch)
treeb4415d41ac61cd1a2a25c680c5e6b7ffa7f4fbeb
parentccc80bc90b339d49bbfe325a80dfc1cf707d69c1 (diff)
downloadfilmstripper-be2c3b8512ce4c055d8fd6f36b2e6419f56ea6aa.tar.gz
filmstripper-be2c3b8512ce4c055d8fd6f36b2e6419f56ea6aa.tar.bz2
filmstripper-be2c3b8512ce4c055d8fd6f36b2e6419f56ea6aa.zip
Partial PEP 8 refactor
-rw-r--r--filmstripper.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/filmstripper.py b/filmstripper.py
index 9c93e50..aee1744 100644
--- a/filmstripper.py
+++ b/filmstripper.py
@@ -23,8 +23,8 @@ def brkck(**args):
if len(sys.argv) > 2:
try:
print("Reading input folder...")
- inputFolder = sys.argv[1]
- print(inputFolder)
+ input_folder = sys.argv[1]
+ print(input_folder)
except:
print("ERROR: Input folder argument invalid.")
broke = True
@@ -39,7 +39,7 @@ if len(sys.argv) > 2:
print("ERROR: Output file argument invalid.")
broke = True
else:
- inputFolder = "input/"
+ input_folder = "input/"
outputFile = "output/output.png"
if path.isfile(outputFile):
@@ -68,22 +68,22 @@ brkck()
try:
if "v" in sys.argv[3] or "V" in sys.argv[3]:
print("Using vertical layout")
- horiz = False
+ horizontal_rendering = False
elif "h" in sys.argv[3] or "H" in sys.argv[3]:
print("Using horizontal layout")
- horiz = True
+ horizontal_rendering = True
else:
print(str('ERROR: "'+sys.argv[3])+'"'+" is not a recognized layout. Use H or V.")
broke = True
except:
- horiz = False
+ horizontal_rendering = False
brkck()
# Parsing the input arguments
# And setting up basic variables
-fileList = glob.glob(str(inputFolder+"*.*"))
+fileList = glob.glob(str(input_folder+"*.*"))
fileList.sort()
firstFile = fileList[0]
inputExtension = str(firstFile.partition(".")[1]+firstFile.partition(".")[2])
@@ -121,7 +121,7 @@ print("Width: "+str(width))
print("Height: "+str(height))
print("Colorspace: "+colorspace)
-if horiz:
+if horizontal_rendering:
FSwidth = 0
widthAdd = width
heightAdd = 0
@@ -148,10 +148,10 @@ for eachFile in fileList:
if inputExtension not in eachFile:
print("ERROR: Filetype mismatch.")
broke = True
- if horiz and eachImage.height != FSheight:
+ if horizontal_rendering and eachImage.height != FSheight:
print("ERROR: Image height mismatch.")
broke = True
- if not horiz and eachImage.width != FSwidth:
+ if not horizontal_rendering and eachImage.width != FSwidth:
print("ERROR: Image width mismatch.")
broke = True
if eachImage.mode != filmstrip.mode: