fix: moved faillable statements into a try block
This commit is contained in:
@@ -145,14 +145,13 @@ def main(driver: WebDriver, logger = logging.getLogger('main')):
|
||||
try:
|
||||
file = Path('template.xlsx').resolve()
|
||||
template = openpyxl.load_workbook(file)
|
||||
header = next(data)
|
||||
source = template.active
|
||||
output = BytesIO()
|
||||
except Exception as e:
|
||||
logger.critical('Unable to load template excel', exc_info=e)
|
||||
return 7
|
||||
|
||||
header = next(data, None)
|
||||
source = template.active
|
||||
output = BytesIO()
|
||||
|
||||
def preprocess(data: str):
|
||||
try: return float(data)
|
||||
except ValueError: pass
|
||||
@@ -172,7 +171,7 @@ def main(driver: WebDriver, logger = logging.getLogger('main')):
|
||||
source[coord] = value
|
||||
|
||||
sheet = template.copy_worksheet(source)
|
||||
sheet.title = 'Copy'
|
||||
sheet.title = "COPY"
|
||||
logger.debug('%s', sheet.title)
|
||||
|
||||
if not len(template.worksheets) > 1:
|
||||
|
||||
Reference in New Issue
Block a user