Fix for issue#197. Also removed the valid file extensions list from web/file_cmds.py since it wasn't used. (#205)

This commit is contained in:
Daniel Markstedt 2021-08-22 12:37:43 -07:00 committed by GitHub
parent 0bd12e93f5
commit 66342dc18a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 5 deletions

View File

@ -6,9 +6,6 @@ import time
from ractl_cmds import attach_image
from settings import *
valid_file_suffix = ["*.hda", "*.hdn", "*.hdi", "*.nhd", "*.hdf", "*.hds", "*.hdr", "*.iso", "*.cdr", "*.zip"]
valid_file_types = r"|".join([fnmatch.translate(x) for x in valid_file_suffix])
def create_new_image(file_name, type, size):
if file_name == "":

View File

@ -5,7 +5,7 @@ import re
from settings import *
valid_file_suffix = ["*.hda", "*.hdn", "*.hdi", "*.nhd", "*.hdf", "*.hds", "*.hdr", "*.iso", "*.cdr", "*.zip"]
valid_file_suffix = ["*.hda", "*.hdn", "*.hdi", "*.nhd", "*.hdf", "*.hds", "*.hdr", "*.iso", "*.cdr", "*.toast", "*.img", "*.zip"]
valid_file_types = r"|".join([fnmatch.translate(x) for x in valid_file_suffix])
# List of SCSI ID's you'd like to exclude - eg if you are on a Mac, the System is usually 7
EXCLUDE_SCSI_IDS = [7]

View File

@ -136,7 +136,7 @@ def attach():
print("file_name", file_name)
print("valid_file_types: ", valid_file_types)
if re.match(valid_file_types, file_name):
if file_name.lower().endswith("iso"):
if file_name.lower().endswith((".iso", ".cdr", ".toast", ".img")):
image_type = "cd"
else:
image_type = "hd"