made small changes to make pylint shut up

Paco Hope 2022-06-15 09:29:16 -04:00
parent e57c8f4e70
commit d504156123
1 changed files with 9 additions and 6 deletions

View File

@ -1,14 +1,16 @@
"""CLI module for converting YAML to tfscript"""
import sys
import os
import yaml
import argparse
import tempfile
import yaml
import classes
import verify
def parseFile(inputFile):
"""Parse, verify, and do the conversion."""
config = {}
config = yaml.safe_load(inputFile)
@ -24,26 +26,27 @@ def parseFile(inputFile):
def parseConfig(config):
"""With validated data structure, write out all the files."""
global args
for currentClass in config:
outfile = tempfile.NamedTemporaryFile( prefix=currentClass, delete=False )
if args.debug:
print( 'created {} '.format(
print( f'created {} ')
classDict = config[currentClass]
stringToWrite = classes.makeCFG(classDict)
os.replace(, './cfg/{}_nscript.txt'.format(currentClass))
os.replace(, f'./cfg/{currentClass}_nscript.txt')
# Main function
if __name__ == "__main__":
if __name__ == "__main__":
# Handle command line
parser = argparse.ArgumentParser(
description="Parse YAML file and produce TF2 config script."
parser.add_argument( '-d', '--debug', action='store_true',
parser.add_argument( '-d', '--debug', action='store_true',
help="Enable debugging messages.")
parser.add_argument( '-n', '--dry-run', action='store_true',
help="Parse input file, but don't write anything.")